Using a Global in a Message?

Post » Fri Nov 05, 2010 11:41 am

I'm stuck again (and my searches are not coming up with an answer).

Here's my problem:
I'm using globals in a script and these globals are modified, based on whether the PC is male or female.
I want to display a message where the global amount is displayed.
For example, when my global value is 20, I want the message to be: "This pistol requires an Energy Weapons skill of 20." and if the global value changes, I want the new value to to be inserted into the message.

I looked at the GECK wiki on messages and the use of %, but I cannot find anything on how to insert a global variable.

Is this possible?
User avatar
Chloe Botham
 
Posts: 3537
Joined: Wed Aug 30, 2006 12:11 am

Post » Fri Nov 05, 2010 4:46 pm

Sorry, accidental double post from a failed attempt to edit my post.

Cipscis
User avatar
Wanda Maximoff
 
Posts: 3493
Joined: Mon Jun 12, 2006 7:05 am

Post » Fri Nov 05, 2010 1:13 pm

Yes, just pass the global variable as a parameter of http://geck.gamesas.com/index.php/ShowMessage just like you would with a local variable:
ShowMessage MessageID GlobalVar
Which format specifier you use depends on the variable's type in the same way as it would with any other variable.

Cipscis
User avatar
Emilie M
 
Posts: 3419
Joined: Fri Mar 16, 2007 9:08 am

Post » Fri Nov 05, 2010 9:20 pm

Thanks Cipscis!

At first I was a bit lost, but then I realized that I had to put the name of my global at the end of the "show message' line in my script. I was trying to do this all in the message itself (which didn't work at all).

It is stuff like this that drives me nuts, as I read and reread the wiki, yet there's often one little part that I'm totally missing (not the fault of the wiki, but of my language issues).

Thanks again! I've finally managed to get this working for me. :)
User avatar
Conor Byrne
 
Posts: 3411
Joined: Wed Jul 11, 2007 3:37 pm

Post » Fri Nov 05, 2010 7:48 pm

Cool. I just updated the documentation of http://geck.gamesas.com/index.php/ShowMessage on the wiki and included a couple of examples, so hopefully that's a bit clearer now. Part of the issue with documentation is that, because it necessarily is written by people who already understand it, sometimes some some important basics are omitted.

Cipscis
User avatar
lucile
 
Posts: 3371
Joined: Thu Mar 22, 2007 4:37 pm

Post » Fri Nov 05, 2010 12:10 pm

That's SOOO much better! And the examples are great!

Trying to learn scripting when I have like no programing understanding, has been extremely challenging for me. I always have a bit of trouble understanding what I read, but so much of the wiki has been like trying to read Greek. Sometimes I get so lost that I don't even know what questions to ask.

Your continued effects in explaining this stuff in a clear and simple manner is GREATLY appreciated. THANKS!
User avatar
OnlyDumazzapplyhere
 
Posts: 3445
Joined: Wed Jan 24, 2007 12:43 am


Return to Fallout 3