Jump to content

Scripting Questions


Mehra

Recommended Posts

Hi, I am working on my mod, and the biggest issue is the scripting. I use the Construction Set website for my tutorials, but I can't seem to find a good one on scripting. The major issues for me are figuring out how to get a timer to work for this scenario: you finish a quest and a certain amount days pass before you get a journal update to begin the next one. I have a few other questions concerning scripts, but that isn't for a while. Any help would be appreciated. I don't understand scripting much, I just copy and paste the tutorial scripts and plug in my variables. But I probably should learn it more.

 

Thanks.

Link to comment
Share on other sites

For the timer:

 

You'll need a variable, declared "short YourTimer" in the quest script. Then, in the result script for the completion stage of the quest, put the line "Set YourQuest.YourTimer to GameDaysPassed + X" where X is the number of days you want them to have to wait. Then in a gamemode block for your quest, all you need is "if GameDaysPassed > YourTimer", "StartQuest TheNextQuest".

Link to comment
Share on other sites

I'll strongly recommend going over to TES Alliance and going through their tutorials-- cut & paste is a great way to start, but having a good understanding of variables, commands, and how to use them will save you so much frustration later on.

 

Of course, modding is at least 90% frustration anyway, but.... :biggrin:

Link to comment
Share on other sites

How accurate do you want it to be? The idea posted above will start the next day at 12am, but if you want it to be a multiple of 24h, then you need to store the original GameHour and adjust the logic in the test to take that into account.

SCN... 

int GameDaysVar 
int GameDaysTemp 
float GameHourVar 
short RunTimer 

Begin GameMode
if RunTimer<1
 return
endif
if RunTimer<2
 set GamDaysVar to GameDaysPassed
 set GamHourVar to GameHour
 set RunTimer to 2
endif
set GameDaysTemp to GameDaysPassed - GameDaysVar
if (GameDaysTemp>*2*)||((GameDaysTemp>=*1*)&&(GameHour>=GameHourVar))
  ;****Start new quest/stage and others result actions****
 set RunTimer to 0
endif 
end

Where *1* is the number of days you want the delay to operate for (and *2* is *1*+1"). Attach that to a running quest, to start the timer you call "set QuestID.RunTimer to 1" and the timer will automatically record the current day/time and will trigger the results section (and reset itself back to idle) when at least *1* days have elapsed (taking into account the time of day it is set).

 

There may be some problems with it false triggering around midnight (after *1* days) due to globals being updated at different times (according to the wiki at any rate), but increasing the value of *1* slightly, ie 5->5.05 would probably an effective enough bandaid if there is a problem.

Edited by Skevitj
Link to comment
Share on other sites

Wow, so many replies! Thank you guys very much! I will take a look at all you guys have posted and if I have more issues with it, I'll come reply again. Scripting is very complex in my head, but only because I'm a beginner. I find the more I practice, the easier it becomes.
Link to comment
Share on other sites

  • 2 weeks later...
Argh, I took a break for a while, hoping I could get a clear head and come back to this problem fresh, but I'm still not understand the scripting for this. If it helps, I want the player to wait 3 days from the end of one quest, to get a journal update for the next one. Quest 1 is AACaiusQuest2 and the second quest is AACaiusQuest3. Sorry to sound so stupid or lost, this is rather complicated for me. I tried the things listed in this thread, but I know I'm screwing up somewhere. I guess I don't know enough about scripting to understand some of the terminology used. Sorry! >.<
Link to comment
Share on other sites

GameDaysPassed-- something I wish I'd thought to look for in my earliest modding days.

 

I think you'd do something like this:

 

- Declare the variable to start the second quest-- something like, StartCQ3

- Set StartCQ3 to GameDaysPassed

- if StartCQ3 equals GameDaysPassed +3, then start AACaiusQuest3, or setstage AACaiusQuest3 stagenumberhere, whichever one will trigger the appropriate journal entry.

Link to comment
Share on other sites

Ha! Hey Nell! Thanks for the reply. Let me check this out and see if my tiny brain gets it right. :P

 

GameDaysPassed-- something I wish I'd thought to look for in my earliest modding days.

 

I think you'd do something like this:

 

- Declare the variable to start the second quest-- something like, StartCQ3

- Set StartCQ3 to GameDaysPassed

- if StartCQ3 equals GameDaysPassed +3, then start AACaiusQuest3, or setstage AACaiusQuest3 stagenumberhere, whichever one will trigger the appropriate journal entry.

Link to comment
Share on other sites

This is probably wrong, I know it is, because I keep getting Script Error "Script 'AACaiusQuest3TimePass', line 6: Syntax Error. Missing 'to' in set command." But here is my script, as I wrote it.

 

SCN AACaiusQuest3TimePass

 

Begin gamemode

 

Startquest AACaiusQuest3

Set Startquest AACaiusQuest3 to GameDaysPassed

if Startquest AACaiusQuest3 equals GameDaysPassed +3, then setstage AACaiusQuest3 10

 

end

Link to comment
Share on other sites

  • Recently Browsing   0 members

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