Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - eborr

Pages: 1 2 3 [4]
46
Technical forum / Cannot get globals to be "globals"
« on: April 01, 2009, 12:42:25 AM »
Later

I think I have worked it out it seems you have use the global prefix prior to using the variable in other scripts, that's fine, but my thinking was that if you re-used the global prefix you would re-initialise the variable - perhaps you can confirm these assumptions for me.


Probably doing something very obvious incorrectly here.  I am trying to use globals for games state, and they don't appear to work, I have looked at the thing a number of times, and even used the globals that are automatically initialised, but they don't seem to be visible to other procedures

this is the debug list

00:21: Compiling script 'scenes\greendale\scr\pat.script'...
00:21:   Error@line 26: Variable 'Stategreendale' is referenced but not defined
00:21: Compiling script 'scenes\greendale\scr\pat.script'...
00:21:   Error@line 62: Variable 'SpeechTrigger' is referenced but not defined
00:21: Compiling script 'scenes\greendale\scr\cu_background.script'...
00:21:   Error@line 4: Variable 'SpeechTrigger' is referenced but not defined
00:21:
00:21: Shutting down...
00:21: Shutting down scripting engine

and the offending code is in three scripts, the two globals Stategreendale ( system generated) and SpeechTrigger are initialised in screen_init.script.

global Stategreendale;
global SpeechTrigger = 0;

in the script oat.script both are assigned values

Stategreendale.Visited = true;   - line 26
 SpeechTrigger = 1;  - line 62


in the script cu_background.script

if (SpeechTrigger ==1);

is there some switch I need to set for globals to work ?





47
Technical forum / probably a simple question
« on: March 18, 2009, 12:45:55 AM »
probably going to appear a naive idiot with this question.

Are there any limitations as to where I can place a function - I can create a function perfectly well in the screen-init script, but if I try and create the same function in a script which is linked to an entity I get a compiler error, any thoughts as to what I am doing wrong I

the function is very simple

function xray ()
{
Game.MSG("Hello");
return:
}

xray();


Pages: 1 2 3 [4]

Page created in 0.038 seconds with 21 queries.