Jump to content
Sign in to follow this  
fn_Quiksilver

Vehicle Respawn System: Improvements?

Recommended Posts

Are there any improvements you would suggest for current vehicle respawn systems?

Hi guys,

Just clearing some more old code from my PC. Came across a vehicle respawn system I worked on back in July. After a brief look through armaholic, it is slightly more advanced and higher performance than any scripts of similar scope I saw there. So I'm going to wrap it up and release it.

Just wondering if there are any 'wishlist' type things that you'd like to see in a vehicle respawn system, in which current systems may fall short. I can perhaps make some last minute adjustments to accommodate.

PM or reply.

Share this post


Link to post
Share on other sites

Larrow's vehicle respawn script found here at the bottom does just about everything. Including destroyed and abandoned timers, Abandoned distance, the ability to redefine a vehicles respawn position on the fly and I believe it even supports dynamic vehicle respawn. It's all too much imo. Far more than is needed lol.

That said I'm sure we could use an another advanced system.

Edited by Iceman77

Share this post


Link to post
Share on other sites
Larrow's vehicle respawn script found here at the bottom does just about everything... including destroyed and abandoned timers. Abandoned distance. The ability to redefine a vehicles respawn position on the fly, dynamic based vehicle respawn... it's all too much imo. Far more than is needed lol.

That said I'm sure we could use an another advanced system.

Unfortunately those systems are flawed ... I'll demonstrate how in a YT vid in a couple days.

Share this post


Link to post
Share on other sites

Ahh okay :rolleyes:. Not sure you've ever even used larrow's. I'm not talking about LVR.

Share this post


Link to post
Share on other sites

Post the flaws to do with LVR in the LVR thread aswell. I'd appreciate it. That way I can atleast fix what I have. If there is infact flaws with Larrow's vehicle spawn script aswell, feel free to post them there too. Cheers.

---------- Post added at 11:45 ---------- Previous post was at 11:40 ----------

Just so you know, the link to nslvr is 404'd.

Okay I found a copy buried. Link should work now.

I'm all for the OP making a advanced respawn script. Was just saying.. Larrow's was (is??) pretty dang advanced in it's own right. So to say no advanced vehicle respawn scripts existed, was kind of false IMO. :p

Edited by Iceman77

Share this post


Link to post
Share on other sites

- ability to delay first spawn of the vehicle (at the mission start);

- ability to set array of custom vehicles, random one of which will be picked every respawn. So it's different vehicle every time;

- feature that automaticly copies current vehicle's init line into new spawned vehicle;

- additional init parameters for newly spawned vehicle;

- ability to choose what determines if vehicles is abandoned: distance from original spawn or time its not being used.

Share this post


Link to post
Share on other sites

- ability to delay first spawn of the vehicle (at the mission start);

- ability to set array of custom vehicles, random one of which will be picked every respawn. So it's different vehicle every time;

- feature that automaticly copies current vehicle's init line into new spawned vehicle;

- additional init parameters for newly spawned vehicle;

- ability to choose what determines if vehicles is abandoned: distance from original spawn or time its not being used.

Thanks! Green indicates features already included in the release version. Red indicates features not included. Black is dunno.

Can you elaborate on #1? What would determine when the vehicle first spawns? A simple sleep or conditional?

Also, with the last one ... Is this an either/or thing? The way I currently have it set is that the vehicle does not get evaluated if its within a small distance of its current spawn point. Once the vehicle leaves the small area, its determined to be 'in play' and then there are some evaluations done to determine if a reset is required.

If a vehicle is within say 25M of someone who doesn't move much, should it still reset after a certain time if its close to them?

At the moment, if no one is within the configured radius it gets reset, and then the delay timer kicks in before its available again.

Share this post


Link to post
Share on other sites

Can you elaborate on #1? What would determine when the vehicle first spawns? A simple sleep or conditional?

Well, you enter respawn time for the vehicle and if you set this option to 'true' script will delete editor unit and spawn it after random delay (no longer than respawn time). Or something like that. I don't think you should give TOO much customization to user, otherwise it will be too hard to setup.
Also, with the last one ... Is this an either/or thing? The way I currently have it set is that the vehicle does not get evaluated if its within a small distance of its current spawn point. Once the vehicle leaves the small area, its determined to be 'in play' and then there are some evaluations done to determine if a reset is required.
I think it should be either/or, but your evaluations are pretty good too. Except one thing, why do you need this small circle? What's bad about vehicle reseting to 0 damage / full ammo / original pos?

For example, you have a jet in a hangar, you take it and fly for a bit, then come back to the base and drive it back to the hangar. You can't park it inside because jets can't go backward from hangar, so it's just hanging in this small no-reset circle near the hangar and cluttering the base. Not that great, right?

Share this post


Link to post
Share on other sites

- Optional parameter <array> for the vehicle to parachute down and from which height. Would be niche usage, but it'd be neat for out in the field and the like.

- Maybe also store an array of vehicles from the config and add a optional randomization parameter too. Which would allow all vehicles or certain types only (air, tanks, cars etc) to re-spawn.

- Optional MHQ parameter. Vehicle will auto be added to BI respawn menu.

- Optional parameter for which sector the vehicle may belong too for dynamic side spawning (modified LVR to do that actually for a c&h).

- Optional parameter - Ability to redefine spawn position for the vehicle

- Optional parameter if vehicle will respawn manned with AI

- Optional parameter if vehicle is flying or not

My 2C. Cheers.

Edited by Iceman77

Share this post


Link to post
Share on other sites
- Optional parameter <array> for the vehicle to parachute down and from which height. Would be niche usage, but it'd be neat for out in the field and the like.

- Maybe also store an array of vehicles from the config and add a optional randomization parameter too. Which would allow all vehicles or certain types only (air, tanks, cars etc) to re-spawn.

- Optional MHQ parameter. Vehicle will auto be added to BI respawn menu.

- Optional parameter for which sector the vehicle may belong too for dynamic side spawning (modified LVR to do that actually for a c&h).

- Optional parameter - Ability to redefine spawn position for the vehicle

- Optional parameter if vehicle will respawn manned with AI

- Optional parameter if vehicle is flying or not

My 2C. Cheers.

Thanks :)

Green is already coded in, red isn't coded in (yet).

The parachute isn't perfect as wind plays a role, so the vehicle does not land exactly where it's supposed to, there is some drift. have used findEmptyPosition to secure a safe '4 wheels on dirt' result however.

Re-defining spawn position is a bit tricky as usually that involves custom mission-specific variables and conditions. As such I've used the marker system for this, so scenario designer will be able to select whether it respawns at the initial spawn or at the spawn marker, or a random spawn marker.

The MHQ thing is a good idea. It won't be flogged in MP like some of the other features are already, so report any issues. Unfortunately I don't know much about MHQs. Should it create a marker on spawn, or just retain a variable for use elsewhere. Don't know yet.

Just finished coding in the AI-related stuff. I had it with the ability to spawn AI (uavs for example), but elaborated on that somewhat and now I think it is reasonably versatile.

Here is the AI params:

[TRUE,WEST,[0,[100,300]],[1,QS_fnc_setAISkill],[[],BIS_fnc_taskPatrol]],

0 = Bool - AI vehicle or not. TRUE to spawn as an AI vehicle, FALSE to spawn empty.

1 = Side - Which side does it belong to? EAST WEST RESISTANCE CIVILIAN

2 = Aircraft controls. 0 for ground/water, 1 for heli, 2 for plane. Then spawn height and spawn forward velocity. (improper tweaking here can have funny results :))

3 = Skill. An included skill function with some preset skill settings.

4 = Post-creation code. BIS_fnc_taskPatrol as an example. There is some loss of versatility here for the coming release version (which will lack scenario-specific variables), and without tweaking it will only use its spawn position as the reference for waypoints, unless the scenario designers creates their own code to fill in for BIS_fnc_taskPatrol.

- Optional parameter for which sector the vehicle may belong too for dynamic side spawning (modified LVR to do that actually for a c&h).

Can you please elaborate? Not sure what you mean by sector... I have a feeling that is covered above with the AI side params

Anyone who contributes some ideas that make it in will get a mention in the credits for their contribution. Already there is mention for Tophe, Iceman77 and a couple others.

Edited by MDCCLXXVI

Share this post


Link to post
Share on other sites

Fantastic :). Okay, there are sector modules within the game that create sectors to fight over. Different sides can own any given sector. Usually regarding pvp, the sectors switch sides many times. Regarding the suggestion:

You essentially assign a vehicle to a sector. When it respawns, you check who owns the sector and spawn the appropriate vehicle. eg; if nato owns sector, then the vehicle spawns in a nato or west vehicle. Think about Battlefield games and how their vehicle's respawn. You can get the sector owner very simply with _theModule getVariable "owner".

I did something similar for a sector control scenario. The code for the function can be seen @ gitHub. Though I'm not going as deep as you are with features.

One more thing. A nice touch I noticed is adding a notification for when the vehicle's respawn aswell.

Cheers.

---------- Post added at 18:16 ---------- Previous post was at 18:12 ----------

Oh wait... also you can add a respawn position very simply by using https://community.bistudio.com/wiki/BIS_fnc_addRespawnPosition. eg; to the MHQ. That adds a respawn position to the menu. Use the sister command to remove respawn position.

note: I'd get familiar with how the sectors may work and how the BI respawn templates work. That should give you a better idea of how to go about it.

Edited by Iceman77

Share this post


Link to post
Share on other sites

U good option would be for a veihicle/unit to respawn with its init line intact.

For example,i like adding an init line to tanks,to make the crew not leave veihicle because the loose mobility,but rather stay in tank and continue fighting.On respawn,the init dosent get carried to the unit respawning.

Share this post


Link to post
Share on other sites

Unfortunately in most cases respawn eventhandlers do not work with vehicles as the vehicle doesn't actually "respawn". Most (that I've seen) vehicle respawn scripts create a new vehicle instead, simulating a "respawn". Alternatively, simply run code on the vehicle when it respawns.

However, if there is a way or code that actually allows the vehicle to actually "respawn" that'd be neat. Is that how BI respawn works? eg; respawnVehicleDelay and/or sector module?

Share this post


Link to post
Share on other sites
Unfortunately in most cases respawn eventhandlers do not work with vehicles as the vehicle doesn't actually "respawn". Most (that I've seen) vehicle respawn scripts create a new vehicle instead, simulating a "respawn". Alternatively, simply run code on the vehicle when it respawns.

However, if there is a way or code that actually allows the vehicle to actually "respawn" that'd be neat. Is that how BI respawn works? eg; respawnVehicleDelay and/or sector module?

I do not know, however, there is the vanilla BIS vehicle respawn module under F7 that gives you the option to input expressions for the new vehicle being respawned, and with some of the ideas brought up in this thread, it may be possible to respawn an empty vehicle, then through the expressions field add all the necessary stuff so the vehicle is thermally "lockable" and doesn't fire back, move, or whatever else.

Share this post


Link to post
Share on other sites

Ahh okay. I thought you meant adding an actual respawn Eh to the vehicle(s). The respawn module (can) executes code on the newly created vehicle.

Edited by Iceman77

Share this post


Link to post
Share on other sites
Ahh okay. I thought you meant adding an actual respawn Eh to the vehicle(s). The respawn module (can) executes code on the newly created vehicle.

Well, I did, but didn't think too in-depth about it, and then I just thought of the respawn module so....yea :p.

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  

×