subtledoctor Posted November 3, 2016 Share Posted November 3, 2016 I'm working on a spell that will open a dialogue, give the caster a bunch of choices, and then depending on the chosen response, grant a new innate ability. So: spell --> invisicre --> dialogue --> --> new ability I'm not sure what needs to go where the is. There seems to be an "AddSpecialAbility" script action, but it doesn't take a target...? So if the dialogue is initiated by an invisicre, there doesn't seem to be a way to apply that action to LastSummonerOf(Myself). There seems to be a RemoveSpell action, but no AddSpell action? Do I need to make a secondary spell that uses opcode 171, and ApplySpellRES that to the LastSummonerOf(Myself)? Easy enough to do; but i'd like to know whether this is the optimal method for this. Link to comment
argent77 Posted November 3, 2016 Share Posted November 3, 2016 LastTalkedToBy should address the right target (Example: ActionOverride(LastTalkedToBy, AddSpecialAbility("MYABIL")) ). Link to comment
subtledoctor Posted November 3, 2016 Author Share Posted November 3, 2016 Ah, apparently ActionOverride is the piece I was missing. Nice. Thanks! Next question: can a script increment a global or local variable? Or just *set* them? Link to comment
Jarno Mikkola Posted November 3, 2016 Share Posted November 3, 2016 Next question: can a script increment a global or local variable? Or just *set* them? Action #109. Yes. Link to comment
subtledoctor Posted November 3, 2016 Author Share Posted November 3, 2016 Sweet. I must have missed that. My evil plan is coming together... Muahahahaha! Link to comment
Avenger Posted November 6, 2016 Share Posted November 6, 2016 Some note, (multiple blocks of) queued up actions won't be executed in the dialog, so make sure you exit the dialog after the actionoverride. Link to comment
subtledoctor Posted November 15, 2016 Author Share Posted November 15, 2016 Next question : I currently have this working in a dialogue: IF ~Global("D5_SKILLS","LOCALS",0)~ THEN REPLY ~Stealth Bonus~ GOTO d5_rogue_1 Instead of checking if a local variable is equal to some value, can I check whether it is at least equal to some value? Like, IF ~Global("D5_SKILLS","LOCALS",>=0)~ THEN REPLY ~Stealth Bonus~ GOTO d5_rogue_1 Or, if that variable is incremented and I want to limit this script to happening 5 times: IF ~Global("D5_SKILLS","LOCALS",<5)~ THEN REPLY ~Stealth Bonus~ GOTO d5_rogue_1 Link to comment
agb1 Posted November 15, 2016 Share Posted November 15, 2016 Use triggers GlobalLT(...) and GlobalGT(...) (less than, greater than) and action IncrementGlobal. Ex GlobalLT("abc","GLOBAL",3) is true for 0, 1, 2. LOCALS instead of GLOBAL is fine. Link to comment
subtledoctor Posted November 15, 2016 Author Share Posted November 15, 2016 Thx. next: can I check more than one conditional there? Like check for both the "D5_SKILLS" local variable to be <5 *and* the speaker's INT score to be >14, then REPLY something and GOTO the next response? Something like, IF ~GlobalLT("D5_SKILLS","LOCALS",5)~ ~GlobalGT("D5_OTHER","LOCALS",0)~ THEN REPLY ~Stealth Bonus~ GOTO d5_rogue_1 Link to comment
Ardanis Posted November 15, 2016 Share Posted November 15, 2016 No offense, but have you tried to look up in-game files or any NPC mod? Link to comment
Cahir Posted November 15, 2016 Share Posted November 15, 2016 Subtledoctor try checking Branwen NPC mod at PPG by Kulyok. It was literally written as a NPC modding tutorial. Link to comment
subtledoctor Posted November 15, 2016 Author Share Posted November 15, 2016 No offense, but have you tried to look up in-game files or any NPC mod? I looked at the Weidu docs and got cross-eyed. I've never done anything with dialogue before and it's a bit of a steeper curve than the basic Weidu I've picked up (which is just COPY in various ways, and PATCH in various ways). I'll take a look at the Branwen mod. (The other issue is that I have almost zero free time these days; most of the time I can devote to modding is just planning stuff out in my head, and posting questions here. So I often can't review other mods, because I'm just sitting here on my phone, without access to a computer. I try to understand it all ahead of time, so that when I get in front of my computer I can jump right into implementing stuff.) Link to comment
agb1 Posted November 15, 2016 Share Posted November 15, 2016 This won't work:IF ~GlobalLT("D5_SKILLS","LOCALS",5)~ ~GlobalGT("D5_OTHER","LOCALS",0)~ THEN REPLY ~Stealth Bonus~ GOTO d5_rogue_1This will:IF ~GlobalLT("D5_SKILLS","LOCALS",5) GlobalGT("D5_OTHER","LOCALS",0)~ THEN REPLY ~Stealth Bonus~ GOTO d5_rogue_1All of the trigger conditions between IF and THEN need to be in a single string. Spaces between them are understood to mean 'AND' (all must be true). If you want OR (at least 1 true), you write OR(#) and the following # of conditions will be considered part of the OR statement.Ex:IF ~GlobalLT("D5_SKILLS","LOCALS",5) GlobalGT("D5_OTHER","LOCALS",0) OR(2) Global("this","LOCALS",1) Global("that","LOCALS",1) Global("other","LOCALS",1)~ THEN REPLY ~Stealth Bonus~ GOTO d5_rogue_1The part in green is the OR. Either "this" or "that" will suffice. The Global check after ("other") it isn't part of the OR, so it's considered 'AND' with the rest (must be true). Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.