Jump to content
Sign in to follow this  
Franklin

Respawn on Radio Alpha

Recommended Posts

Im trying to setup a rifle range populated with enemy soldiers. the soldiers have all weapons removed and are set so that they wont move at all.  no problems there...

what i want to do, is be able to reset the "targets" after they have all been killed. i want them to respawn only when i use radio alpha, and ensure they stay at the exact same place, wont move, and dont have a weapon. there will be other enemy AI on the map also, that i dont want to respawn in this way. i dont know how to do this.

Share this post


Link to post
Share on other sites

I am hoping to do almost the same thing.  Its like hogan's alley, but the ai just stand there waiting to get shot.  Using AI as targets instead of the popup targets, how can I cause them to respawn at their location on command.

I get respawn, I know there are cleanup scripts for the bodies...but I can't find anything related to this.

I simply want to reset a map so that the ai re-populate a cqc shooting range instead of reloading the map.  

I don't care if its using radio alpha, or a dialogue box...I just need to control the respawn of the target ai.

Any help appreciated.

Share this post


Link to post
Share on other sites

what you could do is make a little script that gets the position of the soldier, then put the damage to 0 and set the units to there origenal position.

someting like this could work.

_unit = select _this 0

_Pos = position _unit

Radioalpha=false

#Start

@Radioalpha

Radioalpha = false

_unit setdamage 0

_unit setpos _Pos

~1

goto "Start"

save it as a .sqs script and call it by this: [unitname] exec "scriptname.sqs"

I aint sure if @ is less laggy then useing a normal loop but someone els will have to give you the anwser to that.

Share this post


Link to post
Share on other sites

As far as I know once the AI has died you can not set the damage to 0 and bring them back.

I would set up AI respawn outside the range so that as they die they spawn elsewhere. Then lay empty markers where you want them to be in the range and make a script that execs on RA to move them to each marker.

Share this post


Link to post
Share on other sites
As far as I know once the AI has died you can not set the damage to 0 and bring them back.

I would set up AI respawn outside the range so that as they die they spawn elsewhere. Then lay empty markers where you want them to be in the range and make a script that execs on RA to move them to each marker.

Good idea,that sounds workable.  Spawn them to a holding location and move them on command. Been looking for something like a teleport that can be activated on command.

If anyone can help me on the moving them on command part I would be greatful.

Share this post


Link to post
Share on other sites

this sould do the trick.

Unitname setpos position

Ill take a look on that setdamage see if it does work or not is always nice to know.

Indeed it doesnt work for dead soldiers.

Share this post


Link to post
Share on other sites
this sould do the trick.

Unitname setpos position

Ill take a look on that setdamage see if it does work or not is always nice to know.

Indeed it doesnt work for dead soldiers.

Well i can respawn them to a holding location, use a cleanup script to get rid of bodies, but moving them back to where they were is the problem...

Would like to do it on command, but even after a certain amount of time would be ok.

Teleport, move command..i dunno

Share this post


Link to post
Share on other sites

2e line last post sould work.

I take it you use a script to create the units etc.

Basicly at the start of the mission you use the getpos command to get all the locations of your soldiers.

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

Then you can use the setpos command to move the new troops there.

Share this post


Link to post
Share on other sites
2e line last post sould work.

I take it you use a script to create the units etc.

Basicly at the start of the mission you use the getpos command to get all the locations of your soldiers.

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

Then you can use the setpos command to move the new troops there.

Thats what i tried at first...and failed miserably. I then looked at trying other things. I guess I will go back to that.

My inexperience is what is holding me back. If you know of a tutorial, or even a script file I can open up and take a look out that may help me in getting a clue.

Basiclly I am trying to find something I can adapt to my needs since creating something from scratch is not my strong suit.

Share this post


Link to post
Share on other sites

Easiest:

Create a game logic. Name it (like gl1). Put it to a position where you want a soldier to respawn. Create a soldier. Name him (like soldier1). Make a trigger. Activation Radio Alpha, Repeatedly. OnAct.: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">"SoldierWB" createUnit [getpos gl1, group gl1]Try it.

Share this post


Link to post
Share on other sites
Easiest:

Create a game logic. Name it (like gl1). Put it to a position where you want a soldier to respawn. Create a soldier. Name him (like soldier1). Make a trigger. Activation Radio Alpha, Repeatedly. OnAct.: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">"SoldierWB" createUnit [getpos gl1, group gl1]

Try it.

That was the first thing I tried. It works, but I was afraid having 60-80 gamelogics might cause a meltdown? (or at least increase lag)

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  

×