Page 1 of 1
Moving objects on the Z axis
Posted: Wed May 30, 2007 5:20 pm
by Whity
Hello im new in Pol and im a little confused. I tried to move a sign ob the Z axis but none oft the commands would work. Could someone explain me, why it doesnt work or is it just not implented Oo'
Greetings !
Posted: Wed May 30, 2007 7:14 pm
by Yukiko
Well, if you are using mpz the syntax is as follows:
mpz <amount_to_move> where amount_to_move is an integer. If amount_to_move is positive the item will move up (positive Z movement) the amount specified. If it is a negative integer the item will move down the specified amount.
Is that the command you used? If so did you specify an amount?
You can also use iteminfo and change the Z parameter in the gump but mpz is quicker.
Posted: Wed May 30, 2007 8:17 pm
by CWO
If you're talking about the function MoveObjectToLocation then you must put MOVEOBJECT_FORCELOCATION in the function. (if you're using .mpz, this is already in that command)
Posted: Thu May 31, 2007 1:11 am
by Whity
Hello again,
the problem isnt solved yet.
My testing object is a brass sign and im using the pol 097...
I tried what both of you said but all that won't work.
Code: Select all
use uo;
program textcmd_movez(who)
var what := Target(who, TGTOPT_NOCHECK_LOS);
if (!what)
return;
endif
var values:= Splitwords(RequestInput(who, who.backpack , "How much do you want to Change the coords?" ));
MoveObjectToLocation(what, what.x + CInt(values[1]) , what.y + CInt(values[2]) , what.z + CInt(values[3]) );
endprogram
The command will work fine with the x and y axis but the z axis still won't change. If i add the MOVEOBJECT_FORCELOCATION nothing will work.
Am i doing somethin completly wrong?
[/code]
Posted: Thu May 31, 2007 2:05 am
by CWO
Are you placing the forcelocation in the realm spot?
This should work
MoveObjectToLocation(what, what.x + CInt(values[1]), what.y + CInt(values[2]), what.z + CInt(values[3]), what.realm, MOVEOBJECT_FORCELOCATION);
notice the what.realm must be between the z and the forcelocation. Theres another way you can do it without the realm parameter which I'll list below. I do it the way I listed above mostly for completeness since I personally don't like seeing parameters just being skipped.
MoveObjectToLocation(what, what.x + CInt(values[1]), what.y + CInt(values[2]), what.z + CInt(values[3]), flags := MOVEOBJECT_FORCELOCATION);
Posted: Thu May 31, 2007 2:18 am
by Whity
Thanks a lot CWO now its working, btw that means that the converted zip files are wrong , maybe someone could check them for that, i would do it if it would be replaced after
Greetings and Thanks!
Posted: Thu May 31, 2007 2:25 am
by CWO
Saying the converted zip files were from POL095 originally, they were using the old way, MoveItemToLocation which had no realm parameter since realms didn't exist before POL096.