Content specific action button
by Tom · in Torque Game Engine · 08/08/2006 (11:03 am) · 10 replies
Hi, i was just wondering if anyone ever thaught about a content specific action button.
what i mean is: u are looking at a chest, the action button displays "open", u stare at a climable wall, action says" climb" etc. much the same way the action button worked in Zelda OoT and Majora's mask.
so yeah i was wondring if this could be done in script or if i would have to mod the engine itself.
also if anyone would know of any resources that would be great.
but first i want to know what you ppl think about this idea:)
what i mean is: u are looking at a chest, the action button displays "open", u stare at a climable wall, action says" climb" etc. much the same way the action button worked in Zelda OoT and Majora's mask.
so yeah i was wondring if this could be done in script or if i would have to mod the engine itself.
also if anyone would know of any resources that would be great.
but first i want to know what you ppl think about this idea:)
#2
08/08/2006 (11:06 am)
What do u mean? couldnt it be keeped in an array and then dynamicly be changed?
#3
08/08/2006 (11:14 am)
How you store it is up to you... that all depends on how you implement it in script.
#4
08/08/2006 (11:16 am)
Ic, ok so what did u mean with trivial?
#5
08/08/2006 (11:33 am)
Quote:
so what did u mean with trivial?
//-----------------------------------------------------------------------------
// Trivial button text code
//-----------------------------------------------------------------------------
function clientCmdSetActionButtonText(%text)
{
switch$(%text)
{
case "Chest":
actionButton.setText("Open");
case "Wall":
actionButton.setText("Climb");
}
}
#6
08/08/2006 (11:34 am)
I think there's some confusion with what Tom's talking about. I think he's referring to context sensitive buttons, not changing the content of a button on screen. This would still be a pretty simple thing to do though. I'd just place a trigger around the area where the button's context would change, then have a switch statement in the function you call for that button and you can change what the button does based on the context.
#7
@scott i though i would have to use triggers:) but isnt there like a limit to how many tirggers one can have? i read 6 somewhere
@Tim thank you very much the code clearly explains, it seems i mis understood the sentence i thought trivial as in not easy to use, controversal that sort of thing that why i asked what is ment.
but thank you for this interesting switch code it will come in handy:)
08/08/2006 (11:39 am)
@ tim/scott actually both of you are right!@scott i though i would have to use triggers:) but isnt there like a limit to how many tirggers one can have? i read 6 somewhere
@Tim thank you very much the code clearly explains, it seems i mis understood the sentence i thought trivial as in not easy to use, controversal that sort of thing that why i asked what is ment.
but thank you for this interesting switch code it will come in handy:)
#8
08/08/2006 (11:50 am)
There's no limit to triggers that I'm aware of, if there is then its news to me.
#10
08/08/2006 (2:25 pm)
Hmm...oh turns out i was thinking about strigger states :s lol but yeah, interesting
Torque Owner Cliff