IMG

 
IMG
IMG   IMG
  Welcome to GTAForums! Be sure to check out the Grand Theft Auto V Forum.

You are not registered! (If you are, click here to login) Registering is fast, free and easy and allows you to instantly reply to any topic on GTAForums.
Why wait? Click here to register your own unique username and become part of the ever-growing community!


( Log In | Register | Revalidate Validation E-mail )
Quick Log-In:
  IMG
       
>
Forum Rules GTA Modification Forums

Please post mod releases in the Mod Showroom

GTAGarage.com
free mod hosting from GTANet, simply login with your GTAForums account details

GTAModding.com
GTANet's modding wiki

GTA Modding Chatroom
provided by irc.gtanet.com (Don't have an IRC client? Click here)


Pages: (2) 1 [2]   ( Go to first unread post ) Reply to this topicStart new topicStart Poll

 Adding opcodes in Sanny Builder

 
Bad.boy!  
Posted: Friday, Sep 21 2012, 18:10
Quote Post


SA modder
Group Icon
Group: Members
Joined: Jun 20, 2010

nl.gif

XXXXX



My bad, I meant 0248 blush.gif

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
PM
  Top
 

 
Asepl  
Posted: Friday, Sep 21 2012, 19:05
Quote Post


Proud DYOM user
Group Icon
Group: Members
Joined: May 27, 2010

XXXXX



I am not sure if you get me now.

All the troubles can be fixed by myself. The problem is the script bugs somehow on the "until", and it just won't continue.
I found a solution, but it is a lil' bit trouble some, I need to do:

CODE
[code]
jump @NEW_LABEL

:NEW_LABEL
if
<condition>
else_jump @NEW_LABEL

and the actions after fulfilling condition go here


It works just like "until", but as I said, is way more troublesome :|
PM
  Top
 

 
Asepl  
Posted: Friday, Sep 21 2012, 19:32
Quote Post


Proud DYOM user
Group Icon
Group: Members
Joined: May 27, 2010

XXXXX



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


PM
  Top
 

 
PatrickW  
Posted: Friday, Sep 21 2012, 19:41
Quote Post


GTA Juggernaut
Group Icon
Group: Moderators
Joined: Jan 7, 2004

nl.gif

Member Award




@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
Users WebsitePM
  Top
 

 
Asepl  
Posted: Friday, Sep 21 2012, 20:00
Quote Post


Proud DYOM user
Group Icon
Group: Members
Joined: May 27, 2010

XXXXX



Nice, this works smile.gif

That's a great lesson for me biggrin.gif

New question coming up.
I saw people making "talking" in their missions. I wonder if it is possible to display such text without editing the GTX files?

This post has been edited by Asepl on Friday, Sep 21 2012, 20:22
PM
  Top
 

 
SilentPL  
Posted: Friday, Sep 21 2012, 21:05
Quote Post


Senior File Manager
Group Icon
Group: Members
Joined: Feb 1, 2010

pl.gif

Member Award




QUOTE (Asepl @ Friday, Sep 21 2012, 22:00)
I saw people making "talking" in their missions. I wonder if it is possible to display such text without editing the GTX files?

It is, but not advisable to use in strictly main.scm mods.
Users WebsitePMMSNXbox Live
  Top
 

 
Asepl  
Posted: Friday, Sep 21 2012, 21:29
Quote Post


Proud DYOM user
Group Icon
Group: Members
Joined: May 27, 2010

XXXXX



So I guess I have to use the GXT editor and just add my own texts, right? tounge.gif
PM
  Top
 

 
Bad.boy!  
Posted: Friday, Sep 21 2012, 21:30
Quote Post


SA modder
Group Icon
Group: Members
Joined: Jun 20, 2010

nl.gif

XXXXX



QUOTE (PatrickW @ Friday, Sep 21 2012, 21:41)
@Bad.boy! :
to clarify:
"fade 0" turns screen to black
"fade 1" turns screen on again

Yeah I know that, but in his original code he faded in, out and then out again. So I thought he wanted to fade in.

Also a slight note in the Asepl's code, put the "wait 0" in front of the if statement or after the else_jump.
CODE
:CHECK3
if
02D8:   actor $PLAYER_ACTOR current_weapon == 22
wait 0 // <--Shouldn't be here
else_jump @CHECK3  
PM
  Top
 

 
Asepl  
Posted: Saturday, Sep 22 2012, 15:47
Quote Post


Proud DYOM user
Group Icon
Group: Members
Joined: May 27, 2010

XXXXX



Uh. How can I make an invisible if-area ?

I can only make a visible one confused.gif
PM
  Top
 

 
arijitsen  
Posted: Saturday, Sep 22 2012, 15:59
Quote Post


Modder,Gamer & GFX Artist
Group Icon
Group: Members
Joined: Jun 19, 2012

ia.gif

XXXXX



Do you mean creating an invisible sphere ??:
CODE

00FF:   actor $PLAYER_ACTOR sphere 1 in_sphere $X_JOHNSON_HOUSE $Y_JOHNSON_HOUSE $Z_JOHNSON_HOUSE radius 1.0 1.0 2.0 on_foot

Users WebsitePM
  Top
 

 
Bad.boy!  
Posted: Saturday, Sep 22 2012, 16:26
Quote Post


SA modder
Group Icon
Group: Members
Joined: Jun 20, 2010

nl.gif

XXXXX



I don't know what you mean with an invisible "if-area", but if you're talking about invisible sphere, you just need to set "sphere 0".
CODE
00EC:   actor $PLAYER_ACTOR sphere 0 near_point 1812.369 -1929.922 radius 80.0 80.0 // <-- invisible
00EC:   actor $PLAYER_ACTOR sphere 1 near_point 1812.369 -1929.922 radius 80.0 80.0 // <-- visible
PM
  Top
 

 
Asepl  
Posted: Saturday, Sep 22 2012, 17:50
Quote Post


Proud DYOM user
Group Icon
Group: Members
Joined: May 27, 2010

XXXXX



Thanks, works biggrin.gif

This post has been edited by Asepl on Sunday, Sep 23 2012, 20:10
PM
  Top
 

 
Asepl  
Posted: Sunday, Sep 23 2012, 20:11
Quote Post


Proud DYOM user
Group Icon
Group: Members
Joined: May 27, 2010

XXXXX



Bump, new question.

Does anyone know, how to remove the "gang tagging" animation after one one actor kills the other one?
PM
  Top
 

 

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)

0 Members:

Pages: (2) 1 [2] 

Topic Options Reply to this topicStart new topicStart Poll
Search topic for posted by (exact match)



 
IMG IMG