View Full Version : globle var ?

08-08-2006, 03:16 PM
Is this script right

#include "k_inc_debug"
#include "k_inc_utility"

void main()
int iCheck = GetGlobalNumber("cut1");
if (iCheck = 0)

ActionStartConversation(GetFirstPC(),"cam", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE );

I added the variable cut1 with the 2da editor as a number but by saved game editor does not show my variable am I doing some thing wroung?

08-08-2006, 03:27 PM
Have you saved a game after this script has been fired in game? If you have did your script work in the first place?

08-08-2006, 03:49 PM
This won't work :).

The "=" operator is for assigning, or defining values. You need to use "==" to check if something is equal to a value ;). You may also wish to increment the value of the global number, otherwise this can fire multiple times. Try this modified version:

void main() {
int iCheck = GetGlobalNumber("cut1");
if (iCheck == 0) {
SetGlobalNumber("cut1", iCheck++);
ActionStartConversation(GetFirstPC(), "cam");

No need to include "k_inc_debug" and "k_inc_utility."

Edit: You may want to check out this (http://www.lucasforums.com/showthread.php?t=143390) thread.

As to your actual question:

(Curses self for not looking at the actual topic) I'm not sure how tk102 built the save game editor, but it could be that the variables are from a predefined list. Is your .2da in the override folder?