Lord Valarian Posted June 17, 2012 Share Posted June 17, 2012 I setup a quest(alvsSQ) in the editor. Also, I have many info pages from CS wiki and other websites Scriptname SampleQuest short qvar1 begin end Scriptname vartestscr short tempvar Begin set alvsSQ.qvar to 1 ;works set tempvar to alvsSQ.qvar ;editor error End How do get this to work? Link to comment Share on other sites More sharing options...
Lanceor Posted June 18, 2012 Share Posted June 18, 2012 Perhaps declaring tempvar would help. :D BTW, are you using CS Extender? If not, I highly recommend you use it as it will give you much more information about why a script isn't compiling. :) Link to comment Share on other sites More sharing options...
Lord Valarian Posted June 18, 2012 Author Share Posted June 18, 2012 >Perhaps declaring tempvar would help. :DScriptname vartestscr short tempvar --> ?? not declaring. Begin set alvsSQ.qvar to 1 ;works set tempvar to alvsSQ.qvar ;editor error End WIll get CS extender. Fix fixes: editor crashing on save(see troubleshooting)? Link to comment Share on other sites More sharing options...
WarRatsG Posted June 18, 2012 Share Posted June 18, 2012 You have declared the variable "qvar1", but not "qvar". Then again, one of the lines works. Maybe its to do with having no parameter for the Begin statement. Honestly, it seems strange :/ Link to comment Share on other sites More sharing options...
DrakeTheDragon Posted June 18, 2012 Share Posted June 18, 2012 I took it the "qvar1" in place of "qvar" was just a typo, else the first line wouldn't work either.The whole code appears to be not the real code but an abbreviation of sorts for getting the concept straight.There cannot be a "Begin" without a mode identifier after it, this alone will stop the compiler already. Well, I don't actually know, but as it doesn't make any sense at all, I take it it should break it. I'm curious as to why your second line doesn't compile. I'm using a line "set init to DrakeDragonRaceQuest.init" in my dragon race plugin quite fine and nothing crashes or errors out. There must be something else wrong with this, maybe something we can't spot due to the code not being identical to the one you actually throw at the compiler? I don't know. It works for me, so it should for you. Have you tried putting it in brackets already, like "set tempvar to (alvsSQ.qvar)"? I just rechecked my scripts and there is no actual line like I quoted. I'm not using "set" but "let", though this was only done because I'm passing whole arrays instead of just a simple short this way, and arrays require "let".But if even a more complex line like this one: "set endi to (i - DrakeDragonRaceQuest.itemsRevertPerFrame)" works for me... why won't it for you? Is it some weirdness specific to "set" perhaps? Are brackets actually required? I'm clueless. Link to comment Share on other sites More sharing options...
Lord Valarian Posted June 18, 2012 Author Share Posted June 18, 2012 On 6/18/2012 at 3:32 PM, DrakeTheDragon said: I took it the "qvar1" in place of "qvar" was just a typo, else the first line wouldn't work either.The whole code appears to be not the real code but an abbreviation of sorts for getting the concept straight.There cannot be a "Begin" without a mode identifier after it, this alone will stop the compiler already. Well, I don't actually know, but as it doesn't make any sense at all, I take it it should break it. I'm curious as to why your second line doesn't compile. I'm using a line "set init to DrakeDragonRaceQuest.init" in my dragon race plugin quite fine and nothing crashes or errors out. There must be something else wrong with this, maybe something we can't spot due to the code not being identical to the one you actually throw at the compiler? I don't know. It works for me, so it should for you. Have you tried putting it in brackets already, like "set tempvar to (alvsSQ.qvar)"? I just rechecked my scripts and there is no actual line like I quoted. I'm not using "set" but "let", though this was only done because I'm passing whole arrays instead of just a simple short this way, and arrays require "let".But if even a more complex line like this one: "set endi to (i - DrakeDragonRaceQuest.itemsRevertPerFrame)" works for me... why won't it for you? Is it some weirdness specific to "set" perhaps? Are brackets actually required? I'm clueless. Scriptname SampleQuest short qvar1 begin Gamemode end Scriptname vartestscr short tempvar Begin Gamemode set alvsSQ.qvar1 to 1 ;works set tempvar to alvsSQ.qvar1 ;editor error End >The whole code appears to be not the real code but an abbreviation of sorts for getting the concept straight. Yes, the code is complex. This is basic idea. Then again, I'll recheck my code for typos. I'll edit this message if need be. >Have you tried putting it in brackets already, like "set tempvar to (alvsSQ.qvar)"? Yes, no change. >I just rechecked my scripts and there is no actual line like I quoted. I'm not using "set" but "let", though this was only done because I'm passing whole arrays instead of just a simple short this way, and arrays require "let". Tried let, no change. Typo check before I finish this message. Link to comment Share on other sites More sharing options...
WarRatsG Posted June 19, 2012 Share Posted June 19, 2012 I should have realised it was a fragment. My apologies. There is definitely something missing. Yolur syntax is flawless, so provided theres no typos, we need to see the rest of your script, exactly as it is. I have extensively used cross script variables myself, so I know they work. Link to comment Share on other sites More sharing options...
Lord Valarian Posted June 21, 2012 Author Share Posted June 21, 2012 On 6/19/2012 at 12:36 PM, WarRatsG said: I should have realised it was a fragment. My apologies. There is definitely something missing. Yolur syntax is flawless, so provided theres no typos, we need to see the rest of your script, exactly as it is. I have extensively used cross script variables myself, so I know they work. I'v completely rewritten the code, a few times, and the problem is solved. Thanks, i'm sure it was typo somewhere. This topic is closed. Link to comment Share on other sites More sharing options...
Recommended Posts