btn prob - undefined token [SOLVED]

Started by Snake, Sun 21/05/2006 15:47:13

Previous topic - Next topic

Snake

I'm getting very irritated, I'm starting to piss myself off and ready to put my fist through my monitor.

Have I lossed my mind? I can't script shit anymore.

All I want to do is very simple:
When a button on a GUI is clicked, another button on a different GUI is now visible.

I double clicked the button, inside it's script I put:
btnGg1.Visible=true;

And of course it doesn't know what the hell button gg1 is.
I must have to define it somewhere first? Could it be the number fucking it up? I tried changing it to "a", but got the same thing.

Any help will be GREATLY appreciated.
While I wait for a responce I'll most likely figure it out on my own and it'll be something totally stupid.

And yeah, I feel like a total retard :-[

Thanks for any help,


--Snake
Grim: "You're making me want to quit smoking... stop it!;)"
miguel: "I second Grim, stop this nonsense! I love my cigarettes!"

Khris

Quote from: Snake on Sun 21/05/2006 15:47:13I must have to define it somewhere first?
Yes. You can name the buttons in the GUI Editor.

Ashen

#2
Also:
btnGg1.Visible=true;

And of course it doesn't know what the hell button gg1 is.
(Emphasis added.)

What is the button you want to turn on called (if you have already named it)?
Unlike GUIs, Characters, etc, GUI Control script names are exactly the name you give them. So while a character called EGO should be refered to as cEgo in script, a button called gg1 stays as gg1 (capitalisation is important, but using numbers shouldn't affect it).
EDIT:
To be a little clearer, I mean the difference between the Script Name you can set (EGO, STATUSLINE, DOOR, ...) and the generated Script-O-Name pointer (cEgo, gStatusline, oDoor, ...) that you actually use in the script for things like Character.Visible, etc. GUI Controls only have the pointer version so whatever you name them, stays.
I know what you're thinking ... Don't think that.

Snake

#3
I got it.
I had already named it gg1 like I showed in the first post.
But what I did was take the example in the manual a little too literal and had placed btn infront of gg1.
||--EDIT--||
I had figured that since cCharacter, gGui, oObject and such carried that letter infront, that btn was the same way.

Thanks for your help again, guys,


--Snake
Grim: "You're making me want to quit smoking... stop it!;)"
miguel: "I second Grim, stop this nonsense! I love my cigarettes!"

LeChuck

Quote from: Snake on Sun 21/05/2006 16:12:37
I got it.
I had already named it gg1 like I showed in the first post.
But what I did was take the example in the manual a little too literal and had placed btn infront of gg1.
||--EDIT--||
I had figured that since cCharacter, gGui, oObject and such carried that letter infront, that btn was the same way.

Thanks for your help again, guys,


--Snake

Jesus Christ this had me upset indeed. I also took the manual too literary for my own good and kept trying to write btnButtonname. If this hasn't been updated in the latest manual (I'm using the 2.7 version), do this immidiately. Sorry for the bump but this had me so upset I couldn't help myself.

Khris

In the Editor, Chars, Objects and GUIs feature an editable text field to enter the Script name. The entered name gets capitalized (ego becomes EGO), additionally there's a message next to it showing the corresponding Script O-Name (cEgo).

GUI Objects don't have any of this. The entered name stays as is and there's no Script O-Name message.

Having said that, I can see that the examples in the manual might lead to the belief it was necessary to put "lbl" or "btn" in front of the names.

SMF spam blocked by CleanTalk