Jump to content

reading quest vars in other scripts


Recommended Posts

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

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

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

  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

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

  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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...