Jump to content
Sign in to follow this  
nullsystems

AI respawn script

Recommended Posts

Hi all, slight repost but I felt it might deserve its own.

Im trying to get singular AI to respawn. Lag etc isnt an issue as its own a few in a small area.

Trigger Repeating: Cond: not alive gb1

onAct: [gb1,bgp2] exec "respawnAI.sqs"

1st is units Name, 2nd is a Location

respawnAI.sqs

-------------

Quote[/b] ]

? not local server: exit;

_spawnAIname = _this select 0

_movePlace = _this select 1

_place = getMarkerpos "respawnAIpos"

_grp = createGroup west;

_spawnAIname = _grp createUnit ["SoldierWB", _place, [], 0, "FORM"] ;  

[_spawnAIname] join _grp ;

_spawnAIname move position _movePlace ;

exit

Could anyone help me out please?

It respawns the AI once, but when i kill him again, it doesnt respawn him.

HOWEVER

------------

If I replace _spawnAIname with gb1, it works perfectly

Share this post


Link to post
Share on other sites

thers probealy alot of way's to do it.. 1st of all.. i would avoid using a trigger for this. but rather put a eventhandler on the unit. on the init field of the unit put a eventhandler "killed" which exec your respawn script. this "i think" will be better for performance. since its only executed when the unit dies..

and btw. why do you mix sqs and sqf ? stick to sqf. sqs is ofp while sqf is arma. but arma support both tho.

Share this post


Link to post
Share on other sites

Ok that deffinately makes more sense, I cant believe I forgot to use them. Thanks for that. anymore tips on the actual respawn?

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  

×