Quantcast

Jump to content

» «
Photo

[CLEO4]NewOpcodes by DK22Pac

117 replies to this topic
DK22Pac
  • DK22Pac

  • Feroci
  • Joined: 12 Apr 2009
  • None
  • Best WIP Mod 2014 [Grand Theft Auto 3D Contribution]
    Contribution Award [Mods]

#31

Posted 17 December 2012 - 06:09 PM

Try with this one.
http://www.mediafire...v9ttu13dkukdoru

Bad.boy!
  • Bad.boy!

    SA modder

  • Feroci
  • Joined: 20 Jun 2010
  • Netherlands

#32

Posted 17 December 2012 - 07:44 PM

That one works, thanks.

DK22Pac
  • DK22Pac

  • Feroci
  • Joined: 12 Apr 2009
  • None
  • Best WIP Mod 2014 [Grand Theft Auto 3D Contribution]
    Contribution Award [Mods]

#33

Posted 20 January 2013 - 01:13 AM

An update is coming... Soon...
Audio
CODE
0DXX: HMP3EFFECT = set_audiostream HMP3 effect AUDIOSTREAMEFFECT_ECHO

with default BASS effects
CODE
AUDIOSTREAMEFFECT_CHORUS
AUDIOSTREAMEFFECT_COMPRESSOR
AUDIOSTREAMEFFECT_DISTORTION
AUDIOSTREAMEFFECT_ECHO
AUDIOSTREAMEFFECT_FLANGER
AUDIOSTREAMEFFECT_GARGLE
AUDIOSTREAMEFFECT_I3DL2REVERB
AUDIOSTREAMEFFECT_PARAMEQ
AUDIOSTREAMEFFECT_REVERB

CODE
0DXX: set_audiostream HMP3 position_time 30.0

Already did these things on CLEO (for a quick test tounge.gif )
Drawing
CODE
0DXX: print "Hello, world!" at 20.0 20.0 scale 1.0 1.0 font FONT_GOTHIC color 255 255 255 255 // basic version

TheGodfather.
  • TheGodfather.

    Nobody likes me here...I think...

  • Members
  • Joined: 19 Jun 2012

#34

Posted 20 January 2013 - 03:36 AM

That's pretty good news..Waiting for the update.. icon14.gif

DK22Pac
  • DK22Pac

  • Feroci
  • Joined: 12 Apr 2009
  • None
  • Best WIP Mod 2014 [Grand Theft Auto 3D Contribution]
    Contribution Award [Mods]

#35

Posted 22 January 2013 - 11:25 PM

Update uploaded.
D/L
Added opcodes:
CODE
0D64: 0@ = load_texture_png_from "image.png" // IF and SET

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

CODE
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

CODE
0D67: set_audiostream 0@ position_time 30.0

CODE
0D68: 1@ = get_audiostream 0@ position_time

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

CODE
0D6A: remove_audiostream 0@ effect 1@

CODE
0D6B: set_audiostream_effect 0@ parameters_from_buf 1@

CODE
0D6C: get_audiostream_effect 0@ parameters_to_buf 1@

CODE
0D6D: reset_audiostream_effect 0@

CODE
0D6E: set_audiostream 0@ attribute AUDIOSTREAMATTR_PAN to -1.0

CODE
0D6F: 1@ = get_audiostream 0@ attribute AUDIOSTREAMATTR_PAN

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

CODE
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

CODE
0D72: get_sfx_volume_to 0@ radio_volume_to NULL type TYPE_FLOAT

CODE
0D73: get_screen_width_to 0@ height_to 1@ type TYPE_FLOAT

Info added into help files.

TheGodfather.
  • TheGodfather.

    Nobody likes me here...I think...

  • Members
  • Joined: 19 Jun 2012

#36

Posted 23 January 2013 - 05:32 AM Edited by arijitsen, 23 January 2013 - 07:12 AM.

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:

CODE
0D72: get_sfx_volume_to 0@ radio_volume_to NULL type TYPE_FLOAT



Thanks a lot..Great & amazing work.. cookie.gif cookie.gif icon14.gif

Rafal22
  • Rafal22

    Player Hater

  • Members
  • Joined: 02 Jul 2011
  • Poland

#37

Posted 13 May 2013 - 01:41 PM

Hi, this could use some more destroy_texture to opcode
CODE
0D64: 5@ = load_texture_png_from 10@v
biggrin.gif

juarez
  • juarez

    Thx you

  • Members
  • Joined: 11 Jun 2011
  • Australia

#38

Posted 13 May 2013 - 02:07 PM Edited by juarez, 13 May 2013 - 02:13 PM.

I think you can destroy this texture using function:
CODE
.text:007F3820    ; int __cdecl RwTextureDestroy(RwTexture *texture)

Xzax
  • Xzax

    Player Hater

  • Members
  • Joined: 21 Feb 2010

#39

Posted 07 June 2013 - 06:43 PM

what is this newopcodes ? I downloaded a car mod, it tells me that I need this, how can I install this ?

MasterHK
  • MasterHK

    کیان حامی‏

  • Members
  • Joined: 20 Mar 2013
  • Iran

#40

Posted 15 July 2013 - 09:22 AM

I saw many versions of this mod in some mods.e.g. Izerli's ActiveDashBoard.
Is this (23.01.2013) last version?

DK22Pac
  • DK22Pac

  • Feroci
  • Joined: 12 Apr 2009
  • None
  • Best WIP Mod 2014 [Grand Theft Auto 3D Contribution]
    Contribution Award [Mods]

#41

Posted 10 December 2013 - 07:35 PM

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.

Jack
  • Jack

    firearms and adrenaline

  • Feroci
  • Joined: 06 Dec 2011
  • Colombia

#42

Posted 10 December 2013 - 07:58 PM

Some ideas:
0000: change_actor 0@ pedtype to 1@
0000: store actor 0@ pedtype to 1@
or maybe more "actor 0@ kill actor 1@" opcodes similar to those from VC. There's only 1 for SA. 

Silent
  • Silent

    Altering R* Vision™ since 2008

  • Modding Staff
  • Joined: 01 Feb 2010
  • Poland
  • Contribution Award [Mods]
    Best Script/Plugin 2014 [SilentPatch]
    Most Respected 2014
    Most Helpful [Mods] 2014
    Most Helpful [GTA] 2013
    Most Helpful [Mods] 2013
    Most Talented [Modding] 2013
    Best Map 2013 [ViceCityStories PC Edition]
    Best Vehicle 2013 [III Aircraft]
    Most Helpful [Mods] 2012
    Modder of the Year 2012

#43

Posted 10 December 2013 - 08:09 PM

Psst, there is GET_PED_TYPE :pp

jackusCTB
  • jackusCTB

    Peon

  • Members
  • Joined: 29 Jun 2012
  • Belgium

#44

Posted 10 December 2013 - 08:15 PM

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

Jack
  • Jack

    firearms and adrenaline

  • Feroci
  • Joined: 06 Dec 2011
  • Colombia

#45

Posted 10 December 2013 - 09:07 PM

Psst, there is GET_PED_TYPE :pp

Ooops 


DK22Pac
  • DK22Pac

  • Feroci
  • Joined: 12 Apr 2009
  • None
  • Best WIP Mod 2014 [Grand Theft Auto 3D Contribution]
    Contribution Award [Mods]

#46

Posted 10 December 2013 - 10:12 PM Edited by _DK, 10 December 2013 - 10:21 PM.

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 timed
0634: 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

Ss4gogeta0
  • Ss4gogeta0

    Independent modder

  • Members
  • Joined: 24 May 2011
  • Mexico

#47

Posted 14 December 2013 - 08:48 AM

anyway you can make an opcode to set a custom weapon ID # to weapons added using the "Weapon Limit Adjuster"?


DK22Pac
  • DK22Pac

  • Feroci
  • Joined: 12 Apr 2009
  • None
  • Best WIP Mod 2014 [Grand Theft Auto 3D Contribution]
    Contribution Award [Mods]

#48

Posted 14 December 2013 - 04:18 PM

@Ss4gogeta0 Nope ;)
Ok, looks like I'm rewriting it.
6mbh.th.png
  • Ss4gogeta0 likes this

Ss4gogeta0
  • Ss4gogeta0

    Independent modder

  • Members
  • Joined: 24 May 2011
  • Mexico

#49

Posted 15 December 2013 - 03:48 AM

@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 


Silent
  • Silent

    Altering R* Vision™ since 2008

  • Modding Staff
  • Joined: 01 Feb 2010
  • Poland
  • Contribution Award [Mods]
    Best Script/Plugin 2014 [SilentPatch]
    Most Respected 2014
    Most Helpful [Mods] 2014
    Most Helpful [GTA] 2013
    Most Helpful [Mods] 2013
    Most Talented [Modding] 2013
    Best Map 2013 [ViceCityStories PC Edition]
    Best Vehicle 2013 [III Aircraft]
    Most Helpful [Mods] 2012
    Modder of the Year 2012

#50

Posted 15 December 2013 - 10:32 AM

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.
  • Ss4gogeta0 likes this

DeLuca™
  • DeLuca™

    Coding Enthusiast

  • Members
  • Joined: 18 Jan 2012

#51

Posted 16 December 2013 - 01:28 AM

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.


Silent
  • Silent

    Altering R* Vision™ since 2008

  • Modding Staff
  • Joined: 01 Feb 2010
  • Poland
  • Contribution Award [Mods]
    Best Script/Plugin 2014 [SilentPatch]
    Most Respected 2014
    Most Helpful [Mods] 2014
    Most Helpful [GTA] 2013
    Most Helpful [Mods] 2013
    Most Talented [Modding] 2013
    Best Map 2013 [ViceCityStories PC Edition]
    Best Vehicle 2013 [III Aircraft]
    Most Helpful [Mods] 2012
    Modder of the Year 2012

#52

Posted 16 December 2013 - 03:24 PM

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.

Danikov
  • Danikov

    The Fake Russian

  • Members
  • Joined: 27 Aug 2009
  • Israel

#53

Posted 27 December 2013 - 03:54 PM Edited by Danikov, 27 December 2013 - 03:56 PM.

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?


aStiffSausage
  • aStiffSausage

    Formerly Oksu

  • Members
  • Joined: 30 Sep 2010
  • Finland

#54

Posted 27 December 2013 - 04:08 PM

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)


Danikov
  • Danikov

    The Fake Russian

  • Members
  • Joined: 27 Aug 2009
  • Israel

#55

Posted 27 December 2013 - 04:16 PM Edited by Danikov, 27 December 2013 - 04:24 PM.

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.


aStiffSausage
  • aStiffSausage

    Formerly Oksu

  • Members
  • Joined: 30 Sep 2010
  • Finland

#56

Posted 27 December 2013 - 04:47 PM

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


Silent
  • Silent

    Altering R* Vision™ since 2008

  • Modding Staff
  • Joined: 01 Feb 2010
  • Poland
  • Contribution Award [Mods]
    Best Script/Plugin 2014 [SilentPatch]
    Most Respected 2014
    Most Helpful [Mods] 2014
    Most Helpful [GTA] 2013
    Most Helpful [Mods] 2013
    Most Talented [Modding] 2013
    Best Map 2013 [ViceCityStories PC Edition]
    Best Vehicle 2013 [III Aircraft]
    Most Helpful [Mods] 2012
    Modder of the Year 2012

#57

Posted 27 December 2013 - 04:47 PM Edited by SilentPL, 27 December 2013 - 04:48 PM.

It's four paintjobs per vehicle.


aStiffSausage
  • aStiffSausage

    Formerly Oksu

  • Members
  • Joined: 30 Sep 2010
  • Finland

#58

Posted 27 December 2013 - 04:55 PM Edited by aStiffSausage, 27 December 2013 - 04:55 PM.

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.


Danikov
  • Danikov

    The Fake Russian

  • Members
  • Joined: 27 Aug 2009
  • Israel

#59

Posted 27 December 2013 - 05:06 PM

So if the model is modified to get paintjobed,the script would work on that specific vehicle?

fastman92
  • fastman92

    фастман92 | ف

  • Members
  • Joined: 28 Jul 2009
  • None
  • Contribution Award [Mods]

#60

Posted 27 December 2013 - 05:12 PM Edited by fastman92, 27 December 2013 - 05:18 PM.

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.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users