Thread: For my level
View Single Post
  #3  
Unread 08-27-2010, 05:03 PM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Default

So you'll need a text object that uses the dynamic data for your current level.
Code:
<Text DynamicData="/GameData.Self.Level" Name="PlayerLevel" Visible="false" />
To do a check in the UI script, you first need to do a comparsion line.
This code will check to see if the player is above level 89:
Code:
varCheck90=(Parent.PlayerLevel.text > 89)
The "varcheck90" is just a variable name I came up with. The "Parent.PlayerLevel.text" refers to the data that the DynamicData automatically fills into the "text" property of the Text object. And the "89" is the number I plugged in. If you're above 89, you must be level 90 (or higher).




Then we can do the comparison line:
Code:
varCheck90=(Parent.PlayerLevel.text > 89)
varCompare90=(varCheck90 ? true : false)
The "varCompare90" is just another name I came up with. If the player is above 89, it will return the "true", otherwise it will always return the "false"; in essence setting the "varCompare90" to one or the other.




So lets say you have a button called ButtonLvl90, and you only want that button to be pressed if the character is at least level 90.
This will make the button visible or keep it hidden:
Code:
varCheck90=(Parent.PlayerLevel.text > 89)
varCompare90=(varCheck90 ? true : false)

Parent.ButtonLvl90.visible=varCompare90

The method to actually press the button should be within the Button itself. You would hide the button by default, give it the property OnShow and use this code inside it:
Code:
Parent.ButtonLvl90.press=true
Visible=false
The above code will press the button, with whatever code you have in OnPress and then hide it again, making it ready to be fired off next time around.


Hope this helps.
__________________
"I'm afraid you're guilty of thought-crime. Don't bother getting the door, we'll let ourselves in..."
<Donate to DrumsUI> < [DrumsUI] Updater > < [DrumsUI] Full Interface> < Drumstix42 on Twitch.tv
>

Last edited by Drumstix42 : 08-27-2010 at 05:05 PM.
Reply With Quote