Results 1 to 3 of 3

Thread: Long duration traffic?

  1. #1
    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?
    OFP junkie

  2. #2
    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

  3. #3
    Sergeant Major
    Join Date
    Dec 24 2002
    Location
    BC, Canada
    Posts
    1,428
    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 &#34;safe&#34;
    #monitor
    ~2 + random 2
    ?&#40;getdammage _car &#62; 0.3&#41; && &#40;alive _car&#41; && repairaval &#58; goto &#34;repair&#34;
    goto &#34;monitor&#34;

    #repair
    dostop _car
    repairaval = false; publicvariable &#34;repairaval&#34;

    _repair move &#91;&#40;getpos _car select 0&#41; + 2, &#40;getpos _car select 1&#41; + 2, 0&#93;
    #repairloop
    ~1
    ?&#40;_car distance _repair &#60;= 12&#41; &#124;&#124; &#33;&#40;alive _car&#41;&#58; goto &#34;fix&#34;
    goto &#34;repairloop&#34;

    #fix
    ?&#33;&#40;alive _car&#41; &#58; goto &#34;home&#34;
    _car setdammage 0
    ?&#40;Alive _driver&#41; &#58; _driver moveindriver _car

    #home
    repairaval = true; publicvariable &#34;repairaval&#34;
    _repair move getpos repairstation
    ?&#33;&#40;alive _car&#41; &#58; exit
    goto &#34;monitor&#34;[/QUOTE]

    Tested, looks good.

    You can edit it as you wish.




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •