BetterDeadThanZed Posted April 15, 2014 Report Share Posted April 15, 2014 On OpenDayz.net, I found a dance party script. It adds a party where music is playing, there's a campfire and dancers. Using that as a base, I created an Epoch event that spawns it randomly. Now, I want to take it a step further and make a DZMS mission where bandits spawn as well as "hookers". So far I've done this: Copied the DZMSAISpawn.sqf and renamed it DZMSHookerSpawn.sqf. I made these changes to it: Assigned new skins: _aiskin = ["Hooker1","Hooker2","Hooker3","Hooker4"] call BIS_fnc_selectRandom; Changed the behavior to match those for the dance party. This is to make them dance, and to make them invincible: //Add the behaviour _unit enableAI "TARGET"; _unit enableAI "AUTOTARGET"; _unit enableAI "MOVE"; _unit enableAI "ANIM"; _unit enableAI "FSM"; _unit allowDammage false; _unit addEventHandler ["handleDamage", {false}]; _unit setBehaviour "CARELESS"; Next, I created a mission and tried to spawn the hookers: //DZMSAISpawn spawns AI to the mission. //Usage: [_coords, count, skillLevel, unitArray] [_coords,2,1,"DZMSUnitsMinor"] call DZMSAISpawn; sleep 5; [_coords,2,1,"DZMSUnitsMinor"] call DZMSAISpawn; sleep 5; [_coords,2,1,"DZMSUnitsMinor"] call DZMSHookerSpawn; sleep 5; The bandits are spawning, but not the hookers. The log says this: "Warning Message: Script Scripts\DZMSHookerSpawn.sqf not found" but the DZMSHookerSpawn.sqf is most definitely in the Scripts folder. Any ideas? Link to comment Share on other sites More sharing options...
TheVampire Posted April 15, 2014 Report Share Posted April 15, 2014 You're calling DZMSHookerSpawn and unless you have that defined as a location, nothing will happen. Read the top of DZMSFunctions.sqf Link to comment Share on other sites More sharing options...
BetterDeadThanZed Posted April 15, 2014 Author Report Share Posted April 15, 2014 You're calling DZMSHookerSpawn and unless you have that defined as a location, nothing will happen. Read the top of DZMSFunctions.sqf So I do this in DZMSFunctions.sqf? DZMSAISpawn = compile preprocessFileLineNumbers "\z\addons\dayz_server\DZMS\Scripts\DZMSAISpawn.sqf"; DZMSHookerSpawn = compile preprocessFileLineNumbers "\z\addons\dayz_server\DZMS\Scripts\DZMSHookerSpawn.sqf" Link to comment Share on other sites More sharing options...
insertcoins Posted April 15, 2014 Report Share Posted April 15, 2014 On OpenDayz.net, I found a dance party script. It adds a party where music is playing, there's a campfire and dancers. Using that as a base, I created an Epoch event that spawns it randomly. Now, I want to take it a step further and make a DZMS mission where bandits spawn as well as "hookers". So far I've done this: Copied the DZMSAISpawn.sqf and renamed it DZMSHookerSpawn.sqf. I made these changes to it: Assigned new skins: _aiskin = ["Hooker1","Hooker2","Hooker3","Hooker4"] call BIS_fnc_selectRandom; Changed the behavior to match those for the dance party. This is to make them dance, and to make them invincible: //Add the behaviour _unit enableAI "TARGET"; _unit enableAI "AUTOTARGET"; _unit enableAI "MOVE"; _unit enableAI "ANIM"; _unit enableAI "FSM"; _unit allowDammage false; _unit addEventHandler ["handleDamage", {false}]; _unit setBehaviour "CARELESS"; Next, I created a mission and tried to spawn the hookers: //DZMSAISpawn spawns AI to the mission. //Usage: [_coords, count, skillLevel, unitArray] [_coords,2,1,"DZMSUnitsMinor"] call DZMSAISpawn; sleep 5; [_coords,2,1,"DZMSUnitsMinor"] call DZMSAISpawn; sleep 5; [_coords,2,1,"DZMSUnitsMinor"] call DZMSHookerSpawn; sleep 5; The bandits are spawning, but not the hookers. The log says this: "Warning Message: Script Scripts\DZMSHookerSpawn.sqf not found" but the DZMSHookerSpawn.sqf is most definitely in the Scripts folder. Any ideas? Vid when you are done? :D Link to comment Share on other sites More sharing options...
BetterDeadThanZed Posted April 15, 2014 Author Report Share Posted April 15, 2014 Vid when you are done? :D Most definitely. I have the Hookers spawning in. Now I have to get them dancing and get the music working. :) Link to comment Share on other sites More sharing options...
BetterDeadThanZed Posted April 15, 2014 Author Report Share Posted April 15, 2014 Hmm.. now I'm getting 1 hooker spawning in instead of 4 and she just won't dance. Here's what I have in the mission sqf: //DZMSAISpawn spawns AI to the mission. //Usage: [_coords, count, skillLevel, unitArray] [_coords,6,1,"DZMSUnitsMinor"] call DZMSAISpawn; sleep 3; [_coords,4,1,"DZMSUnitsMinor"] call DZMSHookerSpawn; sleep 3; This is my DZMSHookerSpawn.sqf: http://pastebin.com/RC2Kx46d No errors are being logged in my RPT. Link to comment Share on other sites More sharing options...
TheVampire Posted April 16, 2014 Report Share Posted April 16, 2014 You have a while inside a for loop. What this means is it spawns the first hooker, hits the while loop, and until that loop reaches 50 it won't go on to spawn the second hooker. Change the while into a spawn, and move it outside the for loop. Link to comment Share on other sites More sharing options...
BetterDeadThanZed Posted April 16, 2014 Author Report Share Posted April 16, 2014 You have a while inside a for loop. What this means is it spawns the first hooker, hits the while loop, and until that loop reaches 50 it won't go on to spawn the second hooker. Change the while into a spawn, and move it outside the for loop. Most of what I've done has been by looking at other scripts and basing it on that. I'm not sure how to fix that. Any chance you could help me out with that? :) Link to comment Share on other sites More sharing options...
TheVampire Posted April 16, 2014 Report Share Posted April 16, 2014 [] Spawn { while {(_barOpen < 50)} do { crueDanceLight1C = [1,0,0]; _light1 = "#lightpoint" createVehicleLocal _unitpos; _light1 setLightBrightness 0.1; crueDanceLight1 setLightColor crueDanceLight1C; crueDanceLight1 setLightAmbient crueDanceLight1C; sleep _rndNum; _aiunit playMove "ActsPercMstpSnonWnonDnon_DancingStefan"; sleep _rndNum2; deleteVehicle crueDanceLight1; _barOpen = _barOpen + 1; }; }; And put that outside the For loop. Link to comment Share on other sites More sharing options...
BetterDeadThanZed Posted April 16, 2014 Author Report Share Posted April 16, 2014 So, like this? //Probably unnecessary, but prevents client AI stacking if (!isServer) exitWith {}; for "_x" from 1 to _unitcount do { //Lets pick a skin from the array _aiskin = ["Hooker1","Hooker2","Hooker3","Hooker4"] call BIS_fnc_selectRandom; //Lets spawn the unit _unit = _unitGroup createUnit [_aiskin, [(_position select 0),(_position select 1),(_position select 2)], [], 10, "PRIVATE"]; //Make him join the correct team [_unit] joinSilent _unitGroup; //Add the behaviour _unit enableAI "TARGET"; _unit enableAI "AUTOTARGET"; _unit enableAI "MOVE"; _unit enableAI "ANIM"; _unit enableAI "FSM"; _unit allowDammage false; _unit addEventHandler ["handleDamage", {false}]; _unit setBehaviour "CARELESS"; //Remove the items he spawns with by default removeAllWeapons _unit; removeAllItems _unit; _barOpen = 0; _rndNum = floor(random 20); _rndNum2 = floor(random 20); //Lets prepare the unit for cleanup _unit addEventHandler ["Killed",{ [(_this select 0), (_this select 1)] ExecVM DZMSAIKilled; }]; _unit setVariable ["DZMSAI", true]; }; while {(_barOpen < 50)} do { crueDanceLight1C = [1,0,0]; _light1 = "#lightpoint" createVehicleLocal _unitpos; _light1 setLightBrightness 0.1; crueDanceLight1 setLightColor crueDanceLight1C; crueDanceLight1 setLightAmbient crueDanceLight1C; sleep _rndNum; _aiunit playMove "ActsPercMstpSnonWnonDnon_DancingStefan"; sleep _rndNum2; deleteVehicle crueDanceLight1; _barOpen = _barOpen + 1; }; //diag_log text format ["[DZMS]: Spawned %1 Hooker at %2",_unitcount,_position]; Link to comment Share on other sites More sharing options...
TheVampire Posted April 17, 2014 Report Share Posted April 17, 2014 This here should work for what you are trying to do. http://pastebin.com/Z1qFRG4b Link to comment Share on other sites More sharing options...
BetterDeadThanZed Posted April 17, 2014 Author Report Share Posted April 17, 2014 Thank you for that! All four hookers are spawning now but unfortunately are not dancing. :( Link to comment Share on other sites More sharing options...
antartis Posted April 26, 2014 Report Share Posted April 26, 2014 Thank you for that! All four hookers are spawning now but unfortunately are not dancing. :( hooker have limited ANIM, will not dance , etc etc. Link to comment Share on other sites More sharing options...
Carp! Posted May 5, 2014 Report Share Posted May 5, 2014 Thank you for that! All four hookers are spawning now but unfortunately are not dancing. :( Pics! Link to comment Share on other sites More sharing options...
Chainsaw Squirrel Posted October 21, 2014 Report Share Posted October 21, 2014 From what I gather from elsewhere .. only the male characters can dance http://forums.bistudio.com/archive/index.php/t-99034.html Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now