Home   Help Search Login Register  

Author Topic: crate loading/unloading scripts  (Read 1413 times)

0 Members and 1 Guest are viewing this topic.

Offline ROBINO

  • Members
  • *
crate loading/unloading scripts
« on: 10 Jan 2010, 16:39:55 »
script - crate loading/unloading
I've spent some time to develop a script which should hopefully work in MP. It allows crates to be 'loaded' and 'unloaded' from vehicles. Here is the functionality it should provide:

1) The actions 'Load Crate' and 'Unload Crate' are added to the vehicles action lists (eg such as 'get in driver', 'eject' and so on..)

2) A maximum of 1 crate can be loaded onto any vehicle as long as it is within 10m

3) You must get out of the vehicle to unload the crate

4) Can be easily adapted to allow for loading of any objects onto any other objects.

Functionality it does not provide:

1) You cannot see the crates inside the vehicle.

2) No more that 1 crate at a time.

How does it work?

Activating 'Load Crate' executes a script which checks if any of the crates defined in init.sqs are within the vehicle's 10m range. If so, then the crate is setpos to position [0,0,0] (the map origin) - so it disappears. When you want to unload, then the action executes a script which places the same crate just outside the vehicle.

What uses does it have?

If it works in MP - then we could be talking about re-supply in mid mission either by truck/car or helicopter. The script could also be used to place static defenses (to an extent). Also, missions where the objective is to take objects 1,2 and 3 to locaion B from location A - so maybe some escort missions.

How easy is it to use?

About as east as it gets:

1) copy folder "crate" to your user mission
2) copy init.sqs to your mission
3) open init.sqs and add the names of the crates in your mission to the argument [] exec "crates\crates.sqs" < this will initialise all the crates
4) in init.sqs add the names of the vehicles you want to be able to load/unload to the argument [] exec "crates\vehicles.sqs" < this will initialise all the vehicles
5) add a gamelogic call 'server' to your mission

That's it!

However, just because it works on my machine - don't mean anything.

Coulnd you guys give me your comment? It han't been tried in MP yet and this is really what it was designed for.

Thank in advance