Czy wiesz, że... rejestracja trwa tylko 20 sekund?
Strona główna forum Szukaj Rejestracja
Witaj, nieznajomy!
Poprzedni 1 2 Następny
Postów: 109 Dołączył: 2009-04-25
#
Witam. Wzorując się na skrypcie z tego tematu: http://www.gta-mods.pl/forum/topics/view/id/684 z drugiego posta, napisałem swój. Skomplikowałem. Wchodzę w grę, gra się załaduje, idę tam gdzie stoi marker, wchodzę w niego i... crash. I nie wiem co źle zrobiłem (analizowałem wzorca 2 razy) i nic nie znalazłem... Oto cały kod.

Cytat:
{$VERSION 3.1.0027}
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP

:NONAME_2
wait 0
if
Player.Defined($PLAYER_ACTOR)
else_jump @NONAME_2
Model.Load(#HMYST)
Model.Load(#ELEGY)
Model.Load(#BMORI)
Model.Load(#NRG500)
7@ = Marker.CreateIconAndSphere(23, 2378.961, -1729.756, 13.3828)

:NONAME_62
wait 10
if
00ED: actor $PLAYER_ACTOR 0 near_point 2378.961 -1729.756 radius 13.3828 1.0 on_foot
else_jump @NONAME_62
fade 0 1500
wait 1500
Marker.Disable(7@)
$1 = Car.Create(#ELEGY, 2378.961, -1729.756, 13.3828)
$PLAYER_CHAR = Car.Create(#NRG500, 2400.817, -1729.675, 13.3828)
3@ = Actor.Create(Mission2, #HMYST, 2416.829, -1666.706, 13.5355)
4@ = Actor.Create(Mission2, #BMORI, 2416.829, -1666.706, 13.5355)
5@ = Actor.Create(Mission2, #BMORI, 2416.829, -1666.706, 13.5355)
072A: put_actor $PLAYER_ACTOR into_car 1@ driverseat
0430: put_actor 3@ into_car 1@ passenger_seat 0
0430: put_actor 4@ into_car 2@ passenger_seat 0
072A: put_actor 5@ into_car 2@ driverseat
01B2: give_actor 3@ weapon 28 ammo 9999 // Load the weapon model before using this
01B2: give_actor 4@ weapon 28 ammo 9999 // Load the weapon model before using this

:NONAME_295
wait 10
if
Actor.InCar($PLAYER_ACTOR, 1@)
else_jump @NONAME_295
0713: actor 3@ driveby_actor -1 car 2@ point 0.0 0.0 0.0 radius -1 8 1 firing_rate 100
0713: actor 4@ driveby_actor -1 car 1@ point 0.0 0.0 0.0 radius -1 8 1 firing_rate 100
Car.DriveTo(1@, 2060.385, -1916.034, 13.5469)
Car.SetMaxSpeed(1@, 30.0)
00AE: set_car 1@ traffic_behaviour_to 3
07F8: car 2@ follow_car 1@ radius 7.5
Car.SetMaxSpeed(2@, 50.0)
02A3: enable_widescreen 1
wait 1500
fade 1 1500

:NONAME_460
wait 10
if
00EE: actor $PLAYER_ACTOR 0 near_point 2067.859 -1913.868 radius 4.0 4.0 in_car
else_jump @NONAME_460
fade 0 1500
wait 1500
02A3: enable_widescreen 0
Camera.Restore_WithJumpCut
wait 1500
fade 1 1500
0A93: end_custom_thread


Proszę o pomoc
Postów: 248 Dołączył: 2009-06-27
#
Kod:
Player.Defined($PLAYER_ACTOR)

Zamień $PLAYER_ACTOR na $PLAYER_CHAR. Dziwne, że Twój skrypt przez to przeszedł.

Kod:
$1 = Car.Create(#ELEGY, 2378.961, -1729.756, 13.3828)
$PLAYER_CHAR = Car.Create(#NRG500, 2400.817, -1729.675, 13.3828)
3@ = Actor.Create(Mission2, #HMYST, 2416.829, -1666.706, 13.5355)
4@ = Actor.Create(Mission2, #BMORI, 2416.829, -1666.706, 13.5355)
5@ = Actor.Create(Mission2, #BMORI, 2416.829, -1666.706, 13.5355)
072A: put_actor $PLAYER_ACTOR into_car 1@ driverseat 

Twój ELEGY jest przypisany do zmiennej $1
Umieszczasz aktora w pojeździe o zmiennej 1@
Pojazd 1@ nie istnieje.

Zamień:
Kod:
$1 = Car.Create(#ELEGY, 2378.961, -1729.756, 13.3828)

na
Kod:
1@ = Car.Create(#ELEGY, 2378.961, -1729.756, 13.3828)


Kod:
01B2: give_actor 3@ weapon 28 ammo 9999 // Load the weapon model before using this 

Nie załadowałeś modelu broni 28.
Dopisz:
Kod:
Model.Load(#MICRO_UZI)


Nie załadowałeś modeli.
Znajdź w wyszukiwarce opcodów:
load_requested_models
i wklej ten opcode pod ostatnim "Model.Load(...)"

Kod:
00AE: set_car 1@ traffic_behaviour_to 3 

Tutaj wartość 3 oznacza, że pojazd jedzie na czerwonym i "nie widzi" ruchu ulicznego. Radzę Ci zmienić to na 2. Ale to nie powoduje crashu.

P.S: Osobiście uważam, że SB jest zbyt uproszczony. Wydaje się, że można łatwo wszystko napisać. Przez te uproszczenia często pojawia się jakiś crash. Nie mam zamiaru tu reklamować ciekawszych gier i edytorów, ktoś jest zainteresowany, niech pisze na PW.

___________________
http://www.gta-mods.pl/public/images/userbar
Postów: 109 Dołączył: 2009-04-25
#
Poprawiłem, ale crash nadal jest, ale teraz jeszcze szybciej, od razu po odpaleniu gry.
Kod:
// This file was decompiled using sascm.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007

{$VERSION 3.1.0027}
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP 

:NONAME_2
wait 0 
if 
   Player.Defined($PLAYER_CHAR)
else_jump @NONAME_2 
Model.Load(#HMYST)
Model.Load(#ELEGY)
Model.Load(#BMORI)
Model.Load(#NRG500)
Model.Load(#MICRO_UZI)
038B: load_requested_models 
7@ = Marker.CreateIconAndSphere(23, 2378.961, -1729.756, 13.3828)

:NONAME_62
wait 10 
if 
00ED:   actor $PLAYER_CHAR 0 near_point 2378.961 -1729.756 radius 13.3828 1.0 on_foot 
else_jump @NONAME_62 
fade 0 1500 
wait 1500 
Marker.Disable(7@)
1@ = Car.Create(#ELEGY, 2378.961, -1729.756, 13.3828)
2@ = Car.Create(#NRG500, 2400.817, -1729.675, 13.3828)
3@ = Actor.Create(Mission2, #HMYST, 2416.829, -1666.706, 13.5355)
4@ = Actor.Create(Mission2, #BMORI, 2416.829, -1666.706, 13.5355)
5@ = Actor.Create(Mission2, #BMORI, 2416.829, -1666.706, 13.5355)
072A: put_actor $PLAYER_CHAR into_car 1@ driverseat 
0430: put_actor 3@ into_car 1@ passenger_seat 0 
0430: put_actor 4@ into_car 2@ passenger_seat 0 
072A: put_actor 5@ into_car 2@ driverseat 
01B2: give_actor 3@ weapon 28 ammo 9999 // Load the weapon model before using this 
01B2: give_actor 4@ weapon 28 ammo 9999 // Load the weapon model before using this 

:NONAME_295
wait 10 
if 
   Actor.InCar($PLAYER_CHAR, 1@)
else_jump @NONAME_295 
0713: actor 3@ driveby_actor -1 car 2@ point 0.0 0.0 0.0 radius -1 8 1 firing_rate 100 
0713: actor 4@ driveby_actor -1 car 1@ point 0.0 0.0 0.0 radius -1 8 1 firing_rate 100 
Car.DriveTo(1@, 2060.385, -1916.034, 13.5469)
Car.SetMaxSpeed(1@, 30.0)
00AE: set_car 1@ traffic_behaviour_to 3 
07F8: car 2@ follow_car 1@ radius 7.5 
Car.SetMaxSpeed(2@, 50.0)
02A3: enable_widescreen 1 
wait 1500 
fade 1 1500 

:NONAME_460
wait 10 
if 
00EE:   actor $PLAYER_CHAR 0 near_point 2067.859 -1913.868 radius 4.0 4.0 in_car 
else_jump @NONAME_460 
fade 0 1500 
wait 1500 
02A3: enable_widescreen 0 
Camera.Restore_WithJumpCut
wait 1500 
fade 1 1500 
0A93: end_custom_thread 
Postów: 248 Dołączył: 2009-06-27
#
Między:
Kod:
Player.Defined($PLAYER_CHAR)
else_jump @NONAME_2

a:
Kod:
:NONAME_62

wpisuj po każdej linijce jump @NONAME_2, jeśli nie ma crashu, wytnij "jumpa" i wklej go linijkę niżej. Daj znać gdzie jest błąd. Możliwe, że to przez wczytywanie modeli, czasem tak mam.

---
Ja tu ciągle dyżuruję, więc szybciej załatwimy ten problem, jeśli nie będziesz opuszczać tej strony.

___________________
http://www.gta-mods.pl/public/images/userbar
Postów: 878 Dołączył: 2009-01-20
#
Kod:
:NONAME_62
wait 10
if
00ED: actor $PLAYER_CHAR 0 near_point 2378.961 -1729.756 radius 13.3828 1.0 on_foot
else_jump @NONAME_62


W tym miejscu jest błąd, zamiast $PLAYER_CHAR wstaw $PLAYER_ACTOR.
Wyjaśnienie:

$PLAYER_CHAR - zmienna "gracza", używa się jej przy funkcjach związanych bezpośrednio z graczem i akcjami z nim powiązanymi, np. sprawdzenie wciśnięcia klawisza.
$PLAYER_ACTOR - zmienna postaci gracza, która funkcjonuje jako zwykły aktor. Na nim wykonuje się wszystkie zachowania postaci w grze itd.

Wcześniej nie było crasha na początku gry, bo skrypt zapętlał się na pierwszej procedurze przez to, że pomyliłeś $PLAYER_ACTOR z $PLAYER_CHAR.


// edit: teraz widzę, że wszędzie wstawiłeś $PLAYER_CHAR, zamiast $PLAYER_ACTOR :) Popraw to w reszcie linijek i powinno śmigać.

___________________
Administrator
Postów: 109 Dołączył: 2009-04-25
#
Cytrus Zrobiłem jak powiedziałeś, lecz crash nadal jest, po załadowaniu gry (gra ładuje się bardzo długo :/)
Kod:
// This file was decompiled using sascm.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007

{$VERSION 3.1.0027}
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP 

:NONAME_2
wait 0 
if 
   Player.Defined($PLAYER_CHAR)
else_jump @NONAME_2 
Model.Load(#HMYST)
jump @NONAME_2
Model.Load(#ELEGY)
jump @NONAME_2
Model.Load(#BMORI)
jump @NONAME_2
Model.Load(#NRG500)
jump @NONAME_2
Model.Load(#MICRO_UZI)
jump @NONAME_2
038B: load_requested_models 
jump @NONAME_2
7@ = Marker.CreateIconAndSphere(23, 2378.961, -1729.756, 13.3828)
jump @NONAME_2

:NONAME_69
wait 10 
if 
00ED:   actor $PLAYER_CHAR 0 near_point 2378.961 -1729.756 radius 13.3828 1.0 on_foot 
else_jump @NONAME_69 
fade 0 1500 
wait 1500 
Marker.Disable(7@)
1@ = Car.Create(#ELEGY, 2378.961, -1729.756, 13.3828)
2@ = Car.Create(#NRG500, 2400.817, -1729.675, 13.3828)
3@ = Actor.Create(Mission2, #HMYST, 2416.829, -1666.706, 13.5355)
4@ = Actor.Create(Mission2, #BMORI, 2416.829, -1666.706, 13.5355)
5@ = Actor.Create(Mission2, #BMORI, 2416.829, -1666.706, 13.5355)
072A: put_actor $PLAYER_CHAR into_car 1@ driverseat 
0430: put_actor 3@ into_car 1@ passenger_seat 0 
0430: put_actor 4@ into_car 2@ passenger_seat 0 
072A: put_actor 5@ into_car 2@ driverseat 
01B2: give_actor 3@ weapon 28 ammo 9999 // Load the weapon model before using this 
01B2: give_actor 4@ weapon 28 ammo 9999 // Load the weapon model before using this 

:NONAME_302
wait 10 
if 
   Actor.InCar($PLAYER_CHAR, 1@)
else_jump @NONAME_302 
0713: actor 3@ driveby_actor -1 car 2@ point 0.0 0.0 0.0 radius -1 8 1 firing_rate 100 
0713: actor 4@ driveby_actor -1 car 1@ point 0.0 0.0 0.0 radius -1 8 1 firing_rate 100 
Car.DriveTo(1@, 2060.385, -1916.034, 13.5469)
Car.SetMaxSpeed(1@, 30.0)
00AE: set_car 1@ traffic_behaviour_to 3 
07F8: car 2@ follow_car 1@ radius 7.5 
Car.SetMaxSpeed(2@, 50.0)
02A3: enable_widescreen 1 
wait 1500 
fade 1 1500 

:NONAME_467
wait 10 
if 
00EE:   actor $PLAYER_CHAR 0 near_point 2067.859 -1913.868 radius 4.0 4.0 in_car 
else_jump @NONAME_467 
fade 0 1500 
wait 1500 
02A3: enable_widescreen 0 
Camera.Restore_WithJumpCut
wait 1500 
fade 1 1500 
0A93: end_custom_thread 


MakG, zamieniłem all na Player_Actor, i nic,, crash ponownie, kod:
Kod:
// This file was decompiled using sascm.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007

{$VERSION 3.1.0027}
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP 

:NONAME_2
wait 0 
if 
   Player.Defined($PLAYER_ACTOR)
else_jump @NONAME_2 
Model.Load(#HMYST)
Model.Load(#ELEGY)
Model.Load(#BMORI)
Model.Load(#NRG500)
Model.Load(#MICRO_UZI)
038B: load_requested_models 
7@ = Marker.CreateIconAndSphere(23, 2378.961, -1729.756, 13.3828)
jf @NONAME_2

:NONAME_69
wait 10 
if 
00ED:   actor $PLAYER_ACTOR 0 near_point 2378.961 -1729.756 radius 13.3828 1.0 on_foot 
else_jump @NONAME_69 
fade 0 1500 
wait 1500 
Marker.Disable(7@)
1@ = Car.Create(#ELEGY, 2378.961, -1729.756, 13.3828)
2@ = Car.Create(#NRG500, 2400.817, -1729.675, 13.3828)
3@ = Actor.Create(Mission2, #HMYST, 2416.829, -1666.706, 13.5355)
4@ = Actor.Create(Mission2, #BMORI, 2416.829, -1666.706, 13.5355)
5@ = Actor.Create(Mission2, #BMORI, 2416.829, -1666.706, 13.5355)
072A: put_actor $PLAYER_ACTOR into_car 1@ driverseat 
0430: put_actor 3@ into_car 1@ passenger_seat 0 
0430: put_actor 4@ into_car 2@ passenger_seat 0 
072A: put_actor 5@ into_car 2@ driverseat 
01B2: give_actor 3@ weapon 28 ammo 9999 // Load the weapon model before using this 
01B2: give_actor 4@ weapon 28 ammo 9999 // Load the weapon model before using this 

:NONAME_302
wait 10 
if 
   Actor.InCar($PLAYER_ACTOR, 1@)
else_jump @NONAME_302 
0713: actor 3@ driveby_actor -1 car 2@ point 0.0 0.0 0.0 radius -1 8 1 firing_rate 100 
0713: actor 4@ driveby_actor -1 car 1@ point 0.0 0.0 0.0 radius -1 8 1 firing_rate 100 
Car.DriveTo(1@, 2060.385, -1916.034, 13.5469)
Car.SetMaxSpeed(1@, 30.0)
00AE: set_car 1@ traffic_behaviour_to 3 
07F8: car 2@ follow_car 1@ radius 7.5 
Car.SetMaxSpeed(2@, 50.0)
02A3: enable_widescreen 1 
wait 1500 
fade 1 1500 

:NONAME_467
wait 10 
if 
00EE:   actor $PLAYER_ACTOR 0 near_point 2067.859 -1913.868 radius 4.0 4.0 in_car 
else_jump @NONAME_467 
fade 0 1500 
wait 1500 
02A3: enable_widescreen 0 
Camera.Restore_WithJumpCut
wait 1500 
fade 1 1500 
0A93: end_custom_thread 


Może zróbcie sami ten skrypt i podeślijcie mi gotowy, jeżeli możecie. Pozdrawiam
Postów: 878 Dołączył: 2009-01-20
#
dadas96: zaaplikuj te zmiany, o których powiedziałem i sprawdź, czy działa.

___________________
Administrator
Postów: 109 Dołączył: 2009-04-25
#
Dałem edit posta wyżej, tam jest co zmieniłem MakG
Postów: 878 Dołączył: 2009-01-20
#
Wszystko Ci się pomieszało. W funkcji "Player.Defined()" wsadzasz zmienną $PLAYER_CHAR, bo jest związana bezpośrednio z graczem.

Kod:
jf @NONAME_2

Ten kod nie ma w ogóle zastosowania. Jest to synonim "jump_if_false", a w tamtym miejscu nie stosujesz żadnego warunku.

Tutaj masz cały poprawiony kod:

Kod:

{$CLEO .cs}

:NONAME_2
wait 0
if
Player.Defined($PLAYER_CHAR)
jf @NONAME_2
Model.Load(#HMYST)
Model.Load(#ELEGY)
Model.Load(#BMORI)
Model.Load(#NRG500)
Model.Load(#MICRO_UZI)
038B: load_requested_models
7@ = Marker.CreateIconAndSphere(23, 2378.961, -1729.756, 13.3828)

:NONAME_69
wait 10
if
00ED: actor $PLAYER_ACTOR 0 near_point 2378.961 -1729.756 radius 13.3828 1.0 on_foot
else_jump @NONAME_69
fade 0 1500
wait 1500
Marker.Disable(7@)
1@ = Car.Create(#ELEGY, 2378.961, -1729.756, 13.3828)
2@ = Car.Create(#NRG500, 2400.817, -1729.675, 13.3828)
3@ = Actor.Create(Mission2, #HMYST, 2416.829, -1666.706, 13.5355)
4@ = Actor.Create(Mission2, #BMORI, 2416.829, -1666.706, 13.5355)
5@ = Actor.Create(Mission2, #BMORI, 2416.829, -1666.706, 13.5355)
072A: put_actor $PLAYER_ACTOR into_car 1@ driverseat
0430: put_actor 3@ into_car 1@ passenger_seat 0
0430: put_actor 4@ into_car 2@ passenger_seat 0
072A: put_actor 5@ into_car 2@ driverseat
01B2: give_actor 3@ weapon 28 ammo 9999 // Load the weapon model before using this
01B2: give_actor 4@ weapon 28 ammo 9999 // Load the weapon model before using this

:NONAME_302
wait 10
if
Actor.InCar($PLAYER_ACTOR, 1@)
jf @NONAME_302
0713: actor 3@ driveby_actor -1 car 2@ point 0.0 0.0 0.0 radius -1 8 1 firing_rate 100
0713: actor 4@ driveby_actor -1 car 1@ point 0.0 0.0 0.0 radius -1 8 1 firing_rate 100
Car.DriveTo(1@, 2060.385, -1916.034, 13.5469)
Car.SetMaxSpeed(1@, 30.0)
00AE: set_car 1@ traffic_behaviour_to 3
07F8: car 2@ follow_car 1@ radius 7.5
Car.SetMaxSpeed(2@, 50.0)
02A3: enable_widescreen 1
wait 1500
fade 1 1500

:NONAME_467
wait 10
if
00EE: actor $PLAYER_ACTOR 0 near_point 2067.859 -1913.868 radius 4.0 4.0 in_car
jf @NONAME_467
fade 0 1500
wait 1500
02A3: enable_widescreen 0
Camera.Restore_WithJumpCut()
wait 1500
fade 1 1500
0A93: end_custom_thread

___________________
Administrator
Postów: 248 Dołączył: 2009-06-27
#
Z tym jumpem, to napisałem Ci, żebyś KASOWAŁ poprzednie.

MakG - co do kodu @up nie napisałeś 0000: NOP. Z tego co wiem deklaruje to skrypt jako CLEO. Wyjdzie mu z tego pewnie SCM

___________________
http://www.gta-mods.pl/public/images/userbar
Postów: 878 Dołączył: 2009-01-20
#
Nagłówek
Kod:
{$CLEO .cs}

wystarczy do deklaracji skryptu jako CLEO.

___________________
Administrator
Postów: 248 Dołączył: 2009-06-27
#
Pamiętam, że miałem kiedyś błąd, bo nie napisałem tego NOPa. To po co on jest we wszystkich szablonach i gotowych skryptach (przynajmniej niektórych osób)?

___________________
http://www.gta-mods.pl/public/images/userbar
Postów: 109 Dołączył: 2009-04-25
#
Ok skrypt działa, ale jest parę drobnostek: gdy wejdę w marker, i pojazd już jedzie, motor rusza z opóźnieniem, jakieś 5 sekund. Do skryptu dodałem NOP'a.
Postów: 248 Dołączył: 2009-06-27
#
Kod:
07F8: car 2@ follow_car 1@ radius 7.5

Pojazd 1@ nie zbliży się bardziej do 2@ niż na 7.5 metra. Zacznie jechać za nim, jeśli ta odległość zostanie przekroczona. Zmniejsz wartość radius 7.5 na np. 3.0; Nie może być zbyt mała, bo auto wjedzie w bagażnik tego drugiego.

---
Co z innymi drobnostkami? Chętnie pomogę.

___________________
http://www.gta-mods.pl/public/images/userbar
Postów: 109 Dołączył: 2009-04-25
#
Ok wielkie dzięki, temat do zamknięcia, a i sorki za te zawracanie głowy :)Ale nowy jestem ;p
Pozdrawiam
Poprzedni 1 2 Następny
Zaloguj się lub zarejestruj się, żeby pisać na forum.
Created & Powered by MakG