Jump to content
Sign in to follow this  
norrin

SQF revive script

Recommended Posts

I've been thinking about this since our quick convo last night and I might have to cede to raedor's infinitely greater knowledge on this one as I cannot think of an easy way to do this.

Here's why:

1.  The revive scripts use a lot of dynamically created variables that require the unit's name at start-up.  This is problematic from the point of view that you can't just use the player's name as you run the risk that spaces or special characters in the player's name is going to stuff up the processing of these variables.

2. It might be possible to create a "simple" name for a unit as a player joins eg. the first player would be "c1" the second "c2" etc.  This function could  be added at the start of the revive_init.sqf script and be local to the client but you're going to have broadcast public variables so the simple name is updated sequentially for each joining player and I'm not sure what would happen if for instance 8 players join at once or 2 players JIP at the almost the same time.  

Running a looping script on the server that checks whether the player is in mission and then assigns a simple name to the player's unit may be away around this but you're going to have to halt the processing of the revive scripts until this is done and even then I'm not sure how easy it will be to implement and its going to take me some time to test whether this will work.  

So I'm really sorry mate but unless you've got a really good reason not to name the units in the editor I'm not sure whether its worth spending the time pursuing.

Of course I may have missed the point entirely and there may be a very simple solution so if someone (eg. raedor) has one could they please post.

Share this post


Link to post
Share on other sites

Cheers for the effort mate.

Looks like I'll just name all 60 units crazy_o.gif and update the revive_init script. Thanks again.

Share this post


Link to post
Share on other sites

AI enabled revive update (beta 0.52)

* Fixes some problems with dying discovered by ricnunes.  

* Also adds an option to the revive_init.sqf.  If <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_respawn_position = 3;is set then the player dies outright when the revive timer elapses.

Get it here: http://www.norrin.org/downloads/Revive_beta/AI_enabled_052.Intro.rar

Share this post


Link to post
Share on other sites

<s>Hey Norrin, only just noticed the more realistic revive, looks like exactly what I was after! Unfortunately the link appears to be down.</s>

Think I was over-using my modem by uploading, it's working fine now! Either way, thanks a lot for this, time for some testing!

Share this post


Link to post
Share on other sites

Hey Norrin im using your latest realistic AI disabled revive.

But im having problems?

Now usually i create my mission then add your scripts.

This time though i used your demo then added my stuff.

Which is Awacs/2 primary weapons/deployable mortars/mando hitch.

All works fine except for the revive?

Players disappear when killed?

Im not sure if one of the other scripts are conflicting?

I have your 3 markers on the map etc,ihavent edited any of your stuff other than:

Players names 'a1','a2' etc instead of 'alpha_1' etc

Changed 'can be revived' & 'can revive' to UK troops class names.

Any ideas?

Thanks

ck

Share this post


Link to post
Share on other sites

Yeah I'm getting the similar fault as CK, I am also rename the slots to something else other than 'alpha_1" etc. Also running your latest script! Mission all runs fine even on local machine. But when uploaded it doesn't work or some slots do etc.

I am only running UPS and vehicle respawns scripts. I am using a Mod thought that has a whole pile of new vehicle/guns and effects in it?

Share this post


Link to post
Share on other sites

Not sure whats happening here as CKs mission worked fine for me with all his mods but not for him unless he removed the PUMA chopper addon. Maybe if you're using this addon try your mission without it and see what happens.

Share this post


Link to post
Share on other sites

It wasnt actually the Puma's mate.

Just the awacs scripts smile_o.gif

But strange still that it wofked fine for you. huh.gif

Thanks again for trying Norrin.

Share this post


Link to post
Share on other sites

AI_enabled revive update version 0.52b (16th December 2008)

Get it here: http://norrin.org/downloads/Revive_beta/AI_enabled_052b.Intro.rar

Another small update to the AI_enabled revive script that gives you the option to stop AI units from dismounting vehicles to revive unconscious units <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_AI_dismount = 0; on line 161 of the revive_init.sqf .

Also fixes a bug in the anti-slope code.

Share this post


Link to post
Share on other sites

"More realistic" revive update (v0.2b)

This update addresses a couple of problems with this script, such as players falling unconscious again the moment they are revived.

You can down load the hot fix from here: link removed

Just copy over the two files in the medic_sqf with the two files in the rar file

If you prefer you can download the entire script suite from here: link removed

EDIT

Links removed as another updated version will be posted later today - sorry

Share this post


Link to post
Share on other sites

"More realistic" revive update v0.2c

Sorry to keep spamming updates.

The latest update fixes a problem with AI units causing a "bleeding" variable error and the mission_end function and also includes the bug fixes from yesterdays update.   icon_rolleyes.gif

Get it here: http://norrin.org/downloads/Medic_script/Medic_script_02c.Intro.rar

I'm also getting reports of problems with the unconscious and spectator cams which I can't replicate, if anybody else has seen these could they please let me know.

Thanks,

norrin

Share this post


Link to post
Share on other sites

Hey norrin,

just wondering... Is there any way to detect, if a mission use your AI - Enable or AI - Disable Revive?

Any specific Global variables i can looking for?

Well i need to know if a unit was killed, becouse every time a unit was killed, the unit will be spawned to the Respawn_West, Respawn_East, Respawn_Guerilla and so on and i have a script, which is checking the distance between the units and the enemy and every time i die and respawn the script starts running, becouse i'm at the Respawn_West point, which is far away.

I was thinking of something like:

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

if (player distance Respawn_West < 200) then {sleep 10};

or

if (isNil "Boot_Hill") then {run the script};

But i can't check this, becouse thouse two objects are Markers and you can not use Markers for this kind of check...

So any other way i can check if a unit was killed and the revive is used??

Any Global variable or array i can check??

Thank you very much. smile_o.gif

Share this post


Link to post
Share on other sites

Hi SNK,

Yeah there is a global variable made for each unit when it is unconscious in both the AI_enabled and disabled scripts

Here's the code for it:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">call compile format ["%1_a = true; publicVariable '%1_a'", _unit];

So if the unit is named alpha_1 in the editor its unconscious variable look likes: alpha_11_a

This variable is set back to false when the unit is revived.

I'm a bit rusty on the old scripting front at the moment but when checking the distance to markers can't you do this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if (player distance (getMarkerPos "Respawn_West") < 200)

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

if (player distance _mrkr_pos < 200)

Let me know if this doesn't help.

best wishes,

norrin

Share this post


Link to post
Share on other sites

Hey norrin,

well look's like i forgot the "getMarkerPos" command.... icon_rolleyes.gif

I sloved the problem with this:

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

_a = (getMarkerPos "Boot_Hill");

if (((_a select 0) == 0) && ((_a select 1) == 0)) then

{

run the script

}

else

{

if (((_a select 0) != 0) && ((_a select 1) != 0)) then

{

if (player distance (getMarkerPos "Boot_Hill) > 300) then

{

run the script

};

};

};

If no Boot_Hill Marker exist _a is [0,0,0] else if a Boot_Hill marker exist _a is [12556,745889,0]

Thank's again for your help norrin. thumbs-up.gif

Share this post


Link to post
Share on other sites

Hi Norrin,

Trying to make the Mobile Respawn Work in AI-Enabled latest version.

But I keep getting error and points to Line 143 in move_spawn.sqf

Is this line in the revive_init.sqf suppose to have the NORRN in front on it?

if (_NORRN_mobile_spawn == 1) then {r_ms_base_1 = _NORRN_Base_1};

huh.gif

What is the proper config on revive_init for mobile in Demo Mission?

How do I do this in AI-Enabled?

NORRNCustomExec3="execvm ""JAAF_AddActions.sqf"";";

Thanks

Vengeance

Share this post


Link to post
Share on other sites

Hi mate,

Funny you should bring this up as I only discovered the problem myself yesterday while I was updating the code for the next version.

You can get the fixed file from here: http://www.norrin.org/downloads/Revive_fix/move_spawn.sqf

The fixed file goes in the revive_sqf\mobile subfolder.

For the second problem, I haven't fully enabled that feature to the the AI_enabled script yet but I will for the next version.  If you want to you can add it yourself just add the line to the revive_init.sqf just before the definition of the Norrn_revive_array like this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_respawn_at_base_weapons = ["M4"];

NORRNCustomExec3="execvm ""JAAF_AddActions.sqf""";

NORRN_revive_array = [];

Please let me know if you are still having problems.

Best wishes,

norrin

EDIT: I've now updated the AI_enabled revive052b download with the fixed file (see first page of thread).

Share this post


Link to post
Share on other sites

Thanks Norrin, that worked good. Let me know when you get the other CustomExec working I see I don't get my AddActions when I am Revived only Respawn.

Thanks

Share this post


Link to post
Share on other sites
Thanks Norrin, that worked good.  Let me know when you get the other CustomExec working I see I don't get my AddActions when I am Revived only Respawn.

Thanks

Ok, add a second line to the revive_init.sqf, just above the other you added, with the following code <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">NORRNCustomExec1="execvm ""JAAF_AddActions.sqf"""; and it should work after you are revived as well.

Share this post


Link to post
Share on other sites

Hi Norrin,

I sent you an email of an error I got when rejoining.

Thanks

Vengeance

Share this post


Link to post
Share on other sites

Norrin,

I have updated Xeno's Attack mission with AI-Enabled, and it works great much more fun but when I capture and clear the first base he moves spawn 1 there. Except It does not work with AI-Enabled.

How do I dynamically move Spawn 1?

Vengeance

Share this post


Link to post
Share on other sites

Excellent vengeance1. Have been trying to do that myself. Are you able to release what you have so far to the community ?

[TAO] Kremator

Share this post


Link to post
Share on other sites

norrin,

As quite a few of us use ACE currently (due to the content that it offers), would it be possible to upgrade the revive script to look for players/AI that are 'downed' but not dead - ie they require epinephrine (or bandages,morphine)?

This would make the script just AMAZING!

[TAO] Kremator

PS looking forward to the next version anyway !

Share this post


Link to post
Share on other sites

It should just be a matter of moving the marker position on the server.  If you're still having problems send me the mission and I'll fix it up for you mate. Sorry I haven't done anything about the other bug you sent me but ACE has kind of taken over my scripting life at the moment but I'll try and get you a fix asap for that as well.

@Kremator - I've now got quite an understanding of the wound code in ACE so I should be able to do that, not sure how long it will take me though as I've now rejoined the ACE team and I've got quite a few ACE bugs on my to do list and they take priority at the moment.

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  

×