Jump to content


Photo

Making a consumable item unusable in combat


5 replies to this topic

#1 Aquadrizzt

Aquadrizzt
  • Modders
  • 94 posts
  • Gender:Male

Posted 07 May 2017 - 02:34 PM

Is it possible to make a consumable item unusable in combat via some flag or otherwise? I know it's trivial for spells, but the specific application I need requires an item that cannot be used in combat. 


Tome and Blood: Expanded Options for Arcane Spellcasters 
 
Monastic Orders of Faerun: Expanded Options for Monks 

#2 Avenger

Avenger
  • Modders
  • 3675 posts
  • Gender:Male
  • Location:Hungary

Posted 08 May 2017 - 06:38 AM

Not trivial. If it has only 1 use, then you can do it with a spell that would remove the item. 



#3 subtledoctor

subtledoctor
  • Modders
  • 1995 posts
  • Gender:Male

Posted 08 May 2017 - 08:38 AM

The hacky way:

Item1 casts Spell1 and Spell2

Spell1 has the "non-combat" flag. It triggers the desired effect, and adds a short 206 protection against Spell2.

Spell2 creates a copy of Item1 in the caster's inventory.

So the item is used and burns itself up in any event, but if done in combat, the effect fizzles and the player still has the item. If used outside combat, the effect happens and the creation of the new item is prevented.

Would only work with single-use items.

Faiths & Powers: Spell spheres and kit pack for priests and paladins
Might & Guile: Tweaks and kits for warriors and rogues
Scales of Balance: Game tweaks and rule overhauls
NPC_EE: More options for NPCs in BGEE, SoD, & BG2EE


#4 kjeron

kjeron
  • Members
  • 47 posts

Posted 08 May 2017 - 09:50 AM

Spell1 has the "non-combat" flag. It triggers the desired effect, and adds a short 206 protection against Spell2.
 

The flag only works on normal spell-casting, forcing spells through opcodes (146/258/326/etc...) ignores the flag.

 

Worst case, you could have Baldur.bcs or each area.bcs apply an area-wide spell every round while combat counter is active, using opcode 182, param2=1 to disable the item type.  Item type 13(food) defaults to the quick-item slots and is scarcely used, you could switch the few items using it to either 0(miscellaneous) or 12(potion), and use it exclusively for non-combat consumables.



#5 Jarno Mikkola

Jarno Mikkola

    The Imp

  • Modders
  • 5973 posts
  • Gender:Male
  • Location:The town where the dead haven't keeled over, yet. In Finland.

Posted 08 May 2017 - 11:48 AM

Worst case, you could have Baldur.bcs or each area.bcs apply an area-wide spell every round ...

Why not make the food just take a long time to consume a good amount of ?

Like for example, make it restore 1 hit point of health ... it takes 6 seconds to be reused so(as a round in real time)... so getting 20 hit points in a fight that's over in 4 rounds is quite impossible especially if you apply either a speed penalty or say make it's consuming take time(as you have to cast the spell, with a spell casting timer). Scripting anything like this to a cheesing baldur.bcs is INSANE !!!!

Edited by Jarno Mikkola, 08 May 2017 - 11:50 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 stable mods you ever really could want to Infinity Engine games.


#6 Creepin

Creepin
  • Members
  • 150 posts
  • Gender:Male
  • Location:Moscow

Posted 08 May 2017 - 12:53 PM

Worst case, you could have Baldur.bcs or each area.bcs apply an area-wide spell every round while combat counter is active

This technically would work. But it is worth mentioning that this is not merely "worst case", but monstrous, terrifying case. Baldur.bcs is already stuffed by every modder and his dog with heaps of random trash, making game laggy as hell. Please don't teach people this awful idea of adding more to it. If anything, only things of utmost, gamechanging importance should find their way there, not some little tricks. And really, bog down hundreds of area scripts for the sake of single usability effect? Way too much game engine abuse for that little outcome.


Edited by Creepin, 08 May 2017 - 12:53 PM.




Reply to this topic



  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users