help with size.

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

User avatar
weirdone2
Forum Staff
Posts: 926
Joined: June 3rd, 2007, 8:03 pm

help with size.

Post by weirdone2 »

Hey I can't seem to figure out what is wrong with this I think it's the variable but I still can't figure it out any help is appreciated thx. All it does is keep setiing size to liek 0-1, having ant like peases is always funny for a lil but the fun is over fast enuf. :S

Code: Select all

local string s=GetEventPlayerChatString()
local string S=SubString(s,4,8)
elseif SubString(s,0,5)=="-size" then
call SetUnitScalePercent(u,(S2R(S)),(S2R(S)),(S2R(S)))
User avatar
Xantan
Honorary wc3edit.net Traitor
Posts: 2507
Joined: February 1st, 2007, 4:11 pm
Location: NEVADA

Re: help with size.

Post by Xantan »

s should be 6,20
User avatar
weirdone2
Forum Staff
Posts: 926
Joined: June 3rd, 2007, 8:03 pm

Re: help with size.

Post by weirdone2 »

Wow what the hell was I doing when I did this lolz, thx. XD
User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Re: help with size.

Post by Aero »

Code: Select all

//////Some function...
local string s=GetEventPlayerChatString()
local real r=S2R(SubString(s,6,9))*0.01
if then
/////////Do some action...
elseif then
/////////Do Some action...
elseif SubString(s,0,5)=="-size" then
call SetUnitScale(u,r,r,r)
endif
////////Endfunction....
This is correct syntax
USE NATIVES!
SetUnitScalePercent isn't a native ^.^

Are you triggering or modifying my cheatpack? (Or other)
User avatar
weirdone2
Forum Staff
Posts: 926
Joined: June 3rd, 2007, 8:03 pm

Re: help with size.

Post by weirdone2 »

Modding you cheatpack of cource I use your cheat pack for everything these days, though it has grown a bit. :P I still cant believe I didn't see the evilness of that 4,8. And i used percent because I thought other would jsut add, even thouh its scaling so ... it was just too early in morining for me I think. :S

BTW is their any significane to the variable you used [r] over my [S] besides the fact that it would be easyer to read?
User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Re: help with size.

Post by Aero »

There's no significance to changing the names of your variables but I use "x" and "y" for coordinates, "s" for strings, "r" for reals, "l" for locations, "i" for integer, "p" for players, "u" for units... ect.

Helps me wrap my head around what I'm doing.

Also, call as few function calls as possible

Code: Select all

local real r=S2R(SubString(s,6,9))*0.01
call SetUnitScale(u,r,r,r)
VS

Code: Select all

local string s=SubString(s,6,9)
call SetUnitScale(u,S2R(s)*0.01,S2R(s)*0.01,S2R(s)*0.01)
In #1, I avoid S2R twice as well as save myself some arithmatic (*0.01)