nil is nil, right?

Hi guys,
I'm having a little trouble understanding something.
Consider the following:
However, if I try to use the same mechanism in a trigger, I see different behavior:
My only guess is that the game's logic in this case considers anything != true to be false, which is a fallacy. If anyone can shed a little light on this, I'd be most grateful.
Thanks in advance,
Eglin
I'm having a little trouble understanding something.
Consider the following:
- Code: Select all
store = Storage(Object)
store.set("bar")
if store.get("foo") then print "bar" end
However, if I try to use the same mechanism in a trigger, I see different behavior:
- Code: Select all
<TRIGGER value="DOESN'T MATTER WHICH">
return (Storage(Object()).get("target") ~= nil)
</TRIGGER>
- Code: Select all
<TRIGGER value="DOESN'T MATTER WHICH">
return (Storage(Object()).get("target"))
</TRIGGER>
My only guess is that the game's logic in this case considers anything != true to be false, which is a fallacy. If anyone can shed a little light on this, I'd be most grateful.
Thanks in advance,
Eglin