Jump to content
Sign in to follow this  
anusmangler

specific unit respawn at marker

Recommended Posts

Anyone know on how to have a unit say a rifle man spawn on a marker after he has died....I'm not talking about a player or a playable unit. Im talking about a NPC. My mission is using units in a town to recruit them and when they die more is respawned after a "cool down" any one have a script for this or and direction I can be pointed in would be nice thank in advanced.

Share this post


Link to post
Share on other sites

There's probably more streamlined ways, but here's a quick hack using a respawn EH.

_unit addEventHandler ["Respawn", { 
    if (typeOf (_this select 0) in ["B_Soldier_F", "B_officer_F"]) then { // If the unit's type is in the array, then move him to the marker's position
         (_this select 0) setPos getMarkerPos "myMrk";
    };
}];

Edited by Iceman77
  • Like 1

Share this post


Link to post
Share on other sites

Sorry for the late response but I cant seem to get this to work. I have a tigger with "nul = execVM "group.sqf";" and a BLUFOR rifle man. I kill him and he does not re spawn my marker is named marker and I have ajusted it in the script provided. Just a weee bit more help or tell me what I did wrong

Share this post


Link to post
Share on other sites
Sorry for the late response but I cant seem to get this to work. I have a tigger with "nul = execVM "group.sqf";" and a BLUFOR rifle man. I kill him and he does not re spawn my marker is named marker and I have ajusted it in the script provided. Just a weee bit more help or tell me what I did wrong

Do you have the eventhandler above in the rifleman's init field? (Omitting "_unit" with "this")

Share this post


Link to post
Share on other sites
... I kill him and he does not re spawn ...

The EH has nothing to do with the rifleman re-spawning. The rifleman should respawn at his default location if you've respawns set up correctly. The EH simply fires when the unit has respawned and then moves him to your new marker. Post more code and give us more info about what you're trying to achieve, as a whole. That way we can post accurate code / variables, explicitly for your particular scripts.

Share this post


Link to post
Share on other sites

Yeah this is basically the same thing that is in this post, however, here we are dealing with NPCs instead of actual players.

Share this post


Link to post
Share on other sites
Yeah this is basically the same thing that is in this post, however, here we are dealing with NPCs instead of actual players.

Yup. Basically a duplicate thread.

Share this post


Link to post
Share on other sites

basically this is a mission where you play as a rebel in a small town....the "idea" is behind this is you walk around the town and at places in the town there will spawn a random unit that you can recruit to join your group. Obviously as units die your going to need new guys so hence the need to go back and recruit more guys/ drop off equipment (guns, ammo, cars, armor,ect) So, to go along with the re spawn of units around town, I need them to be able to join your group which I have this script for " _unit = _this select 0;

_usergroup = group player;

[_unit] join _usergroup;"

Any ideas how I can flow this all together?

---------- Post added at 23:26 ---------- Previous post was at 23:24 ----------

WOW thats super weird! Thats from freaky shit, its like someone else is in my mind.....just different idea sorta

Also I tried placing the script in the units INIT field and it returns a error but doesnt say way. Yes I changed _unit with this

Edited by Anusmangler

Share this post


Link to post
Share on other sites

I'm grasping that you want AI units to respawn (randomly?) around the town at a marker(s?) position(s) and to join the player's group when they respawn. Do you want specific unit types to spawn at certain areas? Do you want it random? All's I can tell you so far is that you can use a combination of respawn_markers and EHs to dictate re-spawn / grouping. If you could post the scripts you're working with and be a little more precise with how you want things to work, we can get the ball rolling.

Share this post


Link to post
Share on other sites

Using this for unit to join group (join.sqf) " _unit = _this select 0; _usergroup = group player; [_unit] join _usergroup;" " through a addaction "act1 = u1 addaction ["Join group","join.sqf",0,1, true, true,"test2"];" to make it seem like you are talking to them. Im using your script for respawn, and as for the random markers I really havent set that up yet, mainly Im just trying to solve the issue of having units re spawn at a marker and having them be able to join your group after re spawn. after I have that handled I can get on with the random placing and what not. for example Im just trying to get a regular rifle man to spawn on a marker, join your group, then get killed, then re spawn, then join group, and do this over and over and over

Share this post


Link to post
Share on other sites

to my knowledge AI non-playable wont respawn

you have to spawn them back in , essentialy recreating a new unit

there are some tools like UPS-mon and many other AI scripts that can do that for you

Share this post


Link to post
Share on other sites
to my knowledge AI non-playable wont respawn

you have to spawn them back in , essentialy recreating a new unit

there are some tools like UPS-mon and many other AI scripts that can do that for you

Please tell me what UPS-mon and what other ai scripts are there. thank you

Share this post


Link to post
Share on other sites
to my knowledge AI non-playable wont respawn

you have to spawn them back in , essentialy recreating a new unit

there are some tools like UPS-mon and many other AI scripts that can do that for you

That is what I was thinking, but I was going to use a killed EH then pass the unit through to a script that created it on a pre-defined marker. I just didn't get too far with it before sleep was calling my name :p.

>>>>>>Just found this as well: http://www.armaholic.com/page.php?id=22520

Edited by JShock

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  

×