Jump to content

[CLEO4]NewOpcodes by DK22Pac


Recommended Posts

  • 1 month later...

An update is coming... Soon...

Audio

 

0DXX: HMP3EFFECT = set_audiostream HMP3 effect AUDIOSTREAMEFFECT_ECHO

 

with default BASS effects

 

AUDIOSTREAMEFFECT_CHORUSAUDIOSTREAMEFFECT_COMPRESSORAUDIOSTREAMEFFECT_DISTORTIONAUDIOSTREAMEFFECT_ECHOAUDIOSTREAMEFFECT_FLANGERAUDIOSTREAMEFFECT_GARGLEAUDIOSTREAMEFFECT_I3DL2REVERBAUDIOSTREAMEFFECT_PARAMEQAUDIOSTREAMEFFECT_REVERB

 

 

0DXX: set_audiostream HMP3 position_time 30.0

 

Already did these things on CLEO (for a quick test tounge.gif )

Drawing

 

0DXX: print "Hello, world!" at 20.0 20.0 scale 1.0 1.0 font FONT_GOTHIC color 255 255 255 255 // basic version

 

Update uploaded.

D/L

Added opcodes:

 

0D64: 0@ = load_texture_png_from "image.png" // IF and SET

 

 

0D65: print "Hello, world" at 50.0 50.0 scale 1.0 1.0 style FONT_GOTHIC

 

 

0D66: print "Hello, world" at 50.0 50.0 scale 1.0 1.0 style FONT_GOTHIC prop TRUE align ALIGN_LEFT wrap 600.0 justify FALSE color 255 255 255 255 outline 0 shadow 0 dropColor 0 0 0 0 background FALSE backColor 0 0 0 0

 

 

0D67: set_audiostream 0@ position_time 30.0

 

 

0D68: 1@ = get_audiostream 0@ position_time

 

 

0D69: 1@ = set_audiostream 0@ effect AUDIOSTREAMEFFECT_ECHO priority 0

 

 

0D6A: remove_audiostream 0@ effect 1@

 

 

0D6B: set_audiostream_effect 0@ parameters_from_buf 1@

 

 

0D6C: get_audiostream_effect 0@ parameters_to_buf 1@

 

 

0D6D: reset_audiostream_effect 0@

 

 

0D6E: set_audiostream 0@ attribute AUDIOSTREAMATTR_PAN to -1.0

 

 

0D6F: 1@ = get_audiostream 0@ attribute AUDIOSTREAMATTR_PAN

 

 

0D70: set_3d_audiostream 0@ _3d_attributes_mode 3DAUDIOSTREAM3DMODE_NORMAL min -1.0 max -1.0 iangle -1 oangle -1 outvol -1.0

 

 

0D71: get_3d_audiostream 0@ _3d_attributes_mode_to 1@ min_to 2@ max_to 3@ iangle_to NULL oangle_to NULL outvol_to NULL

 

 

0D72: get_sfx_volume_to 0@ radio_volume_to NULL type TYPE_FLOAT

 

 

0D73: get_screen_width_to 0@ height_to 1@ type TYPE_FLOAT

 

Info added into help files.

  • Like 1
TheGodfather.

Well done icon14.gif You are just amazing dude..

Going to try it out..wink.gif

 

EDIT: I tried it this one is just awesome (Previous version didn't worked for me) although I was really waiting for this opcode:

 

 

0D72: get_sfx_volume_to 0@ radio_volume_to NULL type TYPE_FLOAT

 

 

 

Thanks a lot..Great & amazing work..cookie.gifcookie.gificon14.gif

 

Edited by arijitsen
  • 3 months later...
  • 4 weeks later...
  • 1 month later...
  • 4 months later...

I'm planning to release fixed/improved version of newOpcodes (possibly it will be depended on plugin sdk).

Possibly some new opcodes will be added. If you have any ideas - post them here.

Idea: maybe convert this function to an opcode that would look something like this:

0000: get_collision_point to 7@ 8@ 9@ from_origin 1@ 2@ 3@ to_target 4@ 5@ 6@ entity_to 0@ with_params 0 0 0 0 1 1 1 1 
0AA7: call_function 0x0056BA00 num_params 12 pop 12 bIgnoreShootThroughStuff false bIgnoreSomeObjectsForCamera false bIgnoreSeeThroughStuff false bParticle false bObject true bPed true bVehicle true bBuilding true pclEntity 4@ pclPoint 3@ pstTarget 2@ pstOrigin 1@ bReturn 5

or maybe more "actor 0@ kill actor 1@" opcodes similar to those from VC. There's only 1 for SA.

There are 3 opcodes in SA for this (CTaskComplexKillPedOnFootTask):

 

05E2: AS_actor 65@ kill_actor 50@07A5: AS_actor -1 attack_actor $PLAYER_ACTOR time 1500 // same as above but timed0634: AS_actor 67@ attack_using_weapon_actor 50@ flags 4 perform_actions_after_time 2000 chance_of_action 100 // same as above but with additional parameters (mostly used for armed peds)

Idea: maybe convert this function to an opcode that would look something like this:

This one is already done.

 

0D3A=20,get_collision_between_points %1d% %2d% %3d% and %4d% %5d% %6d% flags %7d% %8d% %9d% %10d% %11d% %12d% %13d% %14d% ignore_entity %15d% store_point_to %17d% %18d% %19d% entity_to %20d% colpoint_data_to %16d% // IF and SET
Edited by _DK

@Ss4gogeta0 Nope ;)

 

u sure? cuz I sent Silent this (cant remember where I found it in the GTA SA files....)

 

Weapon defines#define WEAPON_BRASSKNUCKLE                (1)#define WEAPON_GOLFCLUB                    (2)#define WEAPON_NITESTICK                (3)#define WEAPON_KNIFE                    (4)#define WEAPON_BAT                        (5)#define WEAPON_SHOVEL                    (6)#define WEAPON_POOLSTICK                (7)#define WEAPON_KATANA                    (8)#define WEAPON_CHAINSAW                    (9)#define WEAPON_DILDO                    (10)#define WEAPON_DILDO2                    (11)#define WEAPON_VIBRATOR                    (12)#define WEAPON_VIBRATOR2                (13)#define WEAPON_FLOWER                    (14)#define WEAPON_CANE                        (15)#define WEAPON_GRENADE                    (16)#define WEAPON_TEARGAS                    (17)#define WEAPON_MOLTOV                    (18)#define WEAPON_COLT45                    (22)#define WEAPON_SILENCED                    (23)#define WEAPON_DEAGLE                    (24)#define WEAPON_SHOTGUN                    (25)#define WEAPON_SAWEDOFF                    (26)#define WEAPON_SHOTGSPA                    (27)#define WEAPON_UZI                        (28)#define WEAPON_MP5                        (29)#define WEAPON_AK47                        (30)#define WEAPON_M4                        (31)#define WEAPON_TEC9                        (32)#define WEAPON_RIFLE                    (33)#define WEAPON_SNIPER                    (34)#define WEAPON_ROCKETLAUNCHER            (35)#define WEAPON_HEATSEEKER                (36)#define WEAPON_FLAMETHROWER                (37)#define WEAPON_MINIGUN                    (38)#define WEAPON_SATCHEL                    (39)#define WEAPON_BOMB                        (40)#define WEAPON_SPRAYCAN                    (41)#define WEAPON_FIREEXTINGUISHER            (42)#define WEAPON_CAMERA                    (43)#define WEAPON_PARACHUTE                (46)#define WEAPON_VEHICLE                    (49)#define WEAPON_DROWN                    (53)#define WEAPON_COLLISION                (54

seems it would be possible to define something

u sure? cuz I sent Silent this (cant remember where I found it in the GTA SA files....)

Yeah, it would NOT be possible via SCM.

After doing some testing, it would appear that REAR_LIGHT_LEFT controls both rear lights, while REAR_LIGHT_RIGHT does nothing. So, if you set LEFT to damaged or default, it affects both lights. While RIGHT will do nothing at all.

After doing some testing, it would appear that REAR_LIGHT_LEFT controls both rear lights, while REAR_LIGHT_RIGHT does nothing. So, if you set LEFT to damaged or default, it affects both lights. While RIGHT will do nothing at all.

It's a SA bug fixed in MTA. I bet DK22 fixed it in ImVehFt.

  • 2 weeks later...

Well,I think this would be an appropriate place to post what I am having trouble with.

 

I am trying to achieve what _DK had done in his first posts,apply the brick texture on the player's vehicle.

I altered the code a bit by using an other .bmp texture,removing some un-needed opcodes and adding a condition and a result.

When I am in game,I can see the .bmp I'm using on my hud in a square and round shape.

When any car is destroyed,the opcode that paints the car white worked,but the texture apply didn't work,I also have tried removing the car recoloring opcode,but the car didn't have any change.

Here's the code:

{$CLEO}{$I stdc}0D61: t = load_texture_from "test.bmp" with_mask NULL // IF and SET{$I CLEO\inloop}   0AB1: call_scm_function @drawTexturedCircle params 13 pos_x 250.0 pos_y 250.0 radius 150.0 step 6.0 texture t priority PRIORITY_OVER_HUD color_RGBA 255 255 255 255 angle -45.0 invert_x false invert_y false   0AB1: call_scm_function @drawTexturedQuad params 11 pos_x 450.0 pos_y 100.0 size 300.0 texture t priority PRIORITY_OVER_HUD color_RGBA 255 255 255 255 invert_x false invert_y false   {$I CLEO\forallcars}    if    0119: is_car_dead veh     then    0D62: set_car veh remap_texture t    0D63: set_car veh color ALL_COLORS RGB 255 255 255    end   {$I CLEO\for_end}{$I CLEO\end}{$I CLEO\drawtexturedcircle.scmf}{$I CLEO\drawtexturedquad.scmf}

help?

Edited by Danikov
aStiffSausage

I think the problem is not the script or texture itself, but the mapping of vehicle. From my understanding, opcode 0D62 works kind of like paintjobs do, but with custom textures. If your vehicle isn't made to support paintjobs, the car will be just white. To be sure, try your script with a vehicle that supports paintjob. (Elegy, Sultan or similar)

I'll be damned,you are right,only vehicles that can have paintjobs applied to them can be affected of this script.

 

I saw somewhere that you can apply up to 3 paintjobs for each vehicle by adding more .txd s to the gta3.img,for example(flash1.txd , flash2.txd , flash3.txd),I think I'll actually test it and report the results if it changes anything.

 

EDIT : Well,I guess I was hoping for too much,it didn't work.

Edited by Danikov
aStiffSausage

I don't remember the limit on how many paintjobs you can add to one vehicle, I think it was 9? (flash1.txd, flash2.txd and so on until flash9.txd) Tuning garages only allow you to buy four of those though.

If you want a car to be able to have paintjobs, you need to edit the model, bravura.dff for example. I don't know how to do so, but that would be one way of achieving what you're after. Though, most car mods do not have paintjobs, so you'd be screwed with those. :p

It's four paintjobs per vehicle.

Edited by SilentPL
aStiffSausage

It's four paintjobs per vehicle.

What about this plane with more than four paintjobs working? :p

 

The game itself supports more than four paintjobs per vehicle, but tuning garages don't allow you to buy more than that.

Edited by aStiffSausage

 

It's four paintjobs per vehicle.

What about this plane with more than four paintjobs working? :p

 

The game itself supports more than four paintjobs per vehicle, but tuning garages don't allow you to buy more than that.

 

I don't know but there's a function

 

void __thiscall asignTXDofPaintjobToVehicle(CVehicleModelInfo *this, __int16 TXD_index){  signed int i; // eax@1  WORD *v3; // edx@1  v3 = (WORD *)((char *)this + 762);  i = 0;  if ( *((_WORD *)this + 381) != -1 )  {    do    {      if ( i >= 4 )        break;      ++v3;      ++i;    }    while ( *v3 != -1 );  }  *((_WORD *)this + i + 381) = TXD_index;}
      if ( i >= 4 )        break;
From code i understand that a limit is five paintjobs, when there are more paintjobs, always the last one (fifth) will be overwritten. Edited by fastman92

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

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