Quantcast

Jump to content

» «
Photo

The Modders Lounge

299 replies to this topic
fireguy109
  • fireguy109

    It's a long way to the top

  • The Connection
  • Joined: 30 Aug 2010
  • United-States

#61

Posted 17 June 2012 - 03:24 AM Edited by fireguy109, 17 June 2012 - 03:35 AM.

You mean to just spin it around from a fixed point? I'm confused. That would basically be getting the current cam angle, using what Deji posted, and pointing the camera at the new spot. I coded one of these for a dash cam once.

If you use a set hypotenuse, say 100 units away, and rotate by a fixed degree, let's say 30, you can use trig functions and the Pythagorean theorem to get the coordinates, or even use cos to get Y instead of a²+b²=c²

Sin30=X/100 so X=Sin30*100
√(10000-(X*X))=Y

Then add X to your current x coordinate and Y to your current y coordinate, and point the camera at the resulting point.

        X
    ______
   |          /
   |         /
   |        /
   |       / 100
Y |      /
   |     /
   |30/
<player>

Each time you would take the current angle and add 30, running the script in a loop.

Hope this helps. Opcodes for all these functions work from III up. wink.gif

GTALibertyIII
  • GTALibertyIII

    Gaming Freak

  • BUSTED!
  • Joined: 15 Jun 2012

#62

Posted 17 June 2012 - 05:33 AM

QUOTE (DK22Pac @ Thursday, May 10 2012, 20:26)
Did you mean 0AA5?

Also:
Blips are small now, and have proportional width&height
user posted image

CODE

sascm.ini: 0AA5=-1,call %1d% num_params %2h% pop %3h%
Example: 0AA5: call $hPROC num_params 1 pop 1 $param


This might help you. Nice Radar. What is the other blip with the arrow?


Ashwin.Star
  • Ashwin.Star

    Back for Next ♪♫

  • Members
  • Joined: 14 Nov 2010
  • India

#63

Posted 17 June 2012 - 06:09 AM

It means i Have to Explain it
as you may (don't) know my latest Mod is Rhino the Tank
in Which i am trying to make the Rhino of VC better by adding different Features,
so, I want to make a Cannon Camera View in Second Attempt

I want the Camera to be rotate with Cannon so that at whatever angle we rotate the Cannon,
it will remain at Canter of the screen, like in Battlefield 2
I have the Address of the Rotation of Cannon but not for its Coords
otherwise only "Point camera at" opcode was enough

Ashwin.Star
  • Ashwin.Star

    Back for Next ♪♫

  • Members
  • Joined: 14 Nov 2010
  • India

#64

Posted 17 June 2012 - 08:22 AM

Here is Something Funny that i found,

0xA10B6B - [byte] - game hour
0xA10B92 - [byte] - game minute

if you put the Value more then they should have (ex: 42 to hrs or 152 to minutes)
Then you will see Some New Wether effects
which you may use to show something Wired like Nightmares, HELL, etc
it's really Funny

aStiffSausage
  • aStiffSausage

    Formerly Oksu

  • Members
  • Joined: 30 Sep 2010
  • Finland

#65

Posted 17 June 2012 - 09:48 AM

Is it possible to get current weapons ammo in clip, and weapon icon so you can draw it on screen?

_DK
  • _DK

    Where I Know You From

  • Feroci Racing
  • Joined: 12 Apr 2009
  • Ukraine

#66

Posted 17 June 2012 - 09:51 AM

If you want to see really funny stuff, here you go:
CODE
flt_C81340

I think R* wanted to make cheat for stuff like this.
CODE
if ( flt_C81340 > 0.0 )
 {
   v148 = flt_C81340;
   *&v147 = -flt_C81340;
   angle = (rand() * 0.000030518509 * (flt_C81340 - *&v147) + *&v147) * 0.0024999999;
   v80 = RpHAnimIDGetIndex(v32, BONE_LEFTKNEE);
   v81 = ((v80 << 6) + RpHAnimHierarchyGetMatrixArray(v32));
   _angle = angle;
   RwMatrixRotate(v81, &axisZ, angle, 2);
   v83 = RpHAnimIDGetIndex(v32, BONE_RIGHTKNEE);
   v84 = RpHAnimHierarchyGetMatrixArray(v32);
   RwMatrixRotate(((v83 << 6) + v84), &axisZ, _angle, 2);
   // ... and some other bones

Bad.boy!
  • Bad.boy!

    SA modder

  • Feroci Racing
  • Joined: 20 Jun 2010
  • None

#67

Posted 17 June 2012 - 11:05 AM

QUOTE (oksa8 @ Sunday, Jun 17 2012, 11:48)
Is it possible to get current weapons ammo in clip, and weapon icon so you can draw it on screen?

For the ammo:
CODE
:GETAMMO
// Get the actors struct
0A96: 1@ = actor $3 struct

// Get the address of the current weapon slot
000A: 1@ += 0x718

// Read the address
0A8D: 2@ = read_memory 1@ size 1 virtual_protect 0

// Get the actors struct
0A96: 1@ = actor $3 struct

// Get the address of the start of the weapon data
1@ += 0x5A0

// There are 28 bytes so x28 (0x1C)
2@ *= 0x1C

// Get the address of the current weapon??? (just do this)
005A: 1@ += 2@

// Get the address of the ammo in clip
1@ += 0x8

// Read the address
0A8D: 2@ = read_memory 1@ size 4 virtual_protect 0


You can get the current weapon and load the icon from a txd.

aStiffSausage
  • aStiffSausage

    Formerly Oksu

  • Members
  • Joined: 30 Sep 2010
  • Finland

#68

Posted 17 June 2012 - 11:18 AM Edited by oksa8, 17 June 2012 - 11:20 AM.

@Bad.boy!

Thanks! -EDIT- Ahh nothing...

Ashwin.Star
  • Ashwin.Star

    Back for Next ♪♫

  • Members
  • Joined: 14 Nov 2010
  • India

#69

Posted 17 June 2012 - 11:22 AM

Its look like you are making a New Hud for SA,
am i right O8 ?

KaRzY6
  • KaRzY6

    ♧ Sick Kunt ♤

  • Members
  • Joined: 24 Oct 2011

#70

Posted 17 June 2012 - 11:25 AM

QUOTE (DK22Pac @ Friday, May 11 2012, 07:26)
Did you mean 0AA5?

Also:
Blips are small now, and have proportional width&height
user posted image

That's an awesome radar, how do I get it. I have that mod IV_HUD for my SA.

Ashwin.Star
  • Ashwin.Star

    Back for Next ♪♫

  • Members
  • Joined: 14 Nov 2010
  • India

#71

Posted 17 June 2012 - 11:28 AM

@KaRzY6
By ThrteenAge ??

aStiffSausage
  • aStiffSausage

    Formerly Oksu

  • Members
  • Joined: 30 Sep 2010
  • Finland

#72

Posted 17 June 2012 - 11:32 AM

QUOTE (Ashwin the new boy @ Sunday, Jun 17 2012, 14:22)
Its look like you are making a New Hud for SA,
am i right O8 ?

Yeah, but I should've done it few months before DK22Pac started his IV-HUD, I guess mine is going to be in the shades after he releases it... biggrin.gif

KaRzY6
  • KaRzY6

    ♧ Sick Kunt ♤

  • Members
  • Joined: 24 Oct 2011

#73

Posted 17 June 2012 - 11:35 AM

QUOTE (Ashwin the new boy @ Sunday, Jun 17 2012, 22:28)
@KaRzY6
By ThrteenAge ??

What's that? I'm sorry, I know nothing about modding. Haha smile.gif

_DK
  • _DK

    Where I Know You From

  • Feroci Racing
  • Joined: 12 Apr 2009
  • Ukraine

#74

Posted 17 June 2012 - 12:08 PM

@oksa8
If you need anything related to texture drawing, I could give you my "devkit" xD.

aStiffSausage
  • aStiffSausage

    Formerly Oksu

  • Members
  • Joined: 30 Sep 2010
  • Finland

#75

Posted 17 June 2012 - 12:25 PM

QUOTE (DK22Pac @ Sunday, Jun 17 2012, 15:08)
@oksa8
If you need anything related to texture drawing, I could give you my "devkit" xD.

Why not! monocle.gif

Basically I'll only need a code snippet to allow me to draw current weapon icon, without needing to load each .txd-file and get the icon from there.

Cosmic Gypsy
  • Cosmic Gypsy

    It's time for a trip

  • Members
  • Joined: 26 Oct 2011
  • United-Kingdom

#76

Posted 17 June 2012 - 01:05 PM

Is it possible to stop gang invasions from happening in SA? And is it possible to get rid of the police presence in gang areas of LS? Maybe even making it so you do not get stars in these areas?

Lastly, is it possible to make it so i can kill more than 3 enemy gang members in their turf without triggering a gang war, i have my turf set up just the way i like it and would like to keep it on my save game.

fireguy109
  • fireguy109

    It's a long way to the top

  • The Connection
  • Joined: 30 Aug 2010
  • United-States

#77

Posted 17 June 2012 - 02:29 PM

QUOTE (Ashwin the new boy @ Sunday, Jun 17 2012, 01:09)
It means i Have to Explain it
as you may (don't) know my latest Mod is Rhino the Tank
in Which i am trying to make the Rhino of VC better by adding different Features,
so, I want to make a Cannon Camera View in Second Attempt

I want the Camera to be rotate with Cannon so that at whatever angle we rotate the Cannon,
it will remain at Canter of the screen, like in Battlefield 2
I have the Address of the Rotation of Cannon but not for its Coords
otherwise only "Point camera at" opcode was enough

If you use the code I gave you then you can just use the current z angle of the turret instead of where I used 30 in the example. Just put the camera on the car first, or maybe even use the opposite of the z angle (z+180) and a hypotenuse of 5 units to always have the camera placement 5 units behind the turret and pointing 100 units away from it.

aStiffSausage
  • aStiffSausage

    Formerly Oksu

  • Members
  • Joined: 30 Sep 2010
  • Finland

#78

Posted 18 June 2012 - 07:01 PM Edited by oksa8, 18 June 2012 - 10:55 PM.

@Cosmic Gypsy

Not sure about gang invasions, I guess it should be possible. About cops, try editing popcycle, part GANGLANDS or similar, and no stars in gang areas... Basic idea here:
CODE

Get current max wanted
Get current area/zone
if
Gang zone = current zone
else set max wanted to value from "Current max wanted"
then set max wanted to 0


Hope you understood, if you can't manage with it, I can help, just create a topic or PM me. smile.gif


@Others

So, one more question, is it possible to check if current vehicle has specific handling-flag, or model-flag, and then change the top speed of CURRENT vehicle, and only the one player is driving? For example, if Elegy has flag HYDRAULIC_GEOM set on, then top speed would be 100 instead of 200, but it only affects players vehicle?

EDIT:
@fastman92

Good to know, I'll check the script tomorrow and see if it'll help. smile.gif

fastman92
  • fastman92

    фастман92 | ف

  • Members
  • Joined: 28 Jul 2009
  • None

#79

Posted 18 June 2012 - 09:39 PM

QUOTE (oksa8 @ Monday, Jun 18 2012, 20:01)
@Cosmic Gypsy

Not sure about gang invasions, I guess it should be possible. About cops, try editing popcycle, part GANGLANDS or similar, and no stars in gang areas... Basic idea here:
CODE

Get current max wanted
Get current area/zone
if
Gang zone = current zone
else set max wanted to value from "Current max wanted"
then set max wanted to 0


Hope you understood, if you can't manage with it, I can help, just create a topic or PM me. smile.gif


@Others

So, one more question, is it possible to check if current vehicle has specific handling-flag, or model-flag, and then change the top speed of CURRENT vehicle, and only the one player is driving? For example, if Elegy has flag HYDRAULIC_GEOM set on, then top speed would be 100 instead of 200, but it only affects players vehicle?

Yes, I created functions for this and they are included with my script GTA IV Window crash. See functions/ some file with handling part of name.
I'll reply tommorow again.

aStiffSausage
  • aStiffSausage

    Formerly Oksu

  • Members
  • Joined: 30 Sep 2010
  • Finland

#80

Posted 20 June 2012 - 10:43 AM

@fastman92

The handling-thingy isn't actually so important, would be just nice little detail in the game for people who like customized handlings on custom cars. biggrin.gif

And well, anybody here know a way to get the wanted-star in fonts.txd? Does it require some special character for it to be drawn?

Silent
  • Silent

    Moderating Cookie Monster

  • Feroci Racing
  • Joined: 01 Feb 2010
  • Poland
  • Most Helpful [GTA] 2013
    Most Helpful [Modding] 2013
    Most Talented [Modding] 2013
    Best Map 2013 "ViceCityStories PC Edition"
    Best Vehicle 2013 "III Aircraft"
    Most Helpful [Modding] 2012
    Modder of the Year 2012

#81

Posted 20 June 2012 - 02:41 PM

It uses ] sign in Pricedown font. So just select font ID 0 and use ].

_DK
  • _DK

    Where I Know You From

  • Feroci Racing
  • Joined: 12 Apr 2009
  • Ukraine

#82

Posted 21 June 2012 - 10:56 PM

Wanted to show you copmarkers script, was done 2 weeks ago.
link

Wesser
  • Wesser

    The complexity simplifier, the efficiency optimizer.

  • Feroci Racing
  • Joined: 19 Aug 2006
  • Unknown

#83

Posted 22 June 2012 - 06:58 PM

Why do you show your codes that cannot even be decompiled due to missing include files and/or new third party opcodes? tounge.gif

_DK
  • _DK

    Where I Know You From

  • Feroci Racing
  • Joined: 12 Apr 2009
  • Ukraine

#84

Posted 22 June 2012 - 07:17 PM

I'm planning to release these opcodes soon here.
And for include files, you can find them here. "Begin" file contain timers re-setting.

_DK
  • _DK

    Where I Know You From

  • Feroci Racing
  • Joined: 12 Apr 2009
  • Ukraine

#85

Posted 27 June 2012 - 03:01 PM Edited by DK22Pac, 27 June 2012 - 03:08 PM.

Some unused SA functions:
CODE
0AA6: call_method 0x73A8D0 struct 0@ num_params 2 pop 0 6@ 5@

Creates a laser dot for weapon.
CODE
0AA5: call 0x7233F0 num_params 1 pop 1 0@

Creates a blur streak for player's weapon (remember katana in Vice City).
!Notice it looks weird in SA
CODE
{$CLEO}
0AC7: 5@ = var 1@ offset
0AC7: 6@ = var 4@ offset
while true
   wait 0
   if
       player.Defined(0)
   then
       0470: 0@ = actor $3 current_weapon
       if and
           00E1: player 0 pressed_key 6 // stdc: KEY_AIMWEAPON
           0@ == 34 // stdc: WEAPON_SNIPER
       then
           0A96: 0@ = actor $3 struct
           0@ += 0x648
           0AA6: call_method 0x73A8D0 struct 0@ num_params 2 pop 0 6@ 5@
       else
           if or
               0@ == 2 // stdc: WEAPON_GOLFCLUB
               0@ == 5 // stdc: WEAPON_BAT
               0@ == 8 // stdc: WEAPON_KATANA
           then
               0AA5: call 0x7233F0 num_params 1 pop 1 0@
           end
       end
   end
end

aStiffSausage
  • aStiffSausage

    Formerly Oksu

  • Members
  • Joined: 30 Sep 2010
  • Finland

#86

Posted 02 July 2012 - 11:22 AM Edited by oksa8, 02 July 2012 - 11:24 AM.

@DK22Pac

Had to try the katana-blur "fix", I guess R* never decided to use it as the blur seems to create another katana, the blurred one, which is pretty much just a stick which leaves temporary copys of itself, making it look stupid while walking etc.


Aaaaand, quick question, can I run several NewOpcodes.CLEO, and if yes, then how? Just rename them or what?

fireguy109
  • fireguy109

    It's a long way to the top

  • The Connection
  • Joined: 30 Aug 2010
  • United-States

#87

Posted 03 July 2012 - 08:52 PM

Anybody know an opcode to put the camera on an object? Similar to 0158 but for spawned objects instead of cars/peds. smile.gif

_DK
  • _DK

    Where I Know You From

  • Feroci Racing
  • Joined: 12 Apr 2009
  • Ukraine

#88

Posted 03 July 2012 - 10:56 PM Edited by DK22Pac, 03 July 2012 - 11:06 PM.

QUOTE (oksa8 @ Monday, Jul 2 2012, 14:52)
@DK22Pac

Had to try the katana-blur "fix", I guess R* never decided to use it as the blur seems to create another katana, the blurred one, which is pretty much just a stick which leaves temporary copys of itself, making it look stupid while walking etc.


Aaaaand, quick question, can I run several NewOpcodes.CLEO, and if yes, then how? Just rename them or what?

No.

I added opcode to draw non-permanent searchlight
user posted image

user posted image

Bad.boy!
  • Bad.boy!

    SA modder

  • Feroci Racing
  • Joined: 20 Jun 2010
  • None

#89

Posted 30 July 2012 - 02:56 PM

Anyone know a tool I could make for SA? I'm bored and want to practise some C++.
And this is an official topic revive tounge.gif

Michael-Knight1
  • Michael-Knight1

    Never Give UP

  • Members
  • Joined: 08 Jul 2012

#90

Posted 30 July 2012 - 04:43 PM Edited by Michael-Knight1, 30 July 2012 - 04:52 PM.

QUOTE (Bad.boy! @ Monday, Jul 30 2012, 14:56)
Anyone know a tool I could make for SA? I'm bored and want to practise some C++.
And this is an official topic revive tounge.gif


Make A Screen Seeting as on resident evil 4 , i make a one but he doesn't work because i don't knew much about c++ programming , I still Learning it and this program is just an test wink.gif

user posted image

About Screen Seeting : Program able to :

- change the windows mode between : ( window or full screen )
- can Toggle enable or disable the widescreen mode
- can change the window size mode as 800 x 600 or 1024 x 768 , etc ...




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users