I'm trying to make a consumable item that does only work outdoors. So I tried to use opcode 318 (Protection from spell) with splprot.2da type 0x106 (areatype) where area type doesn't match bit 0 (OUTDOORS).

NOT_OUTSIDE 0x106 0x01 9

But it doesn't seem to work. I also tried different match operators without success. Does this particular type even work?

For now I have to resort to the helper creature approach, but I'd rather do without it.

Edited by argent77, 31 March 2018 - 01:59 AM.

Imagination is more important than knowledge. Knowledge is limited; imagination encircles the world. - Albert Einstein

318/324/326 check the splprot status of the target of the spell. I'm not sure whether/how you can reasonably use areatype with a target.

(You can do a bit of fun target hacking, like I have a 248 on-hit effect wherevthe resulting .eff uses target 9 (original caster) and the resulting .spl uses target 2 (preset target) so now the on-hit effect evaluates the state/stat/etc. of the caster, to conditionally cast a spell at the target.)

I'm not so sure if target is really always needed. There are also checks for time of day and current chapter, which both don't really need a target. Unfortunately there are no area type checks in any of the vanilla EE games, so I can't really say if the problems lies with the splprot type or my implementation of it.

Imagination is more important than knowledge. Knowledge is limited; imagination encircles the world. - Albert Einstein

Location:The town where the dead haven't keeled over, yet. In Finland.

Posted 30 March 2018 - 06:32 AM

Unfortunately there are no area type checks in any of the vanilla EE games, so I can't really say if the problems lies with the splprot type or my implementation of it.

Erhm, the druid call lightning has ... the games .spl flag's has outdoors only flag.

Edited by Jarno Mikkola, 30 March 2018 - 06:32 AM.

Welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand.Here's how to install all the ... mods you ever really could want to Infinity Engine games. I removed the stable word from there as Roxanne began to add BS mods that are likely to break compatibility from the BWS.

I'm trying to make a consumable item that does only work outdoors. So I tried to use opcode 318 (Protection from spell) with splprot.2da type 0x106 (areatype) where area type doesn't match bit 0 (OUTDOORS).

NOT_OUTSIDE 0x106 0x01 9

But it doesn't seem to work. I also tried different match operators without success. Does this particular type even work?

For now I have to resort to the helper creature approach, but I'd rather do without it.

Not in my case. In addition to "Outdoors" I'm using a custom area type (added via areatype.ids) that has to be checked too. Using splprot.2da area type check would be perfect for my needs, if I could figure out how to make it work.

Imagination is more important than knowledge. Knowledge is limited; imagination encircles the world. - Albert Einstein

Location:The town where the dead haven't keeled over, yet. In Finland.

Posted 31 March 2018 - 02:33 AM

I... think there is a bug with the area type check

That's too bad. It means I have to keep using the helper creature for a while.

Depending on what you mean, you could use the area's own script as the "mark", as you can extend the script file with the needed scripting to do the actions... but that might be exactly what you try to avoid, I suppose.

Welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand.Here's how to install all the ... mods you ever really could want to Infinity Engine games. I removed the stable word from there as Roxanne began to add BS mods that are likely to break compatibility from the BWS.

There are other things you could do. You could extend the area scripts fir whatecer areas you're talking about to apply a spellstate to PCs while they are there. And then use 326/splprot to filter by that spellstate.

Still uses scripting, but it doesn't rely on firing a script (through a creature) as part of a spell being cast. Which for some reason I like to avoid.

Using a helper creature works well enough for now. There is a random delay between using the item and the helper creature script being fired, but it's small enough to be tolerable. I'll switch over using splprot effects when the area type check has been fixed.

Edited by argent77, 03 April 2018 - 09:56 AM.

Imagination is more important than knowledge. Knowledge is limited; imagination encircles the world. - Albert Einstein