[ian-reeds-games] Re: for Craig: scripting suggestions

  • From: "Craig Brett" <dmarc-noreply@xxxxxxxxxxxxx> (Redacted sender "craigbrett17@xxxxxxx" for DMARC)
  • To: ian-reeds-games@xxxxxxxxxxxxx
  • Date: Sat, 28 Feb 2015 14:14:04 +0000

Hey Carlos,

I think I'd want to check with Ian first before implementing some of these, but they seem reasonable. Some thoughts though.

1. Seems reasonable to do, I think, but I'm not sure whether should be just exposing more properties for scripters, rather than making you guys dig through the raw flags and reconstructing things yourself. I'd consider it though. 2. Yes, I think this should be doable. Though if you want permanent effects to change stats, aren't there ways of doing that with equipped weapons anyway? I'm not sure - most of the map packs I play don't use items. 3. You can already remove effects by simply removing an item from the effects list, or array in JS, of a unit. I'm not sure if this triggers the after_effect_removed logic, though. 4. This would be good. Complicated, but good. This code doesn't necessarily all live in one place, so I'm not sure how difficult it will be to implement. But I'll have a look.

On 22/02/2015 09:13, Carlos Macintosh wrote:
Hi, I have some scripting suggestions that would really extend the power of scripting without being of too much effort I think. 1: Give map, unit, effect, skill, item and point objects a Flags list that contains all normal flags on the unit as key-value pairs. I was thinking you could just grab the keys and values from the individual files themselves. It only has to be read-only so that I can act on what the flag contains. My idea is to create a damage reflection flag that reflects damage based on the skill used on it. Skills with stronger health_inflict flags would reflect more damage. But the possibilities are endless really. 2. add on_item_equipped and on_item_unequipped events that we could tie to scripts. This would allow items to grant permanent effects when equipped, then remove the effects when unequipped. It could also be used to mod maximums of each point such as a breastplate of constitution that gave +50 extra health. 3. Create a shared.removeEffect(unit u, tile t, effect e) function that searches for the effect e on unit u and tile t, and removes it, applying the effect_removed event of course. 4. Create a unit.damageUnit(unit u, int amount, damageType t) which would deal amount damage to unit u using damage type t, factoring in protections that target unit u has, and inflict mods that source unit u has. All of these will really be beneficial in my current map pack project. Please consider allowing the engine to support these flags!



Other related posts: