Jump to content

Need script help. End Result Script.


ObLars

Recommended Posts

Hello :psyduck: Im currently working on a little project of my own, and im having a hard time figuring out how i should do this. I Got a blacksmith, whom i induct in conversation with, claiming a tax from him. I click the i.e "Have you got my taxes?" dialogue. He says everything he's gotta say, and i get the money. But what i would like is, to have a cooldown, sort of. Say, i claim tax right now, and i wouldn't be able to get the money for 24 hours the next time. Anyone catch my drift? :P Thanks :)
Link to comment
Share on other sites

Easiest way to do that is to use a Script attached to the quest. If you declare three variables in that script, one to hold the time the "Tax" was last given out (Using the GameHour global), one to hold the gameday it was given out (Using the GameDaysPassed global), and another to determine if a sufficient time has passed (basically just a binary flag).

 

The results box where you add the money would by used to set the time variables, and set the flag which would prevent the dialogue option to collect the tax from showing up. A GameMode block in the quest's script could then check the current time/day against the time/day stored, and reset the flag once a sufficient time has passed.

 

The dialogue option would then need to have a condition added that this flag is not set for it to be visible, ensuring that the option only shows up once every time period.

 

EDIT: Haven't looked in aged, but I'm assuming GameDaysPassed returns an integer value, if it returns an actual proportional value (ie, 12pm = ?.5) then the game time shouldn't be needed.

Edited by Skevitj
Link to comment
Share on other sites

Easiest way to do that is to use a Script attached to the quest. If you declare three variables in that script, one to hold the time the "Tax" was last given out (Using the GameHour global), one to hold the gameday it was given out (Using the GameDaysPassed global), and another to determine if a sufficient time has passed (basically just a binary flag).

 

The results box where you add the money would by used to set the time variables, and set the flag which would prevent the dialogue option to collect the tax from showing up. A GameMode block in the quest's script could then check the current time/day against the time/day stored, and reset the flag once a sufficient time has passed.

 

The dialogue option would then need to have a condition added that this flag is not set for it to be visible, ensuring that the option only shows up once every time period.

 

EDIT: Haven't looked in aged, but I'm assuming GameDaysPassed returns an integer value, if it returns an actual proportional value (ie, 12pm = ?.5) then the game time shouldn't be needed.

 

 

Ahh, good old construction set, and thanks a lot mate. Im quite rusty at this at the time being, is it too much to ask if you could maybe make a.. Outline of this script? I can't offer much besides Kudos, and thanks :psyduck:

Link to comment
Share on other sites

GameDaysPassed does return an integer value. So for your quest script, just use this:

 

scn SomeQuestScript

short DayLastPaid
short HourLastPaid
short TaxesReady

Begin GameMode

if (GameDaysPassed > DayLastPaid) && (GameHour >= HourLastPaid)
	set TaxesReady to 1
endif

End

 

And for the dialogue, have the the condition be:

 

"GetQuestVariable" "SomeQuest, TaxesReady" "==" "1"

 

with the end result script:

 

set SomeQuest.DayLastPaid to GameDaysPassed
set SomeQuest.HourLastPaid to GameHour
set SomeQuest.TaxesReady to 0

Edited by fg109
Link to comment
Share on other sites

You'd want to add another two conditions to that if test. If GameDaysPassed>DayLastPaid+1 then it doesn't matter what GameHour is (>24h). Also, the addition of a Do-once check is probably a good idea.

 

... 
short TempVar 

Begin GameMode 

set TempVar to DayLastPaid+1 
if ((GameDaysPassed>TempVar)||((GameDaysPassed>DayLastPaid)&&(GameHour>=HourLastPaid)))&&(TaxesReady!=1) 
 set TaxesReady to 1 
endif 
end

Ignoring, that little script change, what fg109 said is spot on, just note the logic used. Try breaking it down so you understand when it's going to test true/fale. That's probably the most complex/critical part of the timer system.

Edited by Skevitj
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...