Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Summer Special
      2. The Diamond Casino Heist
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Frontier Pursuits
      2. Find Lobbies & Outlaws
      3. Help & Support
    3. Crews

    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. Grand Theft Auto Series

    2. GTA VI

      1. St. Andrews Cathedral
    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
    6. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
    7. GTA III

      1. Guides & Strategies
      2. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    3. Gangs

    1. Announcements

    2. Support

    3. Suggestions

Sign in to follow this  
Deji

Dream Opcodes

Recommended Posts

Deji

The last and nearly only discussion topic related to coding got me wanting to make more discussions about coding.

 

 

So let's post our dream opcodes so that we can salivate over the idea that they could actually exist as an unknown opcode in SA.

 

 

 

Things that I want are mostly so I can complete my dead-end scripts:

 

 

0000: display_keyboard  // save a lot of time coding, eh?{- 1: All- 2: Letters- 3: Numbers}0000: set_keyboard_type 10000: set_keyboard_max_chars = 8{ -- idea from a script I'm working on... get typed animation and load it -- }0000: [email protected] = get_keyboard_data0000: add_gxt_entry_data [email protected] to 'MAIN' in "text/custom.gxt" with_name "MYTEXT1"  // the existent versions of this aren't what I want.{- 1: Integer- 2: Float}0000: convert_string [email protected] to_number_type 1 store_to [email protected]: [email protected] = get_map_object 50  // each number could relate to an IPL object. Then we can change the map easily.0000: destroy_san_andreas  // c'mon... it'd be a laugh, right?0000: pause_game  // without pausing the code.0000: [email protected] = search_string [email protected]:    [email protected] == result_found "hello"0000: reload "models/gta3.img"  // mmmmm

 

 

And other file functions similar to the stuff you can do in PHP... PHP has helped me do so many things quickly.

 

For example... In the opcode database I managed to get PHP to read the opcodes.txt and sascm.ini files to find the opcodes to add to the database. Saving me loads of time since I only had to add other things.

 

 

I'd be able to finish all my desired scripts with these opcodes smile.gif Unfortunately... I doubt most of em are even creatable through .asi's. There'd have to be an actual function to do them as far as I know...

 

 

 

Be nice to see what other modders want that I haven't thought of... San Andreas must surely be THE game to mod. I've actually tried finding other moddable games with little luck.

Edited by Deji

Share this post


Link to post
Share on other sites
Seemann

CLEO 4 has 100 opcodes (+50 new comparing to CLEO 3), and some of the mentioned above ones are already implemented. tounge.gif

Share this post


Link to post
Share on other sites
Roflcake

 

CLEO 4 has 100 opcodes (+50 new comparing to CLEO 3), and some of the mentioned above ones are already implemented. tounge.gif

if

1337: mp3 [email protected] loaded

jf @test1

 

would be very useful inlove.gif

Share this post


Link to post
Share on other sites
NTAuthority

 

CLEO 4 has 100 opcodes (+50 new comparing to CLEO 3), and some of the mentioned above ones are already implemented. tounge.gif

Please tell me there are ped/vehicle/object/whatever pool traversal opcodes... that's one of the few things the old method is actually very flawed at. tounge.gif

Share this post


Link to post
Share on other sites
Deji

OMG... That's great smile.gif

 

50 new opcodes... Oh the suspense... [/peepants]

 

 

Most of the ones I want are to work with strings... Like combining two strings together and such... As well as a new way to use variables (more varies).

 

The news of CLEO4 makes me want to stall Vigilante Justice a little... Although you'll have probably finished CLEO5 before I finish VJ...

 

 

I thought you'd gone off to make CLEO-like things for IV and abandoned SA tounge2.gif There's still so much to be done to SA.

 

A lot of people are still occupied with IV sad.gif And I'm working on something that has been one of the most wanted things in SA. I feel like after spending months on the first release of my awesome script it's gonna go under-appreciated tounge.gif

 

 

What would you do if you added a CLEO4 opcode that turned out to exist as an unknown in SA? smile.gif Although most of the unknowns are useless... I've started finding quite a few of them.

 

My favourite find was an internal function that was previously thought of as a NOP (and unused in all GTA's)... Such fun adding that to my state-of-the-art opcode database.

 

 

 

0000: simulate_key 1 time -1// press a key for someone... take over their character  - probably useless, though

 

 

I should stop typing now... I'm playing/singing along to music and it often causes me to babble since I can only just control what I'm typing while distracted with music...

 

 

EDIT: There have been posts since I started mine!

 

 

Please tell me there are ped/vehicle/object/whatever pool traversal opcodes... that's one of the few things the old method is actually very flawed at. tounge.gif

 

I'm wanting that too... But I really can't think of what I'd need in that area.... Maybe opcodes to get the offsets of bodyparts/weapons ect...

 

However... I think "nooo" whenever I realise that I've learned how to do something without the CLEO opcode for it... It feels like a waste of an opcode... But isn't since it helps others who can't do it as easily as me. It also saves time/vars, I guess.

Edited by Deji

Share this post


Link to post
Share on other sites
ZAZ

I wish me a similar version of 0929: for cleo

init_cleo_script_trigger (myCleoscript) with_object_model #NOODLECART_PROP priority 100 radius 70.0 type -1

Share this post


Link to post
Share on other sites
james227uk
Any planned release date for CLEO4 yet?

Share this post


Link to post
Share on other sites
Dstrickt
Any planned release date for CLEO4 yet?

Yea, I'm wondering that too. Is it still in testing stages, or is it almost ready to go? blush.gif

 

 

There's still so much to be done to SA.

 

Way too much things to be done, actually. sarcasm.gif

Share this post


Link to post
Share on other sites
Deji
I wish me a similar version of 0929: for cleo

init_cleo_script_trigger (myCleoscript) with_object_model #NOODLECART_PROP priority 100 radius 70.0 type -1

Yeahhh!! That would give the ability to control some IPL objects via CLEO n all...

 

Something I've never thought of smile.gif The reason I decided this would be an interesting topic tounge.gif

Share this post


Link to post
Share on other sites
Seemann

CLEO 4 is developed by another person, not by me, so I only promote it tounge.gif It's already out, visitors of my forums are using it, but it's still beta. When all the bugs are fixed, I guess there will be official release. smile.gif

 

 

Please tell me there are ped/vehicle/object/whatever pool traversal opcodes... that's one of the few things the old method is actually very flawed at. tounge.gif

What exactly do you mean?

 

 

I wish me a similar version of 0929: for cleo

init_cleo_script_trigger  (myCleoscript) with_object_model #NOODLECART_PROP priority 100 radius 70.0 type -1

Yeah, the one I'm dreaming of too.

Share this post


Link to post
Share on other sites
NTAuthority

 

CLEO 4 is developed by another person, not by me, so I only promote it tounge.gif It's already out, visitors of my forums are using it, but it's still beta. When all the bugs are fixed, I guess there will be official release. smile.gif

Hey, I thought you were developing it, not outsourcing it to another person tounge.gif

 

Also, if my Google Translate results are correct, is it that CLEO4 actually has a new audio library, possibly replacing the other Russian plugin SAAP?

 

 

 

Please tell me there are ped/vehicle/object/whatever pool traversal opcodes... that's one of the few things the old method is actually very flawed at. tounge.gif

What exactly do you mean?

 

 

Well, something like Win32's FindFirstFile/FindNextFile iteration items, but for the in-game pools. A for loop which goes to 30000 iterations is not exactly so performance-friendly, and one of my modifications has seen a great increase in responsiveness after throwing out the '30000 items in 10 frames' loop and replacing it with a loop directly going through the pools each frame.

 

EDIT: posting the new SASCM.ini section from the current beta (4.0.2.34) here since it's related to the subject:

 

 

0AC0=2,loop_audiostream %1d% flag %2d%0AC1=2,%2d% = load_audiostream_with_3d_support %1d% //IF and SET0AC2=4,set_audiostream %1d% 3d_position %2d% %3d% %4d%0AC3=2,link_3d_audiostream %1d% to_object %2d%0AC4=2,link_3d_audiostream %1d% to_actor %2d%0AC5=2,link_3d_audiostream %1d% to_vehicle %2d%0AC6=2,%2d% = label %1p% offset0AC7=2,%2d% = var %1d% offset0AC8=2,%2d% = allocate_memory_size %1d%0AC9=1,free_allocated_memory %1d%0ACA=1,show_text_box %1s%0ACB=3,show_styled_text %1s% time %2d% style %3d%0ACC=2,show_text_lowpriority %1s% time %2d%0ACD=2,show_text_highpriority %1s% time %2d%0ACE=-1,show_formatted_text_box %1s%0ACF=-1,show_formatted_styled_text %1s% time %2d% style %3d%0AD0=-1,show_formatted_text_lowpriority %1s% time %2s%0AD1=-1,show_formatted_text_highpriority %1s% time %2s%0AD2=2,%2d% = player %1d% targeted_actor //IF and SET0AD3=-1,print_string %1d% format %2s%0AD4=-1,%3d% = scan_string %1d% format %2s%0AD5=3,file %1d% seek %2d% from_origin %3d% //IF and SET0AD6=1,end_of_file %1d% reached0AD7=3,read_string_from_file %1d% to %2d% size %3d% //IF and SET0AD8=2,write_string_to_file %1d% from %2d% //IF and SET0AD9=-1,write_formatted_text %2d% in_file %1d%0ADA=-1,%3d% = scan_file %1d% format %2d% //IF and SET0ADB=2,%2d% = car_model %1o% name0ADC=1,  test_cheat %1d%0ADD=1,spawn_car_with_model %1o% at_player_location 0ADE=2,%2d% = text_by_GXT_entry %1d%0ADF=2,add_dynamic_GXT_entry %1d% text %2d%0AE0=1,remove_dynamic_GXT_entry %1d%0AE1=7,%7d% = random_actor_near_point %1d% %2d% %3d% in_radius %4d% find_next %5h% pass_deads %6h% //IF and SET0AE2=7,%7d% = random_vehicle_near_point %1d% %2d% %3d% in_radius %4d% find_next %5h% pass_wrecked %6h% //IF and SET0AE3=6,%6d% = random_object_near_point %1d% %2d% %3d% in_radius %4d% find_next %5h% //IF and SET0AE4=1,  directory_exist %1d%0AE5=1,create_directory %1d% //IF and SET0AE6=3,%2d% = find_first_file %1d% get_filename_to %3d% //IF and SET0AE7=2,%2d% = find_next_file %1d% //IF and SET0AE8=1,find_close %1d0AE9=1,pop_float %1d0AEA=2,%2d% = actor_struct %1d% handle0AEB=2,%2d% = car_struct %1d% handle0AEC=2,%2d% = object_struct %1d% handle0AED=3,%3d% = float %1d% to_string_format %2d%0AEE=3,%3d% = exp %1d% base %2d% //all floats0AEF=3,%3d% = log %1d% base %2d% //all floats

 

Edited by NTAuthority

Share this post


Link to post
Share on other sites
dtd mods
CLEO 4 has 100 opcodes (+50 new comparing to CLEO 3), and some of the mentioned above ones are already implemented. tounge.gif

when its goin to release?

Share this post


Link to post
Share on other sites
NTAuthority
CLEO 4 has 100 opcodes (+50 new comparing to CLEO 3), and some of the mentioned above ones are already implemented. tounge.gif

when its goin to release?

You can already get it (need to register, and possibly GTranslate)

Share this post


Link to post
Share on other sites
Deji

Heh... It indeed has some of my dream opcodes... Not my dreamiest, though sad.gif

 

 

Some of the sascm.ini and opcodes.txt entries need indention... Hard to tell whether an opcode is conditional or not at the moment...

 

Guess I'll do that as I add them to the database... And drool over each opcode as I'm adding them.

Share this post


Link to post
Share on other sites
Deji

 

CLEO 4 has 100 opcodes (+50 new comparing to CLEO 3), and some of the mentioned above ones are already implemented. tounge.gif

... I'm counting 48 additional? wow.gif

 

And calculated: 0AC0-0AEF = 2F (47).

 

Unless you are counting the 3 edits made to 0AAD, 0AAE, 0AAF... In which case there are 51 (assuming my counting is good... and it is tounge.gif)

 

 

 

Where's these hidden opcodes, eh? Even if I take all opcodes into account, Calculator says there are 99 opcodes... It had me doubting my own PHP/database skills then sigh.gif

Edited by Deji

Share this post


Link to post
Share on other sites
Seemann

You've missed 0ABB, 0ABC. Those are CLEO 4 ))

Share this post


Link to post
Share on other sites
Deji

Ahh... That explains it.. Reserved opcodes from the last one.

 

My hex counting must've missed them when checking through the CLEO 3 opcodes tounge.gif

 

 

Glad I got to the bottom of that... I'm currently finding out how the hell all these text formatting things work... They seem to work in some cases and crash in others :s

Share this post


Link to post
Share on other sites
DexX

Maybe i've missed them, or they simply don't exist, but some opcodes to retrieve the relative coordinates/angle of an arbitrary vehicle "bone" would be nice. something like this;

 

xxxx: get_vehicle_component_position "wing_rf_dummy" to x y z

xxxx: get_vehicle_component_angle "wing_rf_dummy" to w

xxxx: set_vehicle_component_position "wing_rf_dummy" from x y z

xxxx: set_vehicle_component_angle "wing_rf_dummy" from w

 

The key here is the "wing_rf_dummy" string, so instead of working with the predefined vehicle pieces, you could work with any object on the model, so long as you know its name. For vehicles with guns, that may have a "barrel_dummy" or some such, this would be invaluable. Honestly, it would be handy for any opcode that involves attaching stuff (peds, objects, etc) to a vehicle, since most of the guesswork behind the coordinates would be gone.

Share this post


Link to post
Share on other sites
Deji

Yeah... I wanted that for peds bones... There was a train wreck attempt to see if there was some sort of memory for it tounge.gif

 

Mostly

 

 

0000: get_actor_bone 11 {left foot} coords 1 angle 0 store_to [email protected] [email protected] [email protected] -1 -1 -1

 

 

And like... you can turn the angle flag to 1 to enable the last 3 parameters or something... Save variables.

 

 

Jeesh... Never thought I'd be online talking about what functions I want inside an external hook to modify a game while playing Guitar Hero 3...

 

 

 

I'm still having troubles using these to make a keyboard script... Most of my tries result in crashes and using the keypress address shows things backwards when adding it straight in... and only 1 character when reading and displaying via that method... Even though I read 4 bytes? Lowering it to 1 byte makes weird symbols appear... Reading 2 x 4 bytes still just shows 1 key...

 

I'm thinking it was easier doing it the good ol fashioned thread memory way... Hopefully some peoples post examples of these things and I can learn the same way I learnt everything else... The help file doesn't explain much to me turn.gif Although I am inaccurately translating things...

Edited by Deji

Share this post


Link to post
Share on other sites
NTAuthority
The key here is the "wing_rf_dummy" string, so instead of working with the predefined vehicle pieces, you could work with any object on the model, so long as you know its name. For vehicles with guns, that may have a "barrel_dummy" or some such, this would be invaluable. Honestly, it would be handy for any opcode that involves attaching stuff (peds, objects, etc) to a vehicle, since most of the guesswork behind the coordinates would be gone.

I don't even think that is possible. sad.gif Vehicles only have predetermined RwFrame pointers (fun fact: what's one thing on a car is the rotor on a heli! tounge.gif ) where the specific frames are placed in at model loading time... and I think any unknown frames are simply ignored by the game, or not stored in the CVehicle object.

 

Obviously, for default frames, a RwFrame has its own matrices so that this can be read. Hm, wait, now I'm looking through the RwFrame definition I find that RwFrame is actually a list structure with a root pointer. Now I have to resist trying to implement this...

Share this post


Link to post
Share on other sites
TheSiggi
CLEO 4 has 100 opcodes (+50 new comparing to CLEO 3), and some of the mentioned above ones are already implemented. tounge.gif

if

1337: mp3 [email protected] loaded

jf @test1

 

would be very useful inlove.gif

 

0AAC: 1q = load_mp3 "CLEO\playlist\01.mp3"wait 0if 8039: [email protected] == -1

 

Share this post


Link to post
Share on other sites
Deji

I'm pretty sure 0AAC is an IF/SET opcode:

 

 

:THREADwait 0if0AAC: 1q = load_mp3 "CLEO\playlist\01.mp3"else_jump @THREAD// MP3 LOADED

 

 

Simple as that...

Share this post


Link to post
Share on other sites
DexX

 

The key here is the "wing_rf_dummy" string, so instead of working with the predefined vehicle pieces, you could work with any object on the model, so long as you know its name. For vehicles with guns, that may have a "barrel_dummy" or some such, this would be invaluable. Honestly, it would be handy for any opcode that involves attaching stuff (peds, objects, etc) to a vehicle, since most of the guesswork behind the coordinates would be gone.

I don't even think that is possible. sad.gif Vehicles only have predetermined RwFrame pointers (fun fact: what's one thing on a car is the rotor on a heli! tounge.gif ) where the specific frames are placed in at model loading time... and I think any unknown frames are simply ignored by the game, or not stored in the CVehicle object.

 

Obviously, for default frames, a RwFrame has its own matrices so that this can be read. Hm, wait, now I'm looking through the RwFrame definition I find that RwFrame is actually a list structure with a root pointer. Now I have to resist trying to implement this...

For a specified entity, get the "model" (RpClump*).

Use the clump as the first argument and call RpClumpForAllAtomics, which will iterate through every atomic on the clump and apply the specified callback function to it (argument 2). Argument 3 is the user data, which in this case could be the string we wish to find.

 

On the current atomic, you can retrieve a pointer to its frame. The frame will contain some matrices (ltm and modeling, so you can get local coords, or worldspace coords, depending on which matrix you read) and the last bit of data will be string name for that frame, which R* extended. I have it marked as such;

 

 

struct rsframe{RwFrame frame;DWORD unk1;DWORD unk2;char framename[20];//this isn't a fixed amount?};

 

 

I used a different method to get the atomic, but i have successfully retrieved atomic names from them. The address for RpClumpForAllAtomics should be in the memory address topic (if not, i'll add it - 0x00749B70). Good luck trying not to implement it now tounge.gif

 

Edit; This is how i did it:

 

RwFrame* getframebyname(RpAtomic* atomic,char* namein){RwFrame* tempframe = RpAtomicGetFrame(atomic);//this is a RW macro - not a SA function!DWORD frameaddress = (DWORD)tempframe;//get address of framersframe* theframe = (rsframe*)frameaddress;char name[20];sprintf(name,"%s",theframe->framename);if(strcmp(name,namein) == 0){ //winnar! return tempframe;}return NULL;}

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • 2 Users Currently Viewing
    0 members, 0 Anonymous, 2 Guests

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.