Author Topic: Variables and such...  (Read 6367 times)

0 Members and 1 Guest are viewing this topic.

Offline AndyPanda

Variables and such...
« on: June 16, 2004, 09:21:39 PM »
I just wanted to know if any of you have any advice on the following:
I want a certain thing to happen only the first time I enter a room, and never again. I've made a state-method with all the action in, and so far so good. I also made a variable that becomes false once the animation is over. My problem is that whenever I exit the room and return, the variable of course is set to true again. How can I do this, anyone?
« Last Edit: June 16, 2004, 09:22:59 PM by AndyPanda »



Offline Doan Sephim

Re:Variables and such...
« Reply #1 on: June 16, 2004, 11:09:28 PM »
hullo,
the room variables will equal what they are set at on the individual room script everytime you have a room change to that room. so to have a variable that does not change, you must put it into the main script. room changes will not effect the truth or falsity (one or zero-ity) of the variables in the main script.
doan

Offline AndyPanda

Re:Variables and such...
« Reply #2 on: June 16, 2004, 11:34:49 PM »
Ah, I actually saw that from an older post in the forum  :P But anyway, I can't get it to work. I have a variable called FIRST_TIME_IN_SHOP set in the main script. Then I have set it to true in the room script. When the dialogue I put in is finished, I have a =FIRST_TIME_IN_SHOP FALSE. Anyway, when I enter the room again, it still processes the whole dialogue again. I don't understand this. Could you give me an example? Sorry if I ask stupid questions here, but I can't seem to get the grip of this  :)

Offline Eigen

Re:Variables and such...
« Reply #3 on: June 17, 2004, 01:40:44 AM »
Then I have set it to true in the room script.

That's probably where the problem is. Set it to TRUE in main script.


-Eigen
Artificial Intelligence Competition

Offline AndyPanda

Re:Variables and such...
« Reply #4 on: June 17, 2004, 11:58:08 AM »
That didn't seem to work either, I'm afraid. Where in the main.sc should I put = FIRST_TIME_IN_SHOP TRUE? It's like the variable refuses to become false  :-\

Offline Eigen

Re:Variables and such...
« Reply #5 on: June 17, 2004, 12:23:00 PM »
in main script:

(local
.....

FIRST_TIME_IN_SHOP = TRUE


-Eigen   
Artificial Intelligence Competition

Offline AndyPanda

Re:Variables and such...
« Reply #6 on: June 17, 2004, 01:49:49 PM »
Still nothing  :-\ I get so frustrated, cause this is really important for the game. Here's the roomscript, I stripped it down just to test that thing:

/******************************************************************************/
(include "sci.sh")
(include "game.sh")
/******************************************************************************/
(script 6)
/******************************************************************************/
(use "controls")
(use "cycle")
(use "door")
(use "feature")
(use "game")
(use "inv")
(use "main")
(use "obj")
/******************************************************************************/


(instance public rm006 of Rm
« Last Edit: June 17, 2004, 02:25:50 PM by AndyPanda »

Offline Eigen

Re:Variables and such...
« Reply #7 on: June 18, 2004, 01:30:35 AM »
I used your code, and it worked fine, but I just had to change one line a bit. You have:

(if(FIRST_TIME_IN_SHOP FALSE), that doesn't work.

It has to be (if(== FIRST_TIME_IN_SHOP FALSE) or
(if(not(FIRST_TIME_IN_SHOP))

That should do it.


-Eigen
Artificial Intelligence Competition


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.06 seconds with 20 queries.