Jump to content

Photo

Timer Script, need help


  • Please log in to reply
25 replies to this topic

#11
Wyrm1331

Wyrm1331

    Enthusiast

  • Members
  • PipPip
  • 108 posts

Maybe you can try changing it to (StartDay + 3). I know that spacing matters in the if statements, so it probably matters for that too.

If that's not the problem, exactly what is happening when you try to use the script?



hey i can't help but notice that startday and finishday are in purple, which leads me to believe that they may be phrases the game has saved for a specific use. you could try using a variable named Sday instead of startday and Fday instead of Finishday


I tried both options but they doesnīt work.... :wallbash::(

#12
fg109

fg109

    Faithful poster

  • Members
  • PipPipPipPip
  • 1,244 posts
Sorry, I don't have any more ideas on what the problem could be. The code looks like it should work. Maybe you're just implementing it wrong?

Are you using it in a script or typing it into the "Result Script" box in the "Quest Stages" tab of the quest window?

If you are using it in a script, do you have it in the "Begin GameMode" block?

Actually, when you test it does it actually add any of the dialogue topics at all?

#13
Wyrm1331

Wyrm1331

    Enthusiast

  • Members
  • PipPip
  • 108 posts

Sorry, I don't have any more ideas on what the problem could be. The code looks like it should work. Maybe you're just implementing it wrong?

Are you using it in a script or typing it into the "Result Script" box in the "Quest Stages" tab of the quest window?

If you are using it in a script, do you have it in the "Begin GameMode" block?

Actually, when you test it does it actually add any of the dialogue topics at all?


Hi! Yes, I use it in a quest Script, in the "begin gamemode" block. Actually, it it doesn´t work when I test it....It don´t go to the Stage 7.... :wallbash:


scn 01Quest

Short doOnceX
Short StartDay
Short FinishDay
Short state


Begin GameMode

set doOnceX to 0

if ( GetStage aa1 == 6 ) && ( doOnceX == 0 ) 
                      			Set StartDay to GameDaysPassed
 					Set state to 0
                                        Set FinishDay to (StartDay +3)
                                        AddTopic 1
            				Set doOnceX to 1
endif

if ( doOnceX == 1 )  && ( GameDaysPassed >= (StartDay +3) ) 
                                        Setstage aa1 7
                                        set state to 1
                                        AddTopic 2
                                        set doonceX to 2                        
endif

End

Edited by Wyrm1331, 12 March 2011 - 09:53 AM.


#14
Maskar

Maskar

    Resident poster

  • Members
  • PipPipPipPipPip
  • 2,981 posts
The reason why it doesn't work is because you set doOnceX to 0 at the start of the script and therefore will never get into the second if statement.

#15
Wyrm1331

Wyrm1331

    Enthusiast

  • Members
  • PipPip
  • 108 posts

The reason why it doesn't work is because you set doOnceX to 0 at the start of the script and therefore will never get into the second if statement.


I delete the "doOnceX to 0" at the start of the script, but it doesnīt work....i donīt know why...:(

#16
Maskar

Maskar

    Resident poster

  • Members
  • PipPipPipPipPip
  • 2,981 posts
Not sure if you can use 1 and 2 as topics, but you might want to try and add debug lines to your script, so you can see what's happening. Something like:

set tempvar to GetStage aal
printc "dooncex: %.0f stage: %.0f" dooncex tempvar


#17
Wyrm1331

Wyrm1331

    Enthusiast

  • Members
  • PipPip
  • 108 posts

Not sure if you can use 1 and 2 as topics, but you might want to try and add debug lines to your script, so you can see what's happening. Something like:

set tempvar to GetStage aal
printc "dooncex: %.0f stage: %.0f" dooncex tempvar


This is what appears, also after this three days:

Posted Image

Edited by Wyrm1331, 12 March 2011 - 11:48 AM.


#18
fg109

fg109

    Faithful poster

  • Members
  • PipPipPipPip
  • 1,244 posts
Well I tried out what you had so far for your script and it worked. I did take out the addtopic lines since I was too lazy to make some topics. Are you sure you waited 3 days? Maybe you can try waiting 4 days just to make sure?

Also, unless you specifically declare it in your quest script, fquestdelaytime is 5 seconds. So the script only runs once every 5 seconds. After you waited the three days, did you wait a couple of seconds before checking the console and looking at your debug text?

#19
Wyrm1331

Wyrm1331

    Enthusiast

  • Members
  • PipPip
  • 108 posts

Maybe you can try waiting 4 days just to make sure?


I wait for 3, 4, 6 days....but the quest stage continuous in 6, it doesnīt go to the 7th stage....

After you waited the three days, did you wait a couple of seconds before checking the console and looking at your debug text?


Yes, but the debug text continues in the same form: dooncex 1 stage 6....

i donīt know what happens.... :wacko:

#20
Hickory

Hickory

    Indigenous species

  • Premium Member
  • 8,123 posts
Get rid of the doonce, and try this (assuming your topic IDs are correct):

Spoiler





Page loaded in: 1.452 seconds