Jump to content


Photo

Okay, this is ridiculous


  • Please log in to reply
5 replies to this topic

#1 temnix

temnix
  • Member
  • 983 posts

Posted 29 July 2016 - 07:52 PM

A person is trying to set a creature to a state by a spell so he can later read that state from a script. This needs to be done from a script because that is the only way to manipulate a creature's AI, having it do certain actions, without the creature being left AI-less after the programmed sequence has run through. What does our modder find?

He can set a state through effects, but available states are taken from SPLSTATE.IDS.

He can add to SPLSTATE.IDS, but scripts only read from STATE.IDS.

He finds an unused state in STATE.IDS he could set a creature to - but effects do not work with that file at all.

He can make a script look into SPECIFIC.IDS or assign to a creature a value from there, but no effect sets to a position from SPECIFIC.IDS either.

The script world and the effects world are like the two brain hemispheres, separated by a deep gulf. Our modder thinks this is a catch 22.



#2 temnix

temnix
  • Member
  • 983 posts

Posted 30 July 2016 - 05:38 PM

Solved thanks to people on another board. I have my marking mechanism.



#3 Sergio

Sergio
  • Member
  • 954 posts

Posted 31 July 2016 - 04:06 AM

explain how you solved the issue, please


Low hung brow, dazed look on your face..... It appears that you are correct, my friend. You are indeed a complete imbecile.


#4 temnix

temnix
  • Member
  • 983 posts

Posted 31 July 2016 - 11:43 AM

It was not quite my invention, I piece together a solution from another user, from what people suggested on this board, and then did a whole lot of testing, pretty much like on the picture below. It turns out there is a trigger unlisted in the Triggers list at Gibberlings 3: CheckSpellState(O:Object*,I:State*splstate). It checks for values in SPLSTATE.IDS, where you can add your own lines. Preferably within the scope of 255. Positions greater than 255 don't work uniformly. And don't use 248, please, it's my line for TAUNTED. So to mark a creature for a particular condition, you add a line of your own to that file, then use effect 328, Set State, and click on the bottom of that to change to the IWD2 mode. (And to think yesterday I enchanted broomsticks.) After you switch, the list will expand and you'll be able to select your state. This will mark your creature, and you can put your saving throw, if any, at this point. Your subsequent effects don't need to include more saves this way.

 

Check for the marked creature either from a script, e.g. CheckSpellState(TenthNearest,STATE), as you have to do if you intend to manipulate creature's AI. Doing it from effects messes up their scripts. But for other applications you can detect marking from the effects by using effect 326 - Apply effects list. Scroll down in the Creature Type list and select whether the effect is going to apply only to creatures in your state or only to those not in it. You can then fine-tune the scope through spells' target fields - Everyone etc. Also you can use successive Apply effects list effects to further filter out valid targets, e.g. make your effect apply only to creatures of good alignment, then among them only to those in your custom state, then among those only to members of a certain race and so on.

 

I just ask you to be frugal with lines in SPLSTATE.IDS and, when you make your mod and include your file in it, say in the readme which positions you have claimed, for compatibility. You can use the same position for various kinds of marking. For example, I intend to use TAUNTED outside of the Taunt spell, if I need to to single out particular creatures.

 

How to reset a creature's state? It should end after the duration, or you can force a spell on it that cancels the first spell, by name. It's in the effects. But now here is a question for those who know more about spell states: what happens when a spell state expires or is removed? Does the creature get assigned to state NORMAL? Or does the state just go away? In that case, when is a creature NORMAL? Also, can a creature be in several spell states at once? This should be possible, since it can be under various enchantments at the same time, but I would like confirmation. For comparison, SPECIFIC.IDS has definite "states" that aren't compatible. If you are MAGIC, you are not NON-MAGIC.

 

tumblr_mlbw6mrLBa1s4zjvuo1_500.gif


Edited by temnix, 31 July 2016 - 11:58 AM.


#5 Fiann of the Silver Hand

Fiann of the Silver Hand
  • Member
  • 286 posts

Posted 31 July 2016 - 07:25 PM

Considering all the checks and balances in place already for compatibility, I am surprised about this SPLSTATE situation. Can a veteran modder confirm that this is the Wild West?

Edited by Fiann of the Silver Hand, 01 August 2016 - 12:15 AM.


#6 temnix

temnix
  • Member
  • 983 posts

Posted 05 August 2016 - 09:59 AM

While I also want to know about lines taken up in that file (so I can adapt my own file), we must expect the checks and balances to be challenged every time a fresh mod appears. It's just something to be prepared for. Anybody who decides to make new spells or simply effects that are more than just variations on the old - do damage, heal damage, summon a creature - is going to have to add entries not only to SPLSTATE, but also to MISSILE and PROJECTL, as I already have. I want very much for us all to combine all these changes so they don't override each other, and perhaps there is a way to do that through appending in Weidu, I don't know enough about that program to say, or maybe we can put together a list of positions taken up so. This certainly deserves a separate thread. A common list would be not only convenient but a synergic best for every modder who works with effects, as we could then use each other's mods with ease and in peace of mind. That said, there are going to be incompatible projects in principle. I realize, for example, after looking over it, that the Spell Revisions mod is not going to be compatible with spell alternatives I'm preparing. The approach and intentions behind those changes and ones I'm working on are completely different. So, just as it's impossible to put two buildings on one spot, players are going to have to decide which version they like more. What I hope we can achieve is modular compatibility at least - so that some parts of mods can be overridden by others without making the remainder dysfunctional.