Jump to content

What's with the negation operator?


i30817

Recommended Posts

Posted

It doesn't seem to work like any negation operator i've ever seen:

 

Maybe i'm being dumb but a AI script file with only (no sendtrigger):

 

IF
Trigger(0)
THEN
 RESPONSE #100
DisplayStringHead(Myself, ~trigger not~)
END

 

Never displays the string... ok.

 

But one with only:

IF
!Trigger(0)
THEN
 RESPONSE #100
DisplayStringHead(Myself, ~trigger not~)
END

Displays the string once (on load) and never afterwards, while i expected it to display every round

 

 

What sorcery is this!

This is not a NOT in a sensible language... one is not the dual of the other!

Posted

It makes no difference. Tried with 0, 1, 2, and 255. It seems SendTrigger and trigger accept arbitrary int values, unknown max (but larger than one).

 

BTW; i tried and it displayed once as expected:

IF
OnCreation()
THEN
 RESPONSE #100
  SendTrigger(Myself, 100)
  SendTrigger(Myself, 7000)
END
IF
Trigger(100)
Trigger(7000)
THEN
 RESPONSE #100
  DisplayStringHead(Myself, ~trigger not~)
END

 

It seems like "SendTrigger" may actually store the number in a list/array and not check a bitfield (7000). It seems kinda of a waste actually while a 128 or 256 mask set would work and plenty.

 

 

Now if only this bizarre negation behavior could be sorted out...

Posted

I also checked the compiled BCS file to see if the negation bit was ignored by the compiler in this trigger... no such luck.

 

 

There is Some kind of MAGIC happening since pressing a "key" (that has nothing to do with triggers) allows

IF
!Trigger(0)
THEN
 RESPONSE #100
	DisplayStringHead(Myself, ~trigger not~)
END

To trigger once

 

(but it's not because of another trigger being sent, because i tried to send one unconditionally with:

IF
True()
THEN
 RESPONSE #100
  SendTrigger(Myself, 100)
  Continue()
END
IF
!Trigger(0)
THEN
 RESPONSE #100
  DisplayStringHead(Myself, ~trigger not~)
END

and it didn't trigger automatically)

Posted

What might be happening is that some triggers are maybe badly programmed in the ultrageneral trigger handling function in the game, and return without inverting the result if the flag is set, effectively ignoring !

 

That would be tremendously dumb, but i don't give much for it being anything else.

 

Why would it !trigger onload though? Different code returns paths in those triggers maybe.

Posted

I have a cunning plan...

 

!TriggerOverride(Myself, Trigger(N))

 

BRB testing it.

 

Edit:

:rant:

Didn't work, same behavior. Possibly because the TriggerOverride hack by Ascension64 does not wrap the trigger in another trigger, "just" replaces the Object value at runtime?

 

:wallbash:

 

BTW, IESDP should have a note on some triggers to say they ignore "!"

Ive found that Trigger() and HotKey() have this problem, there may be others. That is, if my speculation about this being a bug is right.

Posted

its your logic i think. or their logic which i understand a bit better.

 

HotKey() corresponds to an instant press of an actual key. Trigger() corresponds to the action SendTrigger(). both cases are follow thru triggers of a prior action. either player presses a key or a script/dialog sends the trigger. There was no reason to negate either trigger. The corresponding actions won't take place without either trigger being true. All other script blocks aren't affected by either trigger, so all they needed was valid positive checks.

You are attempting to do something that was never considered when the scripting language was developed for the games. Which would explain the odd behaviour that you are seeing, the game doesn't know how to handle it.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...