#1 09-01-2011 05:32

VcSaJen
Registered: 25-08-2006
Posts: 217

Другие машины тоже перекрашиваются + Люди тоже заходят в здания

Два скрипта, повышающих реалистичность.
Вы заметили, что перекрашивается в pay'n'spray только CJ? Что заходит внутрь здания с дверью может тоже только CJ?
Эти два примера скриптов исправляют эти неточности. Теперь на перекраску pay'n'spray в SF в Doherty возле гаража регулярно ездят разные машины, а в C'Bell (2423.5 -1509.28 24.0411) заходят люди (но никто не выходит, но это тоже можно сделать):

{$CLEO}
//{$I Interceptor.txt}
var
  21@: Actor
  9@: Object
  $Player_Actor: Actor
  22@: Float
  23@: Float
  24@: Float
end
wait 2000
:begin
03DE: set_pedestrians_density_multiplier_to 99.0 
0@ = 2419.3
1@ = -1510.48
2@ = 22.9922
3@ = 0.3
gosub @AIC_GETOBJECT

while true
  if 00A4: actor $Player_Actor sphere 0 in_cube 2413.68 -1507.48 22.96  2419.43 -1510.768 25.46
  then
    $Player_Actor.StorePos(22@, 23@, 24@)
    25@ = $Player_Actor.Angle
    22@ -= 2419.43
    23@ -= -1510.768
    24@ -= 25.46
    
    22@ += 366.775
    23@ += -14.36
    24@ += 1000.81
    
    0860: link_actor $PLAYER_ACTOR to_interior 9
    select_interior 9
    $Player_Actor.LockInCurrentPosition = true
    09BC: put_actor $PLAYER_ACTOR at 22@ 23@ 24@
    wait 2000
    $Player_Actor.LockInCurrentPosition = false
  end
  073F: get_actor_in_sphere 2423.5 -1509.28 24.0411 radius 1.8 with_pedtype_civilian 1 gang 1 criminal/prostitute 1 handle_as 21@ 
  if //and 
    056D: actor 21@ defined 
//    9@>0
//    00FE:   actor $Player_Actor sphere 0 in_sphere 2423.5 -1509.28 24.0411 radius 20.0 20.0 10.0
  then
    if 03ca:   object 9@ exists
    jf @begin
    0687: clear_actor 21@ task 
    07FB: set_interior 'FDCHICK' access 0
    05D6: clear_scmpath
    05D7: add_point_to_scmpath 2419.87 -1509.5475 24.0411
    05D7: add_point_to_scmpath 2415.27 -1509.5475 24.0411
    05D8: AS_assign_scmpath to_actor 21@ flags 6 0 
    0905: set_door 9@ openable 0 
    wait 6000
    21@.DestroyWithFade
    07FB: set_interior 'FDCHICK' access 1  
  end
  wait 0
end














































:AIC_GETOBJECT
0006: 16@ = 305871
0006: 17@ = @AIC_TESTOBJECTHANDLE
0006: 20@ = 412

:AIC_STARTSEARCH 
0085: 4@ = 16@ // (int)
008B: 4@ = &0(4@,1i) // (int) 
0085: 19@ = 4@ // (int)
000E: 19@ -= 10787160
0016: 19@ /= 4 
008B: 19@ = &0(19@,1i) // (int)
000E: 4@ -= 10787168 
0016: 4@ /= 4 
008B: 4@ = &0(4@,1i) // (int)
0006: 9@ = -1 
0085: 11@ = 4@ // (int) 
0006: 10@ = 0

:AIC_SEARCHLOOPMAIN
000A: 4@ += 20 
0050: gosub @AIC_READ4B 
0085: 4@ = 5@ // (int) 
8039:   not  4@ == 0 
004D: jump_if_false @AIC_SEARCHLOOPNEXT 
000A: 4@ += 48 
0050: gosub @AIC_READ4B 
0085: 12@ = 5@ // (int) 
000A: 4@ += 4 
0050: gosub @AIC_READ4B 
0085: 13@ = 5@ // (int) 
000A: 4@ += 4 
0050: gosub @AIC_READ4B 
0085: 14@ = 5@ // (int) 
050A: 15@ = distance_between_XYZ 0@ 1@ 2@ and_XYZ 12@ 13@ 14@ 
0025:   3@ > 15@ // (float) 
004D: jump_if_false @AIC_SEARCHLOOPNEXT 
0085: 9@ = 10@ // (int) 
0085: 4@ = 16@ // (int) 
008B: 4@ = &0(4@,1i) // (int) 
000A: 4@ += 4 
0050: gosub @AIC_READ4B 
0085: 4@ = 5@ // (int) 
005A: 4@ += 9@ // (int) 
0050: gosub @AIC_READ1B 
0012: 9@ *= 256 
005A: 9@ += 5@ // (int)
0002: jump 17@


:AIC_TESTOBJECTHANDLE
//0001: wait 0
83CA:   not object 9@ exists 
004D: jump_if_false @AIC_NEWSEARCHRADIUS

:AIC_NOHANDLE
0006: 9@ = -1 
0002: jump @AIC_SEARCHLOOPNEXT 

:AIC_NEWSEARCHRADIUS
{  
   use 0051: return to break the loop
   immediately when found at least one actor/car/object, 
   does not matter if he's nearest one. 
}

// v EXTRA SEARCH CRITERIA GOES HERE v

{
  21@ contains the handle of an actor/car/object 
  that should be excluded from the search result 
  (for example a handle found previously). 
}
//803B:   21@ <> 9@
//004D: jump_if_false @AIC_NOHANDLE 

    
0085: 3@ = 15@ 

:AIC_SEARCHLOOPNEXT 
005A: 11@ += 20@ // (int) 
0085: 4@ = 11@ // (int) 
000A: 10@ += 1 
002D:   10@ >= 19@ // (int)
004D: jump_if_false @AIC_SEARCHLOOPMAIN
0051: return 

// ---------------------------------
:AIC_READ1B
0085: 6@ = 4@ // (int) 
0085: 8@ = 4@ // (int) 
0016: 4@ /= 4 
0012: 4@ *= 4 
0062: 8@ -= 4@ // (int) 
0012: 8@ *= 8 
000E: 4@ -= 10787168 
0016: 4@ /= 4 
008B: 7@ = &0(4@,1i) // (int) 
0085: 4@ = 6@ // (int) 
0006: 5@ = 0 
0006: 6@ = 0 

:AIC_READ1B_LOOP
08B9:   test 7@ bit 8@ 
004D: jump_if_false @AIC_READ1B_NEXTBIT 
08BF: set 5@ bit 6@ 

:AIC_READ1B_NEXTBIT
000A: 6@ += 1 
000A: 8@ += 1 
0039:   6@ == 8 
004D: jump_if_false @AIC_READ1B_LOOP 
0051: return 

:AIC_READ4B
0085: 6@ = 4@ // (int) 
000E: 4@ -= 10787168 
0016: 4@ /= 4 
008B: 5@ = &0(4@,1i) // (int) 
0085: 4@ = 6@ // (int) 
0051: return
{$CLEO}
thread 'allspray'
var
  0@: Car
  1@: Actor  
end

while true
  if and 
    $ONMISSION == 0
    09E7:   player $PLAYER_CHAR not_frozen 
  then
    073E: get_car_in_sphere -2003.8384 227.2971 27.6286 radius 5.0 model -1 handle_as 0@
    if 056E: car 0@ defined
    then
      046C: 1@ = car 0@ driver
      if and 
        8969: not car 0@ is_noncivilian_vehicle
//        82CA: not car 0@ bounding_sphere_visible
        056D:   actor 1@ defined 
      then
        //if 88A7:   not car 0@ componentA 0 opened_or_not_present 
        //then
        //  0730: car 0@ damage_component 0 // versionA
        //end
        //if 88A7:   not car 0@ componentA 1 opened_or_not_present 
        //then        
        //  0730: car 0@ damage_component 1 // versionA
        //end
        //if 88A7:   not car 0@ componentA 2 opened_or_not_present 
        //then
        //  0730: car 0@ damage_component 2 // versionA
        //end
        //if 88A7:   not car 0@ componentA 3 opened_or_not_present 
        //then
        //  0730: car 0@ damage_component 3 // versionA
        //end
        //if 88A7:   not car 0@ componentA 4 opened_or_not_present 
        //then
        //  0730: car 0@ damage_component 4 // versionA
        //end
        //if 88A7:   not car 0@ componentA 5 opened_or_not_present 
        //then
        //  0730: car 0@ damage_component 5 // versionA
        //end
        0@.Health = 300
        0@.SetDriverBehaviour(Nowhere)
        05EC: release_car 0@ from_path
        0763: add_car_reference 0@
        04E0: car 0@ abandon_path_radius 255
        05D6: clear_scmpath        
        05D7: add_point_to_scmpath -2003.8384 227.2971 27.6286
        05D7: add_point_to_scmpath -1976.7947 225.4384 30.0353  
        05D7: add_point_to_scmpath -1909.8403 227.9722 34.8952 
        05D7: add_point_to_scmpath -1905.1957 274.6925 40.5465
        05D7: add_point_to_scmpath -1904.9829 283.7856 40.5509        
        07E7: AS_assign_scmpath_to_actor 1@ in_car 0@ speed 15.0 flags 1 0 1
//        0@.DriveTo(-1904.9829 283.7856 40.5509)
        while true 
          if {or}
            856E: not car 0@ defined
//            0@.Wrecked
          then
            jump @clr
          end
          if 01AF: car 0@ sphere 0 in_sphere -1904.9829 283.7856 40.5509 radius 3.0 3.0 3.0
          then
            Break
          end
          wait 0
        end
        Garage.Close('SPRSFSE')
        0@.LockInCurrentPosition = True
        wait 3000
        if {or}
          856E: not car 0@ defined
//          0@.Wrecked
        then
          jump @clr
        end
        0A30: repair_car 0@ 
        Garage.Open('SPRSFSE')
        
        wait 850
        if or
          856E: not car 0@ defined
//          0@.Wrecked
          856D: not actor 1@ defined
        then
          jump @clr
        end
        0@.Angle = 0.0
        0@.LockInCurrentPosition = False        
        //0@.SetSpeedInstantly(-20.0)
        0477: set_car 0@ animation 3 time 2000
        wait 2000
        
        if or
          856E: not car 0@ defined
//          0@.Wrecked
          856D: not actor 1@ defined
        then
          jump @clr
        end
                
        05D6: clear_scmpath
//        05D7: add_point_to_scmpath -1904.9829 283.7856 40.5509
//        05D7: add_point_to_scmpath -1905.1957 274.6925 40.5465
//        05D7: add_point_to_scmpath -1908.2749 262.5012 40.3984
        05D7: add_point_to_scmpath -1910.8593 239.3272 34.8993
        05D7: add_point_to_scmpath -1915.2561 231.8239 34.6498
        05D7: add_point_to_scmpath -1975.5681 230.8239 29.9494
        05D7: add_point_to_scmpath -2003.8384 227.2971 27.6286
        07E7: AS_assign_scmpath_to_actor 1@ in_car 0@ speed 5.0 flags 1 0 1
 
        while true        
          if {or}
            856E: not car 0@ defined
//            0@.Wrecked          
          then
            jump @clr
          end
          if 01AF: car 0@ sphere 0 in_sphere -2003.8384 227.2971 27.6286 radius 5.0 5.0 5.0
          then
            Break
          end
          wait 0
        end
        0@.SetDriverBehaviour(FollowRoad)
        :clr
        0@.RemoveReferences
        1@.RemoveReferences
        wait 10000                         
      end 
    end      
  end
  wait 0
end

[small][/small]

Offline

#2 09-01-2011 07:24

Seemann
Registered: 07-08-2006
Posts: 2,155

Re: Другие машины тоже перекрашиваются + Люди тоже заходят в здания

Оригинальная идея, класс good

Offline

Board footer

Powered by FluxBB