Please login or register.

Login with username, password and session length
Advanced search  

News:

This forum provides RSS feed. To query recent posts use this url. More...


Author Topic: Problem with scope when compile the game  (Read 4101 times)

0 Members and 1 Guest are viewing this topic.

Dionysius

  • Frequent poster
  • ****
  • Karma: 3
  • Offline Offline
  • Gender: Male
  • Posts: 361
    • View Profile
    • On the Tracks of Dinosaurs
Problem with scope when compile the game
« on: May 20, 2008, 08:58:46 AM »

I have included some script in game.script, which uses global var (inside a function). This var is declared in base.inc. So, in game.script I have
Code: [Select]
#include "scripts\base.inc"
#include "interface\system\problem_script.script"
When I run the game from ProjectManager, it works OK. But when I try to compile it, in the log I have such error:
Quote
Compiled file problem_script.script
Variable SomeGlobalVar is referenced but not defined
Logged

Net

  • Gripped Software Programmer
  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 48
    • View Profile
    • Čurina
Re: Problem with scope when compile the game
« Reply #1 on: May 20, 2008, 09:37:26 AM »

Do you have included base.inc in your problem_script.script ?
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Problem with scope when compile the game
« Reply #2 on: May 20, 2008, 09:53:33 AM »

What of you open the script in editor and try "Check syntax"? What if you try the "Check syntax" command in ProjectMan?
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Dionysius

  • Frequent poster
  • ****
  • Karma: 3
  • Offline Offline
  • Gender: Male
  • Posts: 361
    • View Profile
    • On the Tracks of Dinosaurs
Re: Problem with scope when compile the game
« Reply #3 on: May 20, 2008, 10:49:41 AM »

Do you have included base.inc in your problem_script.script ?
If I do, it would be
Quote
Duplicate declaration of variable <varName>

What of you open the script in editor and try "Check syntax"? What if you try the "Check syntax" command in ProjectMan?
The same problem :(
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Problem with scope when compile the game
« Reply #4 on: May 20, 2008, 11:03:56 AM »

Oh, I didn't understand the problem correctly at first, now I do.
Is there any reason why you use .script extension for include file? When you compile project, ProjectMan compiles all files with .script extension. Your problem_script.script apparently isn't intended to be run standalone, but included in other script. Just change it's extension to something else (.inc is typically used for included script pieces).
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Dionysius

  • Frequent poster
  • ****
  • Karma: 3
  • Offline Offline
  • Gender: Male
  • Posts: 361
    • View Profile
    • On the Tracks of Dinosaurs
Re: Problem with scope when compile the game
« Reply #5 on: May 20, 2008, 11:12:26 AM »

Well, it helped :) I didn't know that extension of script-files so important.
Logged
 

Page created in 0.038 seconds with 23 queries.