Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,574 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
vec_set simple question #155624
09/20/07 11:36
09/20/07 11:36
Joined: Jan 2002
Posts: 300
Usa
Rich Offline OP
Senior Member
Rich  Offline OP
Senior Member

Joined: Jan 2002
Posts: 300
Usa
Hi,

I have a quick question. A little rusty on my scripting, not to mention I'm not that good at it anyway.

Is there a reason why this doesn't work:

vec_set(vector(my.scale_x, my.scale_y, my.scale_z),vector(0.5 ,0.5 ,0.5 ) );

But this does?:

vec_set(my.scale_x,vector(0.5 ,0.5 ,0.5 ) );

It does not error, it just doesn't do anything...

I posted in this section because I am using Lite-C, not C-script, I don't know if it works in C-script. Sorry if it is out of place.

Thanks.

Re: vec_set simple question [Re: Rich] #155625
09/20/07 12:17
09/20/07 12:17
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline

Programmer
Lukas  Offline

Programmer

Joined: May 2007
Posts: 2,043
Germany
vector(my.scale_x, my.scale_y, my.scale_z)
This creates a temporary vector wich will be deleteted after the command. If this vector is edited of course nothing will happen.


vec_set(my.scale_x,vector(0.5 ,0.5 ,0.5 ) );
This works because my.scale_x is a pointer to the my.scale_x,y,z-vector here.

Re: vec_set simple question [Re: Rich] #155626
09/20/07 12:19
09/20/07 12:19
Joined: Oct 2006
Posts: 873
S
Shadow969 Offline
User
Shadow969  Offline
User
S

Joined: Oct 2006
Posts: 873
vector() function creates a temporary vector, in your case containing entity scale values. so modifying it won't affect anything. The correct way is vec_set(my.scale_x,vector(0.5 ,0.5 ,0.5 )), it directly changes entity's scale.
PS i guess it belongs to C-script section

EDIT: Lukas was faster

Last edited by Shadow969; 09/20/07 12:23.

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1