OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Resources Beta Testing & Submission => Topic started by: Blanco on 30 Mar 2005, 13:22:56

Title: Trafficscript
Post by: Blanco on 30 Mar 2005, 13:22:56
Basically this script make Ai vehicles move from point A to point B without waypoints. lol
When the vehicle is damaged or not able to move , the vehicle will be setposed at startingposition and the whole thing starts over again. I tried to make a repairscript where the driver gets out and start to repair his vehicle, but the AI is not very willing to do this correctly.

When it reaches it's destination, the car turn 180 degrees but the script will wait until the car is out of sight of the player. (well euh...kind of... 350m)

Parameters

[this,Id for the startingposition, ID for the destination, create random cars or not?] exec "traffic.sqs"
example
[this, 12563,12784, true] exec "traffic.sqs"

This will make the vehicle move from object 12563 to object 12784 and back and when it reaches its destination, a random car will be created (out of sight of the player) and moves on.
In the demo I've used ID's from roads:)

This script was hard to test because you can't just stand there and watch the whole thing. So I've wrote a testscript that uses switchcamera and it's bigger then the trafficscript itself.  :P
Via switchcamera you can observe every car while you are miles away from it. You can't control the vehicle, but you can click the actions to cycle through the cars and to stop the most boring testdemo ever made in OFP history. :)
Open traffic.sqs for more info.






Title: Re:Trafficscript
Post by: Morglor9 on 31 Mar 2005, 07:15:08
sounds neat. can't wait to be on my other computer to try it. this should make it easier to create a town/city with traffic. does it work on people?
Title: Re:Trafficscript
Post by: Blanco on 31 Mar 2005, 08:14:31
No only with vehicles, but it can be done.