Jump to content
Sign in to follow this  
rip31st

Scripting help for a new person

Recommended Posts

What I would like to do is create waves of about 40 OPFOR that rush from a particular point and move to a way point towards BLUFOR. If they are eliminated or a certain amount of time passes another wave spawns from the same spot and rushes to the same waypoint. I want this to happen about 4 times max. If BLUFOR forces eliminate a wave and move to a close proximity to their spawn point, they stop spawning and begin spawning from another point doing the same thing. OF course the OPFOR would not be allowed to respawn from any of these positions once BLUFOR have moved into or through these positions.

So far I've figured out how to create the intial wave in the editor. But I can't figure out anything else.

Thanks in advance for the help!

Share this post


Link to post
Share on other sites

Are the OPFOR Going to be players or AI?

If they are AI---

open a text document and put this in it-

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

"SquadLeaderE" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SquadLeaderE" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74GL}", 0.6, "corporal"]; "SquadLeaderE" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SquadLeaderE" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SquadLeaderE" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SquadLeaderE" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74GL}", 0.6, "corporal"]; "SquadLeaderE" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SquadLeaderE" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {M16A4}", 0.6, "corporal"]; "SquadLeaderE" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {M16A4}", 0.6, "corporal"]; "SquadLeaderE" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SquadLeaderE" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {M9}", 0.6, "corporal"]; "SquadLeaderE" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierEMedic" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierEMedic" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {M4A1}", 0.6, "corporal"]; "SoldierEMedic" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierEMedic" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierEMedic" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {M16A2}", 0.6, "corporal"]; "SoldierEMedic" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierEMedic" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierEMedic" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierEMedic" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {SVD}", 0.6, "corporal"]; "SoldierEMedic" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierEMedic" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {MP5}", 0.6, "corporal"]; "SoldierEMedic" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {SVD", 0.6, "corporal"]; "SoldierESniper" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierESniper" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierESniper" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {SVD}", 0.6, "corporal"]; "SoldierESniper" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {SVD}", 0.6, "corporal"]; "SoldierESniper" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {SVD}", 0.6, "corporal"]; "SoldierESniper" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {SVD}", 0.6, "corporal"]; "SoldierESniper" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierESniper" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {MP5}", 0.6, "corporal"]; "SoldierESniper" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierESniper" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {M4A1}", 0.6, "corporal"]; "SoldierESaboteur" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierESaboteur" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {M9}", 0.6, "corporal"]; "SoldierESaboteur" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierESaboteur" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierESaboteur" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74GL}", 0.6, "corporal"]; "SoldierESaboteur" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierESaboteur" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {M16A4}", 0.6, "corporal"]; "SoldierESaboteur" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierESaboteur" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierESaboteur" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {M1A2}", 0.6, "corporal"]; "SoldierESaboteur" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierESaboteur" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierESaboteur" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierESaboteur" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierESaboteur" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AKS74U}", 0.6, "corporal"]; "SoldierESaboteur" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierESaboteur" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierESaboteur" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierESaboteur" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {M136}", 0.6, "corporal"]; "SoldierESaboteur" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierESaboteur" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierESaboteur" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierESaboteur" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AKS74U}", 0.6, "corporal"]; "SoldierEG" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierEG" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {M9}", 0.6, "corporal"]; "SoldierEG" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AKS74U}", 0.6, "corporal"]; "SoldierEG" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierEG" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierEG" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierEG" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierEG" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {M9}", 0.6, "corporal"]; "SoldierEG" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierEG" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierEG" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierEG" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierEG" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AKS74U}", 0.6, "corporal"]; "SoldierEG" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AKS74U}", 0.6, "corporal"]; "SoldierEG" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {M4A1}", 0.6, "corporal"]; "SoldierEG" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierEG" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {M16A4}", 0.6, "corporal"]; "SoldierEG" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierEG" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierEG" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {M4A1}", 0.6, "corporal"]; "SoldierEG" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AKS74U}", 0.6, "corporal"]; "SoldierEG" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {M9}", 0.6, "corporal"]; "SoldierEG" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"]; "SoldierEG" createUnit [getMarkerPos "wave1", _groupAlpha,"loon1 = this;

this addweapon {AK74}", 0.6, "corporal"];

Save the file as wave.sqs (make sure the file type is set to all files)

This will create a bunch of units at a marker. As for the capturing the zones I'm not quite sure.

Then in the editor make a trigger, put Activation: BLUEFOR. And in the On Act:

put--

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> this exec "wave.sqs"

Be Sure to make a marker and name it wave1. Put the marker wherever you want the soldiers to be spawned. And the trigger wherever you want, when the BLUEFOR side steps into the trigger the wave of OPFOR will be created at the marker. Hopefully this helps. wink_o.gif

Share this post


Link to post
Share on other sites

Here is the error I encounter when the trigger is set off:

Error in expression <this addweapon {AK74}", 0.6, "corporal"]>

Error position: <addweapon {AK74}", 0.6, "corporal"]>

Error addweapon: Type Bool, expected Object

Share this post


Link to post
Share on other sites

change all the { } around the weaponnames into ' '

like: {AK74} becomes 'AK74'

Share this post


Link to post
Share on other sites

No errors now. Now the problem is nothing happens...no enemy spawns when the trigger is activated.

Share this post


Link to post
Share on other sites

Did you create a marker named wave1, and place it where you want the enemies to spawn?

If not, they won't show up, because the script spawns them at a marker, in this case wave1

Share this post


Link to post
Share on other sites

Yes I placed a marker named wave1. I created a trigger activated by BLUFOR. The trigger calls the wave.sqs in the onactivation field just like you said... I know the trigger works because it calls the above mentioned error(fixed now...no error now) when I enter the trigger area but the AI don't spawn in at the marker. Am I missing some components here? I'm new to scripting period. Do I have to have another file to initialize the ai?

crazy_o.gif

Share this post


Link to post
Share on other sites

hmmmm...no that should create them. I'll try somethings out and see what I come up with wink_o.gif

Share this post


Link to post
Share on other sites

anything yet?

Share this post


Link to post
Share on other sites

Maybe sickboy has some insight

Share this post


Link to post
Share on other sites

The createUnit command requires that the group the units are being put in already exists.

Share this post


Link to post
Share on other sites

Yeah I figured that out. I was pulling my hair out trying to get it to work. One weird thing I noticed is when I created 24 units within the script 140+ enemy showed up on my multiplayer server. We had dead bodies laying all over the place. Is there a script to rid them from memory? They lagged us down big time.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×