Jump to content

Scale Object


stef538

Recommended Posts

Hey guys,

 

I was wondering if it was possible to scale a object.

This is what i already have :

 

SApple = World.CreateObject("cj_proc_brick", Player.Character.CurrentVehicle.Position);

Wait(1);

SApple.AttachToVehicle(Player.Character.CurrentVehicle, Vector3.RelativeFront * 4, Vector3.Zero);

Function.Call("SET_OBJECT_SCALE", SApple, 6.0 * (Player.Character.CurrentVehicle.Speed / 100));

 

Anyway, whatever i try, the object won't become bigger.

 

Does anyone have an idea ?

Link to comment
Share on other sites

LordOfTheBongs

look in the SCO scripts how it is used... it is used in the pool_game sco by all 3 episodes and it is used always right after 2 other properties are set... collision and visibility to false (which makes no sense but obviously they do for a reason)

 

sco code:

 

 

[code if (NOT (DOES_OBJECT_EXIST( l_U500 )))
{
CREATE_OBJECT( -809347846, l_U459[0]._fU0._fU0, l_U459[0]._fU0._fU4, l_U459[0]._fU0._fU8, ref l_U500, 1 );
ADD_OBJECT_TO_INTERIOR_ROOM_BY_KEY( l_U500, l_U239 );
SET_OBJECT_COLLISION( l_U500, 0 );
SET_OBJECT_VISIBLE( l_U500, 0 );
SET_OBJECT_SCALE( l_U500, l_U529 );
}[/code]

 

l_U500 is the object by the way and l_U529 is the scale value
so whenever r* uses the native they make the object invisible and have no collision, kinda odd but im thinking the native doesnt work in the way the name describes
try not attaching to the vehicle and testing
Link to comment
Share on other sites

Can you try:

 

bool scaled = Function.Call<bool>("SET_OBJECT_SCALE", SApple, .5f);

 

And tell me the visual result and the scaled property state?


They remove collisions because the scaling applies visually only so the object will keep their boundaries.

Link to comment
Share on other sites

Can you try:

 

bool scaled = Function.Call<bool>("SET_OBJECT_SCALE", SApple, .5f);

 

And tell me the visual result and the scaled property state?

 

They remove collisions because the scaling applies visually only so the object will keep their boundaries.

Trying Now!

 

EDIT

 

It's not working, it says : "Object reference is not set to instance of an object" :/

Edited by stef538
Link to comment
Share on other sites

Reference not set to an instance of an object, assuming this is because of SApple, then that object was not created in game.

Link to comment
Share on other sites

Fixed that issue by deleting the . before the 5f, anyway no matter what i try, it is still not working..

Link to comment
Share on other sites

'5f' is 10 orders of magnitude bigger than '.5f'. '.5f' is the same as '0.5f'.

 

Let get home and I will take a try at this.

Link to comment
Share on other sites

LordOfTheBongs

did u ever try spawning this object to see what r* is doing...

 

CREATE_OBJECT( -809347846, l_U459[0]._fU0._fU0, l_U459[0]._fU0._fU4, l_U459[0]._fU0._fU8, ref l_U500, 1 );

 

the hash for the model is odd because ive never noticed any being a negative number

Edited by LordOfTheBongs
Link to comment
Share on other sites

Well, let me try (:

EDIT

Nope.. Nothing..

Edited by stef538
Link to comment
Share on other sites

LordOfTheBongs

yeah it seems like that native might never get used in game even though it is in the sco code, like u saw yourself the hash spawns nothing.

 

Maybe this was some kind of test code that never got implemented... well if i were you i wouldnt spend too much more time on it, might make u crazy lol

Link to comment
Share on other sites

Hi, the int -809347846 is a "ghostball" object model and was used as a kind of coord/move helper (player was attached to it) in pool_game.sco & ambsavebed.sco...

eModel = EC_NF_ghostball unsigned int => 3485619450 => 0xCFC254FA

Unfortunately the SET_OBJECT_SCALE native has no effect :cry:

I've tested dozens of objects with/without collision, visibility, freeze, proof... but nothing happens. I was pissed off because GTA SA has a similar opcode and it was funny to use it.

  • Like 2
Link to comment
Share on other sites

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.