Jump to content

Scripting Questions


Mehra

Recommended Posts

Well... yeah, I should have clarified that my suggestion was NOT proper coding, but an example of the general structure. I'm really sorry about that!

 

You might want to go back over variables, since this is something you really need to understand. Also, you should probably also go through comparisons and how they work. Again, you'll be using a LOT of this if you keep working on quests. See, you can't use "equals", for example-- see Skevitj's scripting above.

 

And did I mention stocking up on headache treatments? :D

 

You might try just using Skevitj's scripting, to see if and how it works (replacing the ;****Start new quest/stage and others result actions**** with... well, with what you want to have happen.

 

EDIT: Or, okay, here's something I just did a fast test on. Please remember, I'm still learning, myself-- there's an even chance that I'm way off track. I tested it in my own game, and it seems to work. But I really hope someone who really knows what they're talking about comes in to help out.

 

 

SCN qTestQuest ; This names your script. Call it whatever you want. Or, better yet, put all this stuff in your quest's script.

 

short sqtq ; This is your timer. You can name it whatever you want, but make sure you remember what it is, and make sure it's unique.

short StartTimerOnce ; This will start the timer-- but only once, since you don't want it resetting.

 

begin gamemode

 

; This block sets your variable sqtq to the current day.

; Every variable equals 0, until you change it.

 

if StartTimerOnce == 0

 

; If GameDaysPassed is equal to 0 when the timer started, then sqtq will now be equal to. If GameDaysPassed is equal to 1, then sqtq == 1, and so on.

; Let's say that GameDaysPassed was equal to 1 when the script changed sqtq from 0. That means sqtq == 1.

 

set sqtq to GameDaysPassed

set StartTimerOnce to 1

 

; StartTimerOnce started out == 0. Now StartTimerOnce == 1.

; It will remain == 1 unless you change it-- so it's effectively switched off.

; Close out your if statement:

 

endif

 

; This block compares GameDaysPassed to sqtq, plus three.

; So, if GameDaysPassed == 1, then nothing happens, because sqtq + 3 == 3. If GameDaysPassed == 2, again-- nothing happens.

; But, when GameDaysPassed == 4, then GameDaysPassed == sqtq+3, the next bit of your script should fire.

; Remember, this isn't saying that 4 game days have passed!! It's just comparing GameDaysPassed to whatever sqtq +1 happens to be.

 

if (GameDaysPassed == (sqtq +3) )

 

; So you put your code here:

setstage AACaiusQuest3 whateverthefirststageis

 

; Close out your if statement:

 

endif

 

; And that's that.

 

end

 

 

So with all my goofy commenting out, you have this:

 

 

SCN qTestQuest

 

short sqtq

short StartTimerOnce

 

begin gamemode

 

if StartTimerOnce == 0

set sqtq to GameDaysPassed

set StartTimerOnce to 1

endif

 

if (GameDaysPassed == (sqtq +3) )

setstage AACaiusQuest3 whateverthefirststageis

endif

end

 

Link to comment
Share on other sites

Well la-dee-da! I probably will need to invest in some headache medication lol. Sorry for taking your comment literally. I get so confused on scripting. It is going to SUCK so hard when I get to my next script. >.< But I tried and modified the tutorial script http://cs.elderscrolls.com/constwiki/index.php/Scripting_Tutorial:_Creating_a_Simple_Timer, it worked but I need to up the amount of waiting. It will do for now. But thank you, I have bookmarked the links you gave me and will have to spend time mulling the contents over. :) I am sure I'll be back. >.>

 

Edit: Oh! Thank you for the break down. That may help even more!

Edited by Mehra
Link to comment
Share on other sites

The thing about scripting is, it really does make logical sense-- it's just for those of us who don't have any scripting / coding / programming background, there's a pretty steep learning curve. If you get the basics down first, it gets even easier. Of course, given that no two users have all the same mods installed, and troubleshooting becomes a nightmare... but that's another set of problems, really.

 

(When I went through my first round of scripting, my partner was playing through Jagged Alliance 2. Between his cursing and my cursing... well, let's just say it was kind of a noisy house that weekend.)

Link to comment
Share on other sites

  • Recently Browsing   0 members

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