DTS manipulation question
by Spencer Strombotne · in Technical Issues · 05/15/2008 (10:32 am) · 7 replies
I'm new to torquescript and I have two questions.
1. I have an item and it set's rotate = true when it is created. When the player runs over it, I want it to stop rotating. How would I do this?
2. Similar to number 1. I have the same item and I want it to move +5 units on the y-axis every time a player runs over it.
Thank you.
1. I have an item and it set's rotate = true when it is created. When the player runs over it, I want it to stop rotating. How would I do this?
2. Similar to number 1. I have the same item and I want it to move +5 units on the y-axis every time a player runs over it.
Thank you.
About the author
#2
05/15/2008 (12:34 pm)
Thank you for your help. I have question 2 working. I could use that method for question 1 but I was wondering if there was a way to change the items rotation after it had already been created without replacing it.
#3
the source for Item suggests that the "rotate" flag belongs to the item itself, not the datablock,
so just %item.rotate = false might work.
05/15/2008 (12:38 pm)
Hm,the source for Item suggests that the "rotate" flag belongs to the item itself, not the datablock,
so just %item.rotate = false might work.
#4
it looks like that won't quite work.
that field isn't being ghosted to the clients.
if it were, that would be the ticket.
i guess you could delete the item and replace with a clone that's the same in every respect except for the rotate bit, but that's pretty kludgey.
if there were a way to set the InitialUpdateMask of an existing object, that would do it too. i don't know of any way to do that, though.
05/15/2008 (1:41 pm)
Well,it looks like that won't quite work.
that field isn't being ghosted to the clients.
if it were, that would be the ticket.
i guess you could delete the item and replace with a clone that's the same in every respect except for the rotate bit, but that's pretty kludgey.
if there were a way to set the InitialUpdateMask of an existing object, that would do it too. i don't know of any way to do that, though.
#6
05/15/2008 (2:01 pm)
I am an SDK owner. It's just registered under another account name.
#7
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=14741
05/15/2008 (3:34 pm)
Here ya go thenwww.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=14741
Torque Owner Steve D
For question 2 you could try in the OnCollision callback.
%position - %item.GetPosition();
%x = Getword(%position, 0);
%y = GetWord(%position, 1);
%z = GetWord(%position, 2);
%y = %y+5;
%position = %x SPC %y SPC %z;
%item.SetTransform(%position);