|
 |
|
|
|
|
|
GTA Modification Forums
Adding opcodes in Sanny Builder
 |
|
 |
| |
Bad.boy!  |
|
SA modder

Group: Members
Joined: Jun 20, 2010


|
My bad, I meant 0248 This is 038B: | CODE | | 038B: load_requested_models |
And this is 0248: | CODE | | model.available(#M4) |
Explanation: 0248 checks whether the specified model is loaded or not. But 038B stops the game and waits until all models are loaded, this makes 038B faster. The downside of stopping the game means that there will be a frame drop, but that doesn't matter because the screen is black anyway (faded). Dutchy could have done the fading differently, but in my opinion actors popping up out of nowhere doesn't look as good as actors being there in the first place. Also if you don't want to use models any more you should release them with: | CODE | | 0249: release_model #M4 |
Your script is not fading because (as I mentioned in the previous post): | CODE | fade 1 500
Use this to fade in: fade 0 500 |
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
Asepl  |
|
Proud DYOM user

Group: Members
Joined: May 27, 2010

|
For example, this script works: (with few new features) | CODE | { use macro (Ctrl+J) "headsa" to insert a file header } {$VERSION 3.0.0000}
thread 'MAIN' var $PLAYER_CHAR: Player end // var 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, 2444.9773, -1563.8386, 26.2076) $PLAYER_ACTOR = Actor.EmulateFromPlayer($PLAYER_CHAR) 07AF: $PLAYER_GROUP = player $PLAYER_CHAR group Camera.SetBehindPlayer set_weather 0 wait 0 ms $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 0629: change_stat 181 (islands unlocked) to 4 016C: restart_if_wasted at 2027.77 -1420.52 15.99 angle 137.0 for_town_number 0 016D: restart_if_busted at 1550.68 -1675.49 14.51 angle 90.0 for_town_number 0 0180: set_on_mission_flag_to $ONMISSION // Note: your missions have to use the variable defined here ($ONMISSION) 03E6: remove_text_box // put your create_thread commands here create_thread @MODEL
// put your mods (threads) here
// IDLE LOOP :leeg wait 500 jump @leeg
end_thread
:MODEL thread 'MODEL'
// Load Models 0247: load_model #WBDYG2 0247: load_model #COLT45 0247: load_model #TEC9 0247: load_model #FREEWAY 0247: load_model #BURRITO 0247: load_model #WMYCR 0247: load_model #BIKERA 0247: load_model #BIKERB 0247: load_model #WBDYG1 038B: load_requested_models
:MODELS_LOAD if or 8248: not model #WBDYG1 available 8248: not model #COLT45 available 8248: not model #TEC9 available 8248: not model #WBDYG2 available 8248: not model #FREEWAY available 8248: not model #WMYCR available 8248: not model #BURRITO available 8248: not model #BIKERA available 8248: not model #BIKERB available else_jump @MODELS_SPAWN wait 0 ms 0001: jump @MODELS_LOAD
:MODELS_SPAWN
fade 0 500 jump @CHECK1
:CHECK1 if 816B: not fading wait 0 else_jump @CHECK1
02A3: enable_widescreen 1 01B4: set_player $PLAYER_CHAR can_move 0 Camera.SetPosition(2452.1516, -1557.4697, 26.4455, 0.0, 0.0, 0.0) Camera.PointAt(2461.6311, -1551.5996, 24.0015, 1)
1@ = Car.Create(#BURRITO, 2463.8245, -1555.5416, 23.6373) 0229: set_car 1@ primary_color_to 0 secondary_color_to 0 2@ = Car.Create(#FREEWAY, 2458.4707, -1553.1155, 24.0023) 0229: set_car 2@ primary_color_to 0 secondary_color_to 1 Car.Angle(2@) = 302.0
3@ = Actor.Create(CRIMINAL, #WMYCR, 2465.7693, -1550.2465, 24.0009) Actor.Angle(3@) = 92.0 Actor.Health(3@) = 50 02E2: set_actor 3@ weapon_accuracy_to 80
4@ = Actor.Create(CIVMALE, #BIKERA, 2463.9341, -1550.4586, 24.001) Actor.Angle(4@) = 272.0 Actor.Health(4@) = 50 02E2: set_actor 4@ weapon_accuracy_to 80
5@ = Actor.Create(CIVMALE, #BIKERB, 2462.0205, -1555.2186, 24.0033) Actor.Angle(5@) = 92.0 Actor.Health(5@) = 50 02E2: set_actor 5@ weapon_accuracy_to 70
04ED: load_animation "GANGS"
:CHECK2 if 04EE: animation "GANGS" loaded wait 0 else_jump @CHECK2
0605: actor 3@ perform_animation_sequence "PRTIAL_GNGTLKA" IFP_file "GANGS" 4.0 loop 1 0 0 0 time -1 // versionA 0605: actor 4@ perform_animation_sequence "PRTIAL_GNGTLKB" IFP_file "GANGS" 4.0 loop 1 0 0 0 time -1 // versionA 0605: actor 5@ perform_animation_sequence "SMKCIG_PRTL" IFP_file "GANGS" 4.0 loop 1 0 0 0 time -1 // versionA
fade 1 500 repeat wait 0 until 816B: not fading
01B2: give_actor 3@ weapon 22 ammo 60 // Load the weapon model before using this 01B2: give_actor 4@ weapon 22 ammo 60 // Load the weapon model before using this 01B2: give_actor 5@ weapon 22 ammo 60 // Load the weapon model before using this 01B2: give_actor $PLAYER_ACTOR weapon 22 ammo 60 // Load the weapon model before using this
01B9: set_actor 3@ armed_weapon_to 0 01B9: set_actor 4@ armed_weapon_to 0 01B9: set_actor 5@ armed_weapon_to 0 01B9: set_actor $PLAYER_ACTOR armed_weapon_to 0
wait 3000 ms
Player.CanMove($PLAYER_CHAR, true) 0373: set_camera_directly_behind_player 02EB: restore_camera_with_jumpcut 02A3: enable_widescreen 0
:CHECK3 if 02D8: actor $PLAYER_ACTOR current_weapon == 22 wait 0 else_jump @CHECK3
01B9: set_actor 3@ armed_weapon_to 22 01B9: set_actor 4@ armed_weapon_to 22 01B9: set_actor 5@ armed_weapon_to 22
05E2: AS_actor 3@ kill_actor $PLAYER_ACTOR 05E2: AS_actor 4@ kill_actor $PLAYER_ACTOR 05E2: AS_actor 5@ kill_actor $PLAYER_ACTOR
0249: release_model #WBDYG1 0249: release_model #COLT45 0249: release_model #TEC9 0249: release_model #FREEWAY 0249: release_model #WBDYG2 0249: release_model #WMYCR 0249: release_model #BIKERA 0249: release_model #BIKERB
04EF: release_animation "GANGS"
end_thread |
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
PatrickW  |
|
GTA Juggernaut

Group: Moderators
Joined: Jan 7, 2004



|
@Bad.boy! : to clarify: "fade 0" turns screen to black "fade 1" turns screen on again @ts: The code below works. The main problem was the if-construction for the "loaded" check, which had 9 conditions. It seems that this messes up the high-level syntax constructs (repeat-until loops) processing by sanny-builder. But as Bad.boy! pointed out, you don't need the check if you use 038B, so I removed it. I've moved the fade out before the 038B, to hide the short framefreeze from sight. BTW. I usually don't bother with the "repeat-until not fading" check. I just put a "wait 500" after the "fade 0". and usually just keep going after the "fade 1" | CODE | { use macro (Ctrl+J) "headsa" to insert a file header }
{$VERSION 3.0.0000}
thread 'MAIN' var $PLAYER_CHAR: Player end // var 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, 2444.9773, -1563.8386, 26.2076) $PLAYER_ACTOR = Actor.EmulateFromPlayer($PLAYER_CHAR) 07AF: $PLAYER_GROUP = player $PLAYER_CHAR group Camera.SetBehindPlayer set_weather 0 wait 0 ms $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 0629: change_stat 181 (islands unlocked) to 4 016C: restart_if_wasted at 2027.77 -1420.52 15.99 angle 137.0 for_town_number 0 016D: restart_if_busted at 1550.68 -1675.49 14.51 angle 90.0 for_town_number 0 0180: set_on_mission_flag_to $ONMISSION // Note: your missions have to use the variable defined here ($ONMISSION) 03E6: remove_text_box // put your create_thread commands here create_thread @MODEL
// put your mods (threads) here
// IDLE LOOP :leeg wait 500 jump @leeg
end_thread
:MODEL thread 'MODEL'
fade 0 500 repeat wait 0 until 816B: not fading
// Load Models 0247: load_model #WBDYG2 0247: load_model #COLT45 0247: load_model #TEC9 0247: load_model #FREEWAY 0247: load_model #BURRITO 0247: load_model #WMYCR 0247: load_model #BIKERA 0247: load_model #BIKERB 0247: load_model #WBDYG1 038B: load_requested_models
02A3: enable_widescreen 1 01B4: set_player $PLAYER_CHAR can_move 0 Camera.SetPosition(2452.1516, -1557.4697, 26.4455, 0.0, 0.0, 0.0) Camera.PointAt(2461.6311, -1551.5996, 24.0015, 1)
1@ = Car.Create(#BURRITO, 2463.8245, -1555.5416, 23.6373) 0229: set_car 1@ primary_color_to 0 secondary_color_to 0 2@ = Car.Create(#FREEWAY, 2458.4707, -1553.1155, 24.0023) 0229: set_car 2@ primary_color_to 0 secondary_color_to 1 Car.Angle(2@) = 302.0
3@ = Actor.Create(CRIMINAL, #WMYCR, 2465.7693, -1550.2465, 24.0009) Actor.Angle(3@) = 92.0 Actor.Health(3@) = 50 02E2: set_actor 3@ weapon_accuracy_to 80
4@ = Actor.Create(CIVMALE, #BIKERA, 2463.9341, -1550.4586, 24.001) Actor.Angle(4@) = 272.0 Actor.Health(4@) = 50 02E2: set_actor 4@ weapon_accuracy_to 80
5@ = Actor.Create(CIVMALE, #BIKERB, 2462.0205, -1555.2186, 24.0033) Actor.Angle(5@) = 92.0 Actor.Health(5@) = 50 02E2: set_actor 5@ weapon_accuracy_to 70
04ED: load_animation "GANGS" repeat wait 0 until 04EE: animation "GANGS" loaded
0605: actor 3@ perform_animation_sequence "PRTIAL_GNGTLKA" IFP_file "GANGS" 4.0 loop 1 0 0 0 time -1 // versionA 0605: actor 4@ perform_animation_sequence "PRTIAL_GNGTLKB" IFP_file "GANGS" 4.0 loop 1 0 0 0 time -1 // versionA 0605: actor 5@ perform_animation_sequence "SMKCIG_PRTL" IFP_file "GANGS" 4.0 loop 1 0 0 0 time -1 // versionA
fade 1 500 repeat wait 0 until 816B: not fading
end_thread
|
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
Pages:
(2) 1 [2]
Track this topic
Receive email notification when a reply has been made to this topic and you are not active on the board.
Subscribe to this forum
Receive email notification when a new topic is posted in this forum and you are not active on the board.
Download / Print this Topic
Download this topic in different formats or view a printer friendly version.
| |
 |
|
 |
|
|
|
|