Jump to content

run game clock in script?


Recommended Posts

I'd like to do something like this:

IF
	Global("dialog1","GLOBAL",0)
THEN
	RESPONSE #100
	SetGlobal("dialog1","GLOBAL",1)
	ActionOverride(LastSummonerOf(Myself),StartDialogOverride("dialog1",Myself))
END

[dialog1 results in an AddKit action, then EXIT back to this script)

[***** let 1 second pass in-game to allow the AddKit action to process...?]

IF
	Global("dialog1","GLOBAL",1)
	Global("dialog2","GLOBAL",0)
THEN
	RESPONSE #100
	SetGlobal("dialog2","GLOBAL",1)
	ActionOverride(LastSummonerOf(Myself),StartDialogOverride("dialog2",Myself))
END

[dialog2 results in an ApplySpellRes action, then EXIT back to this script]

IF
	True()
THEN
	RESPONSE #100
		SetGlobal("dialog1","GLOBAL",0)
		SetGlobal("dialog2","GLOBAL",0)
		DestroySelf()
END

The key thing is, I want to make sure the player has their new kit at the moment when the spell from dialog2 is applied.  Maybe that will happen anyway, and the ***** bit is not necessary. 

Frankly this might not be necessary at all - things might work fine if the NPC has their old kit when the ApplySpell processes.  I just want to know if this is possible, to lock down as many loose ends as possible.

Edited by subtledoctor
Link to comment
36 minutes ago, subtledoctor said:

The key thing is, I want to make sure the player has their new kit at the moment when the spell from dialog2 is applied.

Well, you are already using a global, so why not add a set global to the ADD_KIT's after effects. And no, DO NOT RESET the global to zero... a script file from a pre-EE kit made by me for a Sorcerer kit'ed fighter's invisible creature maker, summoned by an effect, circa 2010... :

IF
	Kit(LastSummonerOf(Myself),ijdragf)
	Class(LastSummonerOf(Myself),FIGHTER)
	Global("IJ#DCLO","GLOBAL",0)
	ActionListEmpty()
THEN
	RESPONSE #100
		ChangeClass(LastSummonerOf(Myself),SORCERER)
		ActionOverride(LastSummonerOf(Myself), AddKit(IJ#DRAGSO))
		SetGlobal("IJ#DCLO","GLOBAL",1)
		Continue()
END


//HP setting
IF
	Global("IJ#DCLO","GLOBAL",2)
THEN
	RESPONSE #100
		ForceSpellRES("IJ#DCH1",LastSummonerOf(Myself))
		SetGlobal("IJ#DCLO","GLOBAL",3)
		Continue()
		DestroySelf()
END

 

Edited by Jarno Mikkola
Link to comment
3 minutes ago, Jarno Mikkola said:

Well, you are already using a global, so why not add a set global to the ADD_KIT's after effects.

Sure, I can do that.  Question is, will it actually make sure the ApplySpell happens after the AddKit?  I'm not sure what difference it would make.

Link to comment
6 minutes ago, subtledoctor said:

Sure, I can do that.  Question is, will it actually make sure the ApplySpell happens after the AddKit?  I'm not sure what difference it would make.

If it's on a new script pass and using the same GLOBAL with a different value, sure. And before the destruction of the invisible creature... as in, you can set as many actions to them, as you like, just use different values to the SAME global, not two or dozen globals... or a horrible tricker like:

IF
	True()
THEN

Hmm, LOCALS might actually be best usage here, but that's subjective.

Edited by Jarno Mikkola
Link to comment
55 minutes ago, qwerty1234567 said:

And I think you can actually check Kit()

So to be more precise, the first dialogue will let you choose any kit that is valid for your current class, so checking the kit is not helpful; there's no way to know which one the player will choose, or which one the player had to begin with. (The result of the first dialogue might be "don't change anything, I'll keep my current kit," in which case checking for  a new kit wouldn't be useful.  The second dialogue allows the player to wipe out their proficiencies and choose new ones; and I want the player to have that choice regardless of which kit they have or whether their kit changed in the course of the first dialogue.

59 minutes ago, qwerty1234567 said:

There's Wait()

Does game time run during Wait() ? Is it different from Delay() ?

Link to comment
9 hours ago, qwerty1234567 said:

There's Wait(). And I think you can actually check Kit().

Yeah, that's what this is:

IF
   Kit(LastSummonerOf(Myself),ijdragf)

But it only works on single kit's... unless you want a horrible OR sets.

Edited by Jarno Mikkola
Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...