Jump to content
Sign in to follow this  
KaRRiLLioN

Vehicle respawn

Recommended Posts

Here's a link to a mission source of mine where I use this create squad script to dynamically make squads, and then have them go to various waypoints, etc.

http://www.aggression.org/karr/AS_CHECKMATE.24.cain.zip

This is an MP mission designed so that even with several players, the AI are only created in areas that the players enter and if there are no players in the area, then the AI are deleted. If players return to the area, then the AI are recreated. If some of the AI were killed in a previous encounter, then only the ones that were living at the time are recreated.

If you look at all of the squad scripts, then you can see how I control them. Everything is kept server side, and if I want to monitor the total number of enemies, I just use a large trigger to tell me how many East/West there are.

In the Init.sqs file, I defined all of the various squads that I want to spawn. You can change them around a bit if you want to. You then can use those definitions to exec the create squad script.

The nice thing about this script is that the vcl's are all defined in the vcl class script so it will assign crewmen as needed, depending upon how they are defined. I think I changed most of the tanks to not have commanders, since they aren't really needed, and they take up extra CPU power anyway.

I hope this helps.

Another method you need to remember that you can use is the PublicVariable command if you want all players to be able to see individual groups. One method I use if I need to make server-side groups visible is ObjNull and Publicvariable.

First I make a client-side script that will check for something to not be null, i.e.:

#Init

NewSoldier = ObjNull

@!Isnull NewSoldier

_sld = NewSoldier

[_sld] exec "SoldierMonitor.sqs"

Goto "Init"

Now on the Server-side you'd have a script that does this:

;;You can have east and west running separate scripts client-side

?(_west) : _init = "sldW = this"

?(_east) : _init = "sldE = this"

_skill = 1

_rank = "CORPORAL"

_crewType CreateUnit [[_posX,_posY],_groupCreate,_init,_skill,_rank]

?(_west) : _newsld = sldW

?(_east) : _newsld = sldE

_newSquad = _newSquad + [_newsld]

NewSoldier = _newsld

PublicVariable "NewSoldier"

etc.

Anyway that should give you some ideas. You can differentiate for east, west, etc. BTW the _west and _east vars are Boolean that I declared in the script depending upon which team they were making units for.

Share this post


Link to post
Share on other sites

KaRRiLLioN

Thanks wink.gif

I will check it out.

I can not play the mission, I'm not having Resistance sad.gif

Share this post


Link to post
Share on other sites

Hmm, I think the only Res stuff in it is from weapons, because it's an older map used with 1.46 originally. Remove the LoadAmmocrates scripts, or rename them so they won't load the res weapons, and then go into the Mission.sqm and remove references to bis_weaponpack and bis_resistance.

I think that will fix things for you. Although you really should get Resistance, since you're missing out on a LOT.

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  

×