AndyPanda |
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? |
doan sephim |
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 |
AndyPanda | 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 :) |
Eigen |
AndyPanda wrote: That's probably where the problem is. Set it to TRUE in main script. -Eigen |
AndyPanda | 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 :-\ |
Eigen |
in main script: (local ..... FIRST_TIME_IN_SHOP = TRUE -Eigen |
AndyPanda |
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 |
Eigen |
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 |