Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: eborr on March 18, 2009, 12:45:55 AM

Title: probably a simple question
Post by: eborr 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();

Title: Re: probably a simple question
Post by: FogGobbler on March 18, 2009, 08:16:02 AM
Code: WME Script
  1. function xray ()
  2. {
  3. Game.MSG("Hello"); <--- It should be Game.Msg("Hello");
  4. return: <----  is that a colon? Should be a semicolon
  5. }
  6.  
  7. xray();
  8.  
Title: Re: probably a simple question
Post by: Mnemonic on March 18, 2009, 08:19:38 AM
Also if you say you're getting an error, always say WHAT error.
Title: Re: probably a simple question
Post by: eborr on March 21, 2009, 09:50:03 AM
sorry  the : was a typo problem also persists with a semi-colon - the error message was a standard could not complite the script - this was taken from the logfile, if there is a respository with a more detailed error message I could look that up - In retrospect I am now wondering if the problem was due to a missing brace somewhere, in any event thank you for the interest.
Title: Re: probably a simple question
Post by: Mnemonic on March 21, 2009, 10:00:51 AM
Sorry, but if you don't give us the EXACT error message (which contains line number, btw) and the EXACT script that gives you the error, I don't think anyone will be able to help you.