Jump to content
Sign in to follow this  
norrin

Problems with progressive respawn points

Recommended Posts

Problems with progressive spawn points and errors in the base respawn version of deltathree mission on XGN server

Thought I'd start a new topic for this discussion which initially started here: http://www.xtremegamingnetwork.com.au/Forums....&page=2

I have to admit that I don't have a lot of experience in ArmA editing but I'm in the process of trying to convert some of the XGN public server's (IP:203.13.37.43:2302) base respawn co-op missions so that the spawn point is progressively updated and moves forward as certain objectives or trigger points are reached. This is meant to prevent long hikes from the initial base following death/respawning in missions that span a large distance.

Here's what I did in my test run through mission I set up on Rahmadhi using Planck's respawn tutorial which you can find here: http://www.ofpec.com/ed_depot/tutes.php

In the description.ext file I put this:

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

 respawndelay = 10; In the Init.sqs file I put this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[]exec "Respawn.sqs" In the respawn.sqs file I put this:

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

 

 #START

 @! alive player

 @ alive player

 ? (stagethree): goto "THREE"

 ? (stagetwo): goto "TWO"

 ? (stageone): goto "ONE"

 goto "START"

 

 #ONE

 Player setpos (getmarkerpos "MARKER_A")

 goto "START"

 

 #TWO

 Player setpos (getmarkerpos "MARKER_B")

 goto "START"

 

 #THREE

 Player setpos (getmarkerpos "MARKER_C")

 goto "START" I then positioned three markers on the map called: MARKER_A, MARKER_B, MARKER_C where MARKER_A was the initial spawn point and the other two markers were progressive spawn points.

It looks like this in the mission.sqm file:

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

             {

                         items=3;

                         class Item0

                         {

                                     position[]={2765.840820,5.791657,3047.049561};

                                     name="MARKER_A";

                                     type="Empty";

                         };

                         class Item1

                         {

                                     position[]={2843.176025,17.245464,2928.961182};

                                     name="MARKER_B";

                                     type="Empty";

                         };

                         class Item2

                         {

                                     position[]={2886.288086,17.181799,2866.737061};

                                     name="MARKER_C";

                                     type="Empty";

                         };

             }; Next to the three markers I placed triggers that are activated by blufor and public variable the respawn point name. So in the onActiv slot of the 1st trigger I put:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">stageone = true; Publicvariable "stageone"; For the second I put:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">stagetwo = true; Publicvariable "stagetwo"; And for the third I put:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">stagethree = true; Publicvariable "stagethree"; For the 2nd and 3rd triggers I also got it to print up on the screen "Spawn point relocated" when one of these triggers was activated.

In the mission.sqm file it looks like this:

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

             {

                         items=3;

                         class Item0

                         {

                                     position[]={2884.065918,17.143801,2869.404541};

                                     a=100.000000;

                                     b=5.000000;

                                     activationBy="WEST";

                                     age="UNKNOWN";

                                     expActiv="stagethree = true; Publicvariable ""stagethree""";

                                     class Effects

                                     {

                                                 titleType="TEXT";

                                                 title="Spawn point relocated";

                                     };

                         };

                         class Item1

                         {

                                     position[]={2814.887695,16.216124,2978.047363};

                                     a=100.000000;

                                     b=1.000000;

                                     rectangular=1;

                                     activationBy="WEST";

                                     age="UNKNOWN";

                                     expCond="true";

                                     expActiv="stageone = true; Publicvariable ""stageone""";

                                     class Effects

                                     {

                                     };

                         };

                         class Item2

                         {

                                     position[]={2855.177490,16.981621,2928.515869};

                                     a=100.000000;

                                     b=5.000000;

                                     activationBy="WEST";

                                     age="UNKNOWN";

                                     expActiv="stagetwo = true; Publicvariable ""stagetwo""";

                                     class Effects

                                     {

                                                 titleType="TEXT";

                                                 title="Spawn point relocated";

                                     };

                         };

             };

After much playtesting last night I found that this method works well for human players but I also discovered a couple of problems.  

The first has nothing to do with my scripting but occurs in the base respawn version of the "deltathree" mission currently on the XGN public Co-op server.

Whenever I respawn I get a config.bin error and get a message saying that there is no entry for MP5SD mags. I also respawn with an MP5SD with only one mag as do my AI team members. Does anybody else also get this error in the deltathree mission currently running on this server?

I can fix this in part by using a script that spawns me with a particular weapon but I still get the error message and the AI team still spawn with MP5SDs. I don't get any of these problems if I make my own missions and use these scripts though so I think its in part due to the way this mission was originally written.

The second problem occurs in both my progressive spawn updated version of the "deltathree" mission and any new progressive spawn mission I make as the scripts I'm using only work for human players. AI team members respawn on themselves if you do not have a marker "respawn_west" defined or at the "respawn_west" marker if it is defined.

I guess one way around this, that would stop dead AI team members from respawning, would be to define "respawn_west " somewhere a long way away from the mission area so that the AI team members never rejoin the mission and are effectively dead. Unfortunately the constant "where are you" messages from these guys may drive you bananas though.

Better still I need to somehow rewrite the scripts (both the progressive respawn script and spawn with weapon script) so they also work for AI team members and not just human players. I'll look into this but it could be beyond my capabilities and any help would be greatly appreciated.

On a more positive note I have managed to combine several scripts at once for instance human players spawning with particular weapons and players spawning in the group then at a progressive respawn point with particular weapons when all members of the group are dead.

Share this post


Link to post
Share on other sites

What if you changed the method for the progressive respawning?

Instead of manually spawning the players, just move the spawn point over the top of each progressive marker.

Something like:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">"Respawn_West" setMarkerPos getMarkerPos "MARKER_A"

...

"Respawn_West" setMarkerPos getMarkerPos "MARKER_B"

...

"Respawn_West" setMarkerPos getMarkerPos "MARKER_C"

as required.

(untested for syntax, but I use a variation of this)

Also, this way you use the built-in respawning capabilities rather than everyone spawning on top of each other at the exact same spot.

Share this post


Link to post
Share on other sites

Thanks Doc you're a genius smile_o.gif

I just changed the script to look like this:

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

#START

? (stagethree): goto "THREE"

? (stagetwo): goto "TWO"

? (stageone): goto "ONE"

goto "START"

#ONE

"Respawn_West" setMarkerPos getMarkerPos "MARKER_A"

goto "START"

#TWO

"Respawn_West" setMarkerPos getMarkerPos "MARKER_B"

goto "START"

#THREE

"Respawn_West" setMarkerPos getMarkerPos "MARKER_C"

goto "START"

Then added an extra marker called "respawn_west"  at my initial spawn location and Bob's your uncle.  The spawn points are now updated for both human players and AI team members.

Share this post


Link to post
Share on other sites

You might want to add some delays in there because that's going to be constantly cycling.

However a better way to re-do it is to have the place where you set the: stageone, stagetwo, stagethree variables also move the markers for you when those variables are updated. That way it's just a one time deal and no need for looping.

Be sure it's in an area run by all clients though because markers are one of those things that are client side.

Share this post


Link to post
Share on other sites

@Strango after reading your post I've had another go at it.  This time to avoid cycling I've set up the progressive spawn points in triggers without using a script.  The triggers now look like this:

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

{

items=3;

class Item0

{

position[]={2811.622803,14.082720,3019.846680};

a=10.000000;

b=5.000000;

activationBy="WEST";

age="UNKNOWN";

expActiv="""Respawn_West"" setMarkerPos getMarkerPos ""MARKER_A""; WP_2 = true; Publicvariable ""WP_2""";

class Effects

{

titleType="TEXT";

title="Spawn point relocated";

};

};

class Item1

{

position[]={2855.177490,16.981621,2928.515869};

a=100.000000;

b=5.000000;

activationBy="WEST";

age="UNKNOWN";

expCond="this AND WP_2";

expActiv="""Respawn_West"" setMarkerPos getMarkerPos ""MARKER_B""; WP_3 = true; Publicvariable ""WP_3""";

class Effects

{

titleType="TEXT";

title="Spawn point relocated";

};

};

class Item2

{

position[]={2884.065918,17.143801,2869.404541};

a=100.000000;

b=5.000000;

activationBy="WEST";

age="UNKNOWN";

expCond="THIS AND WP_2 AND WP_3";

expActiv="""Respawn_West"" setMarkerPos getMarkerPos ""MARKER_C""";

class Effects

{

titleType="TEXT";

title="Spawn point relocated";

};

};

};

This certainly seems to work on a local server, will try it on a dedi hopefully later today.

EDIT:  Just tried it on a mates dedicated server and it works like a charm.  If anybody with infinitely more editing experience can see a problem with this can they please post otherwise its fixed. (Fingers crossed smile_o.gif)

Share this post


Link to post
Share on other sites

I would like this but the other way around so that as I advance on the east side the other sides spawn point gets pushed back I tried it by changing the side to east but this didnt work, I have no idea what im doing. Could somebody show me how to Make it so that the respawn for the east side is pushed back as i advance upun them if possible.

Share this post


Link to post
Share on other sites

@colligpip that's a great idea.  I've gotta admit I'm new to this and have been struggling as well, so I'm not sure you need to make all of these steps but I'm pretty sure it will work if you do.  

I've gone through your suggestion in, hopefully, a step by step fashion (as that’s the way I understand it myself).

Firstly define two variables in the init.sqs using a text editor like Notepad.

Init.sqs

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

WP_1 = false;

WP_2 = false;

This will give you three retreat respawn points (ie. WP is just an acronym for waypoint but you could name the variables anything you like).

Create a description.ext file with the respawn info:

Description.ext

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

Respawndelay = "10"

Then place four markers on the map named Respawn_east, MARKER_A, MARKER_B and MARKER_C.  These will act as your sequential retreat respawn points.  With Respawn_east being the marker closest to the action ie. the initial OPFOR respawn point and then the others listed in order from closet to farthest away.

Now I've been updating my respawn points when the blufor advance across a certain point on the map defined by a trigger but you could also link the trigger to a completed objective such as all OPFOR in a certain area are dead.

I also link the triggers to conditions (defined by the publicvariables) so that the spawn points move back in order.  This is to prevent one clever dick from jumping in a chopper and flying to the furthest away respawn trigger and hence in your example forcing the OPFOR to respawn miles away from the action ie. these other conditions need to be satisfied first.

So next I place three triggers on the map.  I use a map point crossed by Blufor forces to update the retreating triggers.

The first trigger sets the OPFOR respawn waypoint back to MARKER_A.  So using the editor, place the following settings in the 1st trigger:

Activation: Blufor, set it to once only and present

Condition: this

On Activation: "Respawn_ east" setMarkerPos "MARKER_A"; WP_1 = true; Publicvariable "WP_1";

This business with the publicvariables just alerts all the computers connected to the server that an objective has been met.

I'd also get each trigger to activate some text such as "OPFOR respawn point reset".  This is to alert you that the trigger has been activated during testing more than anything else and you probably should remove it once you're confident everything's working OK.

The second trigger sets the OPFOR respawn waypoint back to MARKER_B and is slightly more complicated:

Activation: Blufor, set it to once only and present

Condition: this AND WP_1

On Activation: "Respawn_ east" setMarkerPos "MARKER_B"; WP_2 = true; Publicvariable "WP_2";

The "this AND WP_1" condition ensures that blufor has reached this point and the initial trigger has been activated before it will allow this second trigger to be activated.

The third trigger sets the OPFOR respawn waypoint back to MARKER_C

Activation: Blufor, set it to once only and present

Condition: this AND WP_1 AND WP_2

On Activation: "Respawn_ east" setMarkerPos "MARKER_C";

You could continue adding respawn point resets ad infinitum but you'd need to define more publicvariables in the init.sqs and update the trigger points appropriately

If you were clever, and this is beyond me for the moment, with a few more condition statements you could set this up so that the respawn points moved forward and back as the two sides fought from one side of the map and then back again.

Share this post


Link to post
Share on other sites
If you were clever, and this is beyond me for the moment, with a few more condition statements you could set this up so that the respawn points moved forward and back as the two sides fought from one side of the map and then back again.

Change from your system of several boolean variables to a single integer variable and have the variable hold the value of the current stage being fought over. Use the value of this variable to set the respawn points. This way you can move back and forth with ease.

Share this post


Link to post
Share on other sites

@Strango I've now spent a few hours trying to work out the integer variable version but its still beyond me (any help or pointers would be much appreciated).  

However, I have managed to get the mission to make move up/fall back spawn points and vice versa just using booleans and triggers though and it seems to work quite nicely. So I've now got Blufor and Opfor forces fighting and spawning backwards and forwards across the map.

Once again I'm using lines crossed as trigger points but you could of course use all enemy in an area dead (not present) triggers or the completion of some objective.

I've defined Three variables in my init.sqs

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

WP_1 = false

WP_2 = false

I've then created my mission and placed 3 markers for the Blufor named Respawn_west (ie. the initial West respawn point), West_A, West_B (moving foward across the map) and 3 markers for the Opfor named Respawn_east (ie. the initial east respawn point), East_A, East_B (moving backward across the map).

I've then placed the following triggers and conditions so that you can only move forward and back across the map in sequential spawn point order.

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

class Sensors

{

items=3;

class Item0

{

position[]={2919.076172,15.578824,2952.444336};

a=500.000000;

b=5.000000;

rectangular=1;

activationBy="WEST";

repeating=1;

age="UNKNOWN";

expCond="this AND WP_0";

expActiv="WP_1 = true; publicvariable ""WP_1""; WP_0 = false; publicvariable ""WP_0""; ""Respawn_west"" setMarkerPos getMarkerPos ""West_A""; ""Respawn_east"" setMarkerPos getMarkerPos ""East_A"";";

class Effects

{

titleType="TEXT";

title="Blufor moving up. OPFOR falling back";

};

};

class Item1

{

position[]={2882.631836,17.148685,2884.444092};

a=500.000000;

b=5.000000;

rectangular=1;

activationBy="WEST";

repeating=1;

age="UNKNOWN";

expCond="this AND WP_1";

expActiv="WP_2 = true; publicvariable ""WP_2""; WP_1 = false; publicvariable ""WP_1""; ""Respawn_west"" setMarkerPos getMarkerPos ""West_B""; ""Respawn_east"" setMarkerPos getMarkerPos ""East_B"";";

class Effects

{

titleType="TEXT";

title="Blufor moving up. OPFOR falling back";

};

};

class Item2

{

position[]={2880.853271,17.122679,2886.666504};

a=500.000000;

b=5.000000;

rectangular=1;

activationBy="EAST";

repeating=1;

age="UNKNOWN";

expCond="this AND WP_2";

expActiv="WP_1 = true; publicvariable ""WP_1"";  WP_2 = false; publicvariable ""WP_2""; ""Respawn_west"" setMarkerPos getMarkerPos ""West_A""; ""Respawn_east"" setMarkerPos getMarkerPos ""East_A"";";

class Effects

{

titleType="TEXT";

title="Opfor moving up. Blufor falling back";

};

};

I know this could be alot more elegant but it seems to work well.  You could of course define more move up/fall back points by using more boolean variables.

Share this post


Link to post
Share on other sites

could you possibly send me this misson I cant seem to get it to work - and i would like to see how you did it actually in the editor.

Thanks

Share this post


Link to post
Share on other sites

I'd be happy to. Just PM me an email address so I can send it to you. I must warn you though the mission that I use it in is not finished but the moving spawn points do work as they are supposed to so hopefully it'll help you work it out.

Share this post


Link to post
Share on other sites

The only reason I suggested an integer was so you only had one status variable to maintain instead of one for each objective. The boolean way still works and if you've got it working then you should be all set.

Share this post


Link to post
Share on other sites

Bad news.  Although this more complex advance/fallback respawn method works fine with just me playing on a local server it falls apart on a dedicated server.  For some reason although the variables are made public at the triggers, some player’s computers do not seem to recognise that the trigger conditions have been met and you end with players respawning all over the shop.  To make matters worse each time we played through the mission something a little different would happen making it difficult to identify the exact nature of the problem.

This method uses some quite complex internal scripting placed in the activation fields of triggers so I’m going to rewrite the code using an external script in the hope that it may not only simplify the writing of these missions but also help with the problems noted above.

If nothing else I’ve learnt a lot about how not to implement this script.  For instance it would be better to have the spawn point update triggers linked to capture and hold conditions ie. keeping an area free of enemies for a set period of time rather than as lines crossed as this will stop stray enemies from wandering forward and resetting respawn conditions back to their previous state in a somewhat unrealistic fashion.  

Another thing I’ve discovered is on a dedicated server I need to write a script to give the AI units some waypoints upon respawning (based on the current objective location). Otherwise they have a tendency to just mill around their respawn points and are good for little else other than target practice.

Oh, I’d just like to thank Medicare for putting it up on his dedicated server last night and taking the time to run through this with me.

Well back to the drawing board for me I suppose.  I've started to jot down some ideas on how I'm going to make this all work but I've also got alot of editing forum reading to do.  smile_o.gif

EDIT: Thinking about it more this method may still work on a dedi if the spawn point updates only went one way (eg. Blufor advancing) and didn't swap backwards and forwards as the simpler method I posted about earlier in this thread did work on a dedicated server.  I haven't had a chance to try this yet but its only a short term fix as you'd want to be able to have spawn points moving back and fowards in a two team MP match.

Share this post


Link to post
Share on other sites

Because you're doing everything with triggers and not limiting their execution to just the server, you don't need to perform publicvariables.

It's possible for the clients to get out of time sync a bit and they will run the triggers at slightly different times from each other. When you do a publicvariable you're having everyone update to the new variable value. Since your triggers are setup to check the variable that means the clients who execute last won't actually run your trigger command that has the marker movement.

Try removing the publicvariables and try again on a dedicated server.

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  

×