Syntax Help Please

Discussion of Inner Space

Moderators: Lavish Software Team, Moderators

Post Reply
Fuergrissa
GamingTools Subscriber
Posts: 31
Joined: Fri Jul 16, 2004 2:46 am

Syntax Help Please

Post by Fuergrissa » Fri Sep 01, 2006 4:44 am

Is it possible to view a define in a UI, i want to be able to manipulate the defines, by Inc and Dec of 1000 within a UI if its possible, any help or pointers would be appreciated thanks. I am sure Lax will sigh when he sees my bodged efforts but at least i am trying.

here is my code:

Code: Select all

Script:
#define WaitDockedTime 153000

UI:
<commandbutton name='WaitDock In'> 
					<X>10</X> 
					<Y>10</Y> 
					<Width>25</Width> 
					<Height>25</Height> 
					<Texture Filename="PlusButton-Up.png"></Texture>
					<TexturePressed Filename="PlusButton-Down.png"></TexturePressed>
					<TextureHover Filename="PlusButton-Highlight.png"></TextureHover>
					<Command>Script[mining].WaitDockedTime&#58;Inc[1000]</Command>
				</commandbutton> 
				<commandbutton name='WaitDock Out'> 
					<X>35</X> 
					<Y>10</Y> 
					<Width>25</Width> 
					<Height>25</Height> 
					<Texture Filename="MinusButton-Up.png"></Texture>
					<TexturePressed Filename="MinusButton-Down.png"></TexturePressed>
					<TextureHover Filename="MinusButton-Highlight.png"></TextureHover>
					<Command>Script[mining].WaitDockedTime&#58;Dec[1000]</Command>
				</commandbutton>
				<Text name='WaitDockT'>
					<X>60</X>
					<Y>12</Y>
					<Width>80</Width> 
					<Height>20</Height> 
					<Text>WaitDock&#58;</Text>
				</Text>
				<Text name='WaitDockA'>
					<X>140</X>
					<Y>12</Y>
					<Width>50</Width> 
					<Height>20</Height> 
					<Text>$&#123;Script[mining].WaitDockedTime&#125;</Text>
				</Text>

Lax
Owner
Posts: 6634
Joined: Fri Jun 18, 2004 6:08 pm

Post by Lax » Fri Sep 01, 2006 11:46 am

No. #defines exist ONLY during the preprocessing phase (see http://www.lavishsoft.com/wiki/index.ph ... eprocessor ). Once the script is running, it's already gone and replaced with the value given. If you need to manipulate it later, it MUST be a variable instead.

Please read the Language and Engine overview and preprocessor page multiple times, word for word. Even if you don't understand all of it the first time, perhaps when you have questions that may be answered there, you can either remember and have it make sense, or review the pages and find the answer :)

Post Reply