Jump to content
Sign in to follow this  
dreadpirate

Objects on map versus created by script

Recommended Posts

So, I'm creating a co-op Insurgency-style mission.

Currently, I have 5 caches, named "cache01" ... "cache05" with a script that randomly hides them inside buildings (not too close to base, of course).

Then I have triggers with "!alive cache01" etc as Condition to check for task completion.

My questions are:

  • How would I benefit from using createVehicle to create my caches?
  • Would it be better to use scripts rather than on-map triggers to check for completion?
  • What are the potential pitfalls for using that approach (publicVariable, etc)?

Share this post


Link to post
Share on other sites

Well if you use Triggers or Scripts to wait for an action to be executed is a personal question, I for myself use triggers only if I want to monitor unit movements and alike, but if it's something like waiting until all conditions for a task has been met, I'll use scripts (effectively using waitUntil).

Using a trigger has the benefit that the trigger will be created for every player, but this also can be a demerit because you don't want that for all cases (it's safe though if it's a single player mission).

If you want to randomly do something, there's no other way around but using scripts - sure, you can set some probability the entity will be shown in the mission editor, but that's too plain to use for complex missions.

So there's no real "benefit" using createVehicle other that you can create the caches on run time (or even create the objects just when the player is near them, that's a real benefit upon network bandwith if you have a massive amount of objects for example).

Tasks should be managed by the server exclusively - you have less to worry about if you don't need to synchronize every task step with other players if you centralize all of that in the server.

The only thing your clients need to know is the current task and upon completion, needs to send the aknowledgment to the server.

All of this doesn't matter though if it's not a multiplayer mission.

You need to ask yourself the following questions:

  • Do I plan to create a multiplayer mission?
    • If yes, should all of the players...
      • ... individually try to get the caches (this would mean you'll locally create five caches for each player)
      • ... compete in getting the five caches (so you'd just create the five caches and whoever finds them first wins or smth)

    [*]Is this the only task I assign to my players?

The answers to these questions will help you finding the most efficient/safe way to build your mission.

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  

×