Game Development Community

Fields?

by Matt "Mr. Pig" Razza · in Torque Game Engine · 10/26/2005 (6:03 pm) · 6 replies

I am wondering how I can create a field for a trigger. By field I mean a var that will be chnaged in the mission editor. I have the trigger coded, datablock ect but I need the map maker to be able to set ZoneInfo.locName from the editor GUI like you can many other vars. How would I go about doing that?

#1
10/26/2005 (6:46 pm)
Not 100% on what you mean.... are you wanting to simply change a variable value when you enter the trigger.. or are you wanting a spot to place a new variable or something in the mission editor... if so

img423.imageshack.us/img423/8831/screenshot008000022sn.jpg

you can add dynamic fields.
#2
10/26/2005 (7:02 pm)
Yes, but what are dynamic fields? Is the name the var like, $name, or is it object.var? What I wanted to know is how to make something under misc, like IconSize.
#3
10/26/2005 (7:09 pm)
A dynamic field does just that.


%coolobject.dynamicfieldname="pudding";
#4
10/26/2005 (7:09 pm)
Object.var is correct.

So if you want to reference a dynamic field in a trigger, it'd be like

function blah::onEnterTrigger(%this, %obj, %trigger){
%trigger.field = "monkeys";
}

And of course you can create them in script dynamically like that as well.
#5
10/27/2005 (12:07 pm)
Thanks a lot guys.
#6
03/25/2006 (8:32 pm)
This is very helpful, thank you very much.