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

 
Asepl  
Posted: Wednesday, Sep 19 2012, 15:30
Quote Post


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

XXXXX



Hey. I've started to script for GTA SA, and one thing bothers me from the very beginning.

Do I have to manually type all the opcodes in front of every command, or there is some way to make it auto fill with the desired opcodes?
Also, what should I do, when I can't find the opcode I need in the Sanny's Tool?


And my last question, have you got any idea why would my "Coords Manager" option be grey&unusable? ._.
PM
  Top
 

 
arijitsen  
Posted: Wednesday, Sep 19 2012, 15:38
Quote Post


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

ia.gif

XXXXX



Open sanny & press CTRL + ALT + 2
You will get the list of opcodes just use them as you wish..
If you can't find any opcode search here:
http://gtag.gtagaming.com/opcode-database.php
Then just use the opcode...
You can use the coords manager only when the game is running...
Users WebsitePM
  Top
 

 
Asepl  
Posted: Wednesday, Sep 19 2012, 15:48
Quote Post


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

XXXXX



Oh thank you for the help smile.gif

Two more questions now:

Can I check the actor's ammo?
I found this: 04B8: get_weapon_data_from_actor $PLAYER_ACTOR weapon_group 2 weapon 380@ ammo 381@ model 381@
But I'm not sure if this works, and how :S

And, how can I run GTA SA in window mode?... I've searched around, but couldn't find -_-

This post has been edited by Asepl on Wednesday, Sep 19 2012, 15:53
PM
  Top
 

 
Link2012  
Posted: Wednesday, Sep 19 2012, 15:57
Quote Post


Wut?
Group Icon
Group: Members
Joined: Jan 30, 2011

ba.gif

XXXXX



QUOTE
I found this: 04B8: get_weapon_data_from_actor $PLAYER_ACTOR weapon_group 2 weapon 380@ ammo 381@ model 381@
But I'm not sure if this works, and how :S

04B8: get_weapon_data_from_actor $PLAYER_ACTOR weapon_group 2 weapon 0@ ammo 1@ model 2@
This will get the weapon, ammo and model of the weapon at the slot (weapon group) 2!
You can see the weapon groups at Sanny Builder Help (Help > SCM Documentation > GTA SA > Weapon Numbers)

QUOTE
And, how can I run GTA SA in window mode?... I've searched around, but couldn't find -_-

http://www.gtagarage.com/mods/show.php?id=4404
Just go in the advanced video options and select the window mode in the resolution

PMMSN
  Top
 

 
Asepl  
Posted: Wednesday, Sep 19 2012, 16:03
Quote Post


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

XXXXX



Thank you for the reply biggrin.gif

Continuing, could you please write me an example of code in which it would check IF the actor 1@'s ammo in the weapon left is equal to 10, then [space for code]? I can't really figure out if it's possible, and you'd be a GREAT help, if you could write this example happy.gif
PM
  Top
 

 
Deji  
Posted: Wednesday, Sep 19 2012, 19:25
Quote Post


Coding like a Rockstar!
Group Icon
Group: Members
Joined: Dec 24, 2007

ja.gif

XXXXX



This aint DYOM, read a tutorial! tounge2.gif
Users WebsitePM
  Top
 

 
Asepl  
Posted: Wednesday, Sep 19 2012, 19:40
Quote Post


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

XXXXX



Well I'm reading the basic one made by Dutchy, and going to read the advanced one in time, but I don't really understand how can I check actor's ammo tounge.gif
PM
  Top
 

 
Michael-Knight1  
Posted: Wednesday, Sep 19 2012, 21:15
Quote Post


Never Give UP
Group Icon
Group: Members
Joined: Jul 8, 2012

gr.gif

XXXXX



QUOTE (Asepl @ Wednesday, Sep 19 2012, 19:40)
Well I'm reading the basic one made by Dutchy, and going to read the advanced one in time, but I don't really understand how can I check actor's ammo tounge.gif

If Variation Which you can check your code with it
CODE

00D6: if //

0470 to check your current weapon
041A to check your weapon ammo
CODE

0470: $myweapon = actor $PLAYER_ACTOR current_weapon
041A: $ammo = actor $PLAYER_ACTOR weapon $myweapon ammo


Users WebsitePM
  Top
 

 
Deji  
Posted: Wednesday, Sep 19 2012, 21:25
Quote Post


Coding like a Rockstar!
Group Icon
Group: Members
Joined: Dec 24, 2007

ja.gif

XXXXX



But don't use $namedglobalvariables like Michael.Knight1 is insistent on doing, as using $a in one script and $b in another script will compile as the same variable and conflict. Use 0@-31@
Users WebsitePM
  Top
 

 
arijitsen  
Posted: Thursday, Sep 20 2012, 03:02
Quote Post


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

ia.gif

XXXXX



CODE

0470: 2@ = actor $PLAYER_ACTOR current_weapon
041A: 1@ = actor $PLAYER_ACTOR weapon 2@ ammo

Use the following
Remmember to check by IF variation.
CODE

if

So your total code will be some what like this:
CODE

if and
0470: 2@ = actor $PLAYER_ACTOR current_weapon
041A: 1@ = actor $PLAYER_ACTOR weapon 2@ ammo

Users WebsitePM
  Top
 

 
Link2012  
Posted: Thursday, Sep 20 2012, 05:26
Quote Post


Wut?
Group Icon
Group: Members
Joined: Jan 30, 2011

ba.gif

XXXXX



lol wtf, 0470 neither 041A are conditions

You should check just 1@ for the ammo quantity
PMMSN
  Top
 

 
arijitsen  
Posted: Thursday, Sep 20 2012, 05:28
Quote Post


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

ia.gif

XXXXX



OH I didn't saw that my mistake ...sorry... I just didn't noticed that....lol...
Users WebsitePM
  Top
 

 
Asepl  
Posted: Thursday, Sep 20 2012, 05:51
Quote Post


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

XXXXX



Oww, such a mistake tounge.gif Thank you for trying though.

So I can't really make a condition like this?
PM
  Top
 

 
Deji  
Posted: Thursday, Sep 20 2012, 12:26
Quote Post


Coding like a Rockstar!
Group Icon
Group: Members
Joined: Dec 24, 2007

ja.gif

XXXXX



Seriously, this is coding basics. You need to fully read a tutorial...

041A stores the ammo of whatever weapon ID you want. All you gotta do is check the value returned is higher than 0.
Users WebsitePM
  Top
 

 
Asepl  
Posted: Thursday, Sep 20 2012, 17:52
Quote Post


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

XXXXX



Thank you for the help.

But now I encounter sanny builder problem... This thing just won't show me any coords from the game, it did yesterday, and now it fails confused.gif
I read that it is some problem with .exe, but I have no idea how to fix it...

Any suggestions?
PM
  Top
 

 
Bad.boy!  
Posted: Thursday, Sep 20 2012, 17:59
Quote Post


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

nl.gif

XXXXX



Do you have v1?
PM
  Top
 

 
Asepl  
Posted: Thursday, Sep 20 2012, 18:01
Quote Post


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

XXXXX



Yes. I told you it worked yesterday.

Now I see that any changes I do to the main.scm won't show in game. The script is frozen at my yesterday's one ...
What the hell has happened to this.

Nevermind, it works.
Had to reinstall Sanny Builder.

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

 
Asepl  
Posted: Friday, Sep 21 2012, 16:24
Quote Post


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

XXXXX



Okay, so I've created this code:

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
repeat
wait 0
until 816B:   not fading

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)

fade 1 500
repeat
wait 0
until 816B:   not fading

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 ms
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



However, I've got two problems with it.
1st: It won't unfade
2nd: Actors haven't got the animations -_-

Could anyone check this script and tell me what's wrong?
PM
  Top
 

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


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

nl.gif

XXXXX



Why do you make the game fade when all models are loaded? And this:

CODE
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 // <-- here


Use 0247 OR 038B. In this case I would start fading first, then load all models (and anims), then create all actors, then set the camera then release all models, then start unfading, then apply all the animations (can be done earlier to). And I would use 038B.

At the end of the code you start unfading, replace that with fading (what you want?).

The animations seems to be ok as far as this part of the code goes (I assume that there is more, because it hasn't got an end).
PM
  Top
 

 
Asepl  
Posted: Friday, Sep 21 2012, 17:45
Quote Post


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

XXXXX



Erm.
I'm not sure If you're speaking trustfully...

Here's a part of Dutchy's code.

CODE
:load_check
wait 0
if and
model.available(#army)
model.available(#patriot)
model.available(#m4)
023D:   special_actor 1 loaded
023D:   special_actor 2 loaded
023D:   special_actor 3 loaded
else_jump @load_check

//---------------------
//Spawn everything in fade
//---------------------

[COLOR=red]fade 0 500
repeat
wait 0
until 816B:   not fading[/COLOR]
02A3: enable_widescreen 1
03BD: destroy_sphere $begin

Car.Create($car, #patriot, 2503.0217, -1672.2841, 13.3594)
Car.Angle($car) = 82.3844

0129: 1@ = create_actor_pedtype 23 model #army in_car $car driverseat
01C8: 2@ = create_actor_pedtype 23 model #army in_car $car passenger_seat 0
01C8: 3@ = create_actor_pedtype 23 model #army in_car $car passenger_seat 1
01C8: 4@ = create_actor_pedtype 23 model #army in_car $car passenger_seat 2


The fading has to occur BEFORE models' spawn, and AFTER checking if the models are loaded. At least I think so.

Also,

QUOTE
Use 0247 OR 038B
What do you mean ...

Part of Dutchy's script again:

CODE
// Load models
0247: load_model #BFYST
038B: load_requested_models


And what is the
CODE
038B: load_requested_models // <-- here
supposed to mean the heck? You want to add a comment?




In general, I found the main problem.
It seems that none of my "until" commands work suicidal.gif I have no idea why, as I am doing everything like in the tutorials... And the tuts examples work just fine.

Here is the part of my until script.

CODE
repeat
wait 0 ms
until 04EE:   animation "GANGS" loaded


And because the "until" command doesn't work, animations don't work as well, so does the unfade. The script just won't continue further, because it bugs somehow on the "until" angry.gif

Any ideas?
PM
  Top
 

 

0 User(s) are reading this topic (0 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