Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
safari

Long duration traffic?

Recommended Posts

Is it possible to make a scenario where heavy traffic is moving between two cities for hours to come? I mean when there are 20-30 vehicles on the road, collisions will occur and AI repair trucks (in support waypoint) don't seem to support too much sometimes. So eventually it's always the same. You fond walking drivers where there should be heavy traffic. Can AI repair trucks even repair damaged trucks and jeeps on their own anyway.

I could always learn how to make script that spawns new vehicles who inherit their predecessors waypoints?

Share this post


Link to post
Share on other sites

if a vehicly is damaged you could do something like this (make that driver and the car seperate):

condtion: (damage car1) > 0.3

activation: reptruck1 domove car1

condition: (reptruck1 distance car1) < 10

activation: car1 setdamage 0; ; car1driver moveindriver car1

altough im not sure if it works cuz i havent played for a while and its a lot of work for 30 cars tounge_o.gif

Share this post


Link to post
Share on other sites

Try somethng like

in each cars init, put

[this,repairtruck] exec "repair.sqs"

In init.sqs put

repairaval = true

Now repair.sqs should be

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_car = _this select 0

_repair = _this select 1

_driver = driver _car

~1

_repair setbehaviour "safe"

#monitor

~2 + random 2

?(getdammage _car > 0.3) && (alive _car) && repairaval : goto "repair"

goto "monitor"

#repair

dostop _car

repairaval = false; publicvariable "repairaval"

_repair move [(getpos _car select 0) + 2, (getpos _car select 1) + 2, 0]

#repairloop

~1

?(_car distance _repair <= 12) || !(alive _car): goto "fix"

goto "repairloop"

#fix

?!(alive _car) : goto "home"

_car setdammage 0

?(Alive _driver) : _driver moveindriver _car

#home

repairaval = true; publicvariable "repairaval"

_repair move getpos repairstation

?!(alive _car) : exit

goto "monitor"

Tested, looks good.

You can edit it as you wish.

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  

×