Jump to content


Photo

An opcode suddenly stopped working


  • Please log in to reply
6 replies to this topic

#1 temnix

temnix
  • Member
  • 983 posts

Posted 21 January 2018 - 06:36 PM

The Set Global Variable opcode has suddenly stopped working on my setup. I've had it as part of a spell's effect, then moved it to global effects of the spell, tried adding a different one to Armor, all the while keeping a global check on top of BALDUR.BCS. I wish I could say it's some kind of oversight on my part, but it's just not registering. It's under 8 letters, too... The opcode still works in items, as a worn global effect, but the same effect in items' abilities is again not being seen by the engine.

 

Has anyone else had something like this happen to him?



#2 GeN1e

GeN1e

    A very GAR character

  • Modder
  • 1604 posts

Posted 21 January 2018 - 08:02 PM

I would suspect the target parameter. Or probability. Failing that, immunities or projectile, though it doesn't sound like you have a complex structure there.


Edited by GeN1e, 21 January 2018 - 08:04 PM.

Retired from modding.


#3 temnix

temnix
  • Member
  • 983 posts

Posted 22 January 2018 - 09:56 AM

I have a ring charged with a Caster-targeted effect. The effect is Set Global, Self, Set, 1, 100. And BALDUR.BCS has a trigger on top to react to that global and kill Player1, just as a check. This same effect as a global effect of the item kills the character instantly on a loading. Inside the ability or in a spell - nothing happens.

 

Reinstalling didn't help... But when I took the ring to another laptop with BG:EE installed and reproduced the steps there, he died alright. What the hell? Are there some files that don't get replaced with reinstallation?


Edited by temnix, 22 January 2018 - 10:11 AM.


#4 GeN1e

GeN1e

    A very GAR character

  • Modder
  • 1604 posts

Posted 22 January 2018 - 12:11 PM

So, running this
COPY_EXISTING potn26.itm override
  LPF ADD_ITEM_EFFECT INT_VAR opcode=265 target=1 parameter1=1 STR_VAR resource=testvar END

and then throwing the bomb ingame and entering C:GetGlobal("testvar","global") yielded 1 for me.

 

If you only one installation on one machine, i.e. you don't accidentally look in editor at one game and test another; and the script is actually working; and the effect itself works too under some circumstances; then there has to be some obvious error or typo in your blind spot.


Retired from modding.


#5 temnix

temnix
  • Member
  • 983 posts

Posted 22 January 2018 - 02:50 PM

Well, of course it works on yours. Yours isn't broken!  :lol2:  It used to work on this machine too only yesterday. No, there is just one installation here. That's the weirdest thing: that I just put the ring on a flash drive and took it to my other computer's override, edited BALDUR.BCS to match, and the character died when I used the power. But not on the first machine. I don't see what could be wrong, there is just this BALDUR check and the ring, whose effect, as I said, works fine when it's taken out of the abilities and worn as a global...

 

Maybe I should delete the game files manually and install from scratch. I have been doing some rather tantric things with the birds the other day, maybe that finally did it for the engine here. I may have to carry over the other setup, if that idea fails... Well, thanks for trying that out, anyway...

 

P.S. While you're here, what's the Weidu code for unsetting a flag in a cre file? You once told me, but that was months ago and in some forsaken mod.


Edited by temnix, 22 January 2018 - 03:11 PM.


#6 GeN1e

GeN1e

    A very GAR character

  • Modder
  • 1604 posts

Posted 22 January 2018 - 03:58 PM

I have rather vague recollections that equipped item effects apply in some specific order relative to effects attached to CRE directly. I.e. if you have immunity to that effect, it might work properly against activated abilities, but be ignored by equipped effects. Don't take my word for it, though, I don't remember exact specifics.

 

WRITE_BYTE offset & `BIT0 // remove the first bit flag

WRITE_BYTE offset | BIT1 // set the second bit flag

Or WRITE_SHORT / WRITE_LONG, if the field is large enough and you don't care to count it by the byte.


Retired from modding.


#7 temnix

temnix
  • Member
  • 983 posts

Posted 23 January 2018 - 12:06 PM

I don't have an immunity to that... Thanks for the bits bit.