#1 03-06-2008 06:56

GC0mmander
Registered: 03-06-2008
Posts: 12

помощь

есть код скрипта. в самом начале появляется маркер мисии. но при становлении на маркер миссия не запускается, и создается дубль актера .  помогите плиз.

DEFINE OBJECTS 0
DEFINE MISSIONS 0
DEFINE EXTERNAL_SCRIPTS -1 // Use -1 to not write AAA script
DEFINE UNKNOWN_EMPTY_SEGMENT 0
DEFINE UNKNOWN_THREADS_MEMORY 0

thread 'MAIN'
 var
  $PLAYER_CHAR : Player
 end
01F0: set_max_wanted_level_to 6 
set_wb_check_to 0 
00C0: set_current_time 8 0 
04E4: unknown_refresh_game_renderer_at 2488.5601 -1666.84 
Camera.SetAtPos(2488.5601, -1666.84, 13.38)
$PLAYER_CHAR = Player.Create(#NULL, 2488.5601, -1666.84, 13.38)
Player.Money($10) += 333
$PLAYER_ACTOR = Actor.EmulateFromPlayer($PLAYER_CHAR)
Camera.SetBehindPlayer
set_weather 0          
wait 0                                   
$PLAYER_CHAR.SetClothes("PLAYER_FACE", "HEAD",  Head)
$PLAYER_CHAR.SetClothes("JEANSDENIM", "JEANS", Legs)
$PLAYER_CHAR.SetClothes("SNEAKERBINCBLK", "SNEAKER", Shoes)
$PLAYER_CHAR.SetClothes("VEST", "VEST", Torso)
$PLAYER_CHAR.Build
$PLAYER_CHAR.CanMove = True
fade 1 (out) 0 ms                     
select_interior 0
016C: restart_if_wasted at 2027.77 -1420.52 15.99 angle 137.0 unknown 0 
016D: restart_if_busted at 1550.68 -1675.49 14.51 angle 90.0 unknown 0
create_thread @StartMissii1
end_thread


:StartMissii1
    wait 100 
    Marker.CreateIconAndSphere(1@,36, 2490.7676, -1669.8162, 13.3359)

   :StartMissii1_2
0001: wait 250 ms
    00D6: if 0
    0256: player $PLAYER_CHAR defined
    004D: jump_if_false @StartMissii1
    00D6: if 0
    00FF: actor $PLAYER_ACTOR 0 ()near point on foot 2490.7676 -1669.8162 13.3359 radius 1.0 1.0 2.0
    004D: jump_if_false @StartMissii1
    00D6: if 0
    0038: $ON_MISSION == 0 ;; integer values
    004D: jump_if_false @StartMissii1
    0164: disable_marker $marker_miss
    03BD: destroy sphere $sphere_miss
    0417: start_mission 135
    004E: end_thread 
    
    :MIS1
    gosub @KOD_MISSII 
    if 
    wasted_or_busted
    Jf @PROPUSK_KODA 
    gosub @KOD_PROVALA 

   :PROPUSK_KODA 
    gosub @UDALENIE_KODA
    end_thread

   :KOD_MISSII 
    increment_mission_attempts
    $ONMISSION = 1
    0110: clear_player $PLAYER_CHAR wanted_level
    
    :LabelMis1_1
    wait 0
    fade 0 500
    model.Load(#BALLAS1)
    model.Load(#BALLAS2)
    model.Load(#BALLAS3)
    model.Load(#M4)
    038B: load_requested_models 
    
    :LabelMis1_2
    wait 0
    if and
    model.Available(#BALLAS1)
    model.Available(#BALLAS2)
    model.Available(#BALLAS3)
    model.Available(#M4)
    Jf @LabelMis1_2
    fade 1 500
    actor.Create(1@,4,#BALLAS1,2517.8367, -1664.6057, 14.0369)
    actor.Create(2@,4,#BALLAS2,2517.1902, -1667.9568, 14.028)
    actor.Create(3@,4,#BALLAS3,2516.353, -1671.1974, 13.8478)
    01B2: give_actor 1@ weapon 31 ammo 999999
    01B2: give_actor 2@ weapon 31 ammo 999999 
    01B2: give_actor 3@ weapon 31 ammo 999999
    wait 500
    05E2: AS_actor 1@ kill_actor $PLAYER_ACTOR 
    05E2: AS_actor 2@ kill_actor $PLAYER_ACTOR
    05E2: AS_actor 3@ kill_actor $PLAYER_ACTOR
    
    :LabelMis1_3
    wait 0
    if 
    wasted_or_busted
    jf @LabelMis1_4
    jump @KOD_PROVALA  
    
    :LabelMis1_4
    wait 0
    if and
    actor.Dead(1@)
    actor.Dead(2@)
    actor.Dead(3@)
    jf @LabelMis1_3
    
   :UDACHNO  // ------- Сюда надо делать переход(Jump) , если миссия удалась --------
    wait 0 
    01E3: text_1number_styled 'M_PASS' 25000 5000 ms 4  
    Player.Money($PLAYER_CHAR) += 25000
    0110: clear_player $PLAYER_CHAR wanted_level
    0394: play_music 1                                        
    gosub @PROPUSK_KODA
    return

   :KOD_PROVALA  // ------- Сюда надо делать переход(Jump) , если миссия провалена --------
    00BA: text_styled 'M_FAIL' 5000 ms 1
    $ONMISSION = 0   
    mission_cleanup
    model.destroy(#BALLAS1)
    model.destroy(#BALLAS2)
    model.destroy(#BALLAS3)
    model.destroy(#M4)
    create_thread @StartMissii1
    return

   :UDALENIE_KODA 
    $ONMISSION = 0
    mission_cleanup
    return

Offline

#2 03-06-2008 07:05

Alexander
Registered: 19-08-2006
Posts: 184
Website

Re: помощь

grin
видно что из мануала , но там ведь всё описано ...

у тебя написно mission 135 , откуда эта миссия может взяться , если она даже не прописана ? grin
в сегменте DEFINE MISSIONS напиши define mission 0 at @метка_миссии

start_mission 135 на start_mission 0

Offline

#3 03-06-2008 07:16

GC0mmander
Registered: 03-06-2008
Posts: 12

Re: помощь

вот новый код, все равно не работет sad((((

DEFINE OBJECTS 0
DEFINE MISSIONS 0 at @StartMissii1
DEFINE EXTERNAL_SCRIPTS -1 // Use -1 to not write AAA script
DEFINE UNKNOWN_EMPTY_SEGMENT 0
DEFINE UNKNOWN_THREADS_MEMORY 0

thread 'MAIN'
 var
  $PLAYER_CHAR : Player
 end
01F0: set_max_wanted_level_to 6 
set_wb_check_to 0 
00C0: set_current_time 8 0 
04E4: unknown_refresh_game_renderer_at 2488.5601 -1666.84 
Camera.SetAtPos(2488.5601, -1666.84, 13.38)
$PLAYER_CHAR = Player.Create(#NULL, 2488.5601, -1666.84, 13.38)
Player.Money($10) += 333
$PLAYER_ACTOR = Actor.EmulateFromPlayer($PLAYER_CHAR)
Camera.SetBehindPlayer
set_weather 0          
wait 0                                   
$PLAYER_CHAR.SetClothes("PLAYER_FACE", "HEAD",  Head)
$PLAYER_CHAR.SetClothes("JEANSDENIM", "JEANS", Legs)
$PLAYER_CHAR.SetClothes("SNEAKERBINCBLK", "SNEAKER", Shoes)
$PLAYER_CHAR.SetClothes("VEST", "VEST", Torso)
$PLAYER_CHAR.Build
$PLAYER_CHAR.CanMove = True
fade 1 (out) 0 ms                     
select_interior 0
016C: restart_if_wasted at 2027.77 -1420.52 15.99 angle 137.0 unknown 0 
016D: restart_if_busted at 1550.68 -1675.49 14.51 angle 90.0 unknown 0
create_thread @StartMissii1
end_thread


:StartMissii1
    wait 100 
    Marker.CreateIconAndSphere(1@,36, 2490.7676, -1669.8162, 13.3359)
    gosub @StartMissii1_2
    end_thread

   :StartMissii1_2
0001: wait 250 ms
    00D6: if 0
    0256: player $PLAYER_CHAR defined
    004D: jump_if_false @StartMissii1
    00D6: if 0
    00FF: actor $PLAYER_ACTOR 0 ()near point on foot 2490.7676 -1669.8162 13.3359 radius 1.0 1.0 2.0
    004D: jump_if_false @StartMissii1
    00D6: if 0
    0038: $ON_MISSION == 0 ;; integer values
    004D: jump_if_false @StartMissii1
    0164: disable_marker $marker_miss
    03BD: destroy sphere $sphere_miss
    0417: start_mission 0
    004E: end_thread 
    
    :MIS1
    gosub @KOD_MISSII 
    if 
    wasted_or_busted
    Jf @PROPUSK_KODA 
    gosub @KOD_PROVALA 

   :PROPUSK_KODA 
    gosub @UDALENIE_KODA
    end_thread

   :KOD_MISSII 
    increment_mission_attempts
    $ONMISSION = 1
    0110: clear_player $PLAYER_CHAR wanted_level
    
    :LabelMis1_1
    wait 0
    fade 0 500
    model.Load(#BALLAS1)
    model.Load(#BALLAS2)
    model.Load(#BALLAS3)
    model.Load(#M4)
    038B: load_requested_models 
    
    :LabelMis1_2
    wait 0
    if and
    model.Available(#BALLAS1)
    model.Available(#BALLAS2)
    model.Available(#BALLAS3)
    model.Available(#M4)
    Jf @LabelMis1_2
    fade 1 500
    actor.Create(1@,4,#BALLAS1,2517.8367, -1664.6057, 14.0369)
    actor.Create(2@,4,#BALLAS2,2517.1902, -1667.9568, 14.028)
    actor.Create(3@,4,#BALLAS3,2516.353, -1671.1974, 13.8478)
    01B2: give_actor 1@ weapon 31 ammo 999999
    01B2: give_actor 2@ weapon 31 ammo 999999 
    01B2: give_actor 3@ weapon 31 ammo 999999
    wait 500
    05E2: AS_actor 1@ kill_actor $PLAYER_ACTOR 
    05E2: AS_actor 2@ kill_actor $PLAYER_ACTOR
    05E2: AS_actor 3@ kill_actor $PLAYER_ACTOR
    
    :LabelMis1_3
    wait 0
    if 
    wasted_or_busted
    jf @LabelMis1_4
    jump @KOD_PROVALA  
    
    :LabelMis1_4
    wait 0
    if and
    actor.Dead(1@)
    actor.Dead(2@)
    actor.Dead(3@)
    jf @LabelMis1_3
    
   :UDACHNO  // ------- Сюда надо делать переход(Jump) , если миссия удалась --------
    wait 0 
    01E3: text_1number_styled 'M_PASS' 25000 5000 ms 4  
    Player.Money($PLAYER_CHAR) += 25000
    0110: clear_player $PLAYER_CHAR wanted_level
    0394: play_music 1                                        
    gosub @PROPUSK_KODA
    return

   :KOD_PROVALA  // ------- Сюда надо делать переход(Jump) , если миссия провалена --------
    00BA: text_styled 'M_FAIL' 5000 ms 1
    $ONMISSION = 0   
    mission_cleanup
    model.destroy(#BALLAS1)
    model.destroy(#BALLAS2)
    model.destroy(#BALLAS3)
    model.destroy(#M4)
    create_thread @StartMissii1
    return

   :UDALENIE_KODA 
    $ONMISSION = 0
    mission_cleanup
    return

Offline

#4 03-06-2008 09:11

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

Re: помощь

Читаем в хелпе (кнопка F12 в SB), как правильно прописывать миссии:
- Создание миссии (роман в 4 частях, искать в Статьях)
- Структура файла (в разделе Документации).


Player.Money($10) += 333

вот эта строка была взята из файла alloc.txt. В данном случае она лишняя и даже вредная.

В триггере миссии (прочитаешь статьи, поймешь что это) переменная $ONMISSION неправильно названа ($ON_MISSION).

Автору мануала незачет.

Offline

#5 03-06-2008 09:36

GC0mmander
Registered: 03-06-2008
Posts: 12

Re: помощь

спасибо за помощь и указание на статьи.

Offline

Board footer

Powered by FluxBB