Jump to content
Sign in to follow this  
LaughingJack

SDKv12: Vehicle Spawner:

Recommended Posts

Posted (edited)

HI all,

 

I've been having "fun" with the Vehicle Spawner lately. My hope was to modify it to enable spawning more than one vehicle at a time and to add an Allowance to limit the total number of spawned vehicles, of the Spawner - and i think i'm close to making it work.

Thanks to @wasti for putting me on to needing a "Tracked Vehicle" array, specifically - i think (HA! LOL!) i've set things up correctly but still have a few nagging doubts.

Below are the EventGraph and SetCanSpawn, from inside the VehicleSpawner (i've left CheckCanSpawn alone atm), and things highlighted in the pics are things i have added.

 

EVENT GRAPH >

VehicleSpawner_EventGraph

To count, Add / Remove Spawned or Destroyed Vehicles from the Make Array.

The GATE because i needed to drive the REMOVE (to pass on OnVehicleDestroyed EXE).

The ARRAY to hold a count of currently spawned Tracked Vehicles.

REMOVE Tracked Vehicle, via OnVehicleDestroyed EXE.

LAST INDEX = total number spawned.

ADD Tracked Vehicle (from the SET), and driven by the (last spawned) ?IsValid EXE. (* just realised i have to re-route ADD's out EXE)

SET Total Spawned Vehicles, driven by both ADD and REMOVE EXE's.

 

SET CAN SPAWN >

VehicleSpawner_SetCanSpawn

Thought this might be a good place to stitch-in - the only place i could think of to definitively break "Can Spawn".

1. Decides if the Allowance has been met or not by the Total Spawned Vehicles value being less than the Allowance value <true/false>.

2. Checks to see if any previously spawned vehicle(of class) is still sitting inside the Spawn Zone (ie; not taken yet) <true/false>.

If Allowance = False, then the EXE will stop  - if True will pass on. *just realised i need a link to the Set Can Spawn from Allowance=False, i think (or it won't fire?)

If Spawn Zone = False, then it will Set Can Spawn to False *(what Allowance should also do)

If both 1 & 2 are True then the Set Can Spawn will be driven and set to True, as per normally.

 

I've looked at this now a number of times and can't find anything wrong with it (compiles fine ...) but i'm an amateur n00b at this stuff, at best.

 

I'm too tired to test it tonight, so if anyone sees anything i've done drastically wrong or won't work (or possibly call up things from the vasty deep...), please let me know  - still not sure how/if the array will work or not ...

 

Cheers! :)

 

Edited by LaughingJack

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×