Jump to content

Photo

Poison Sword Script Help

Script Help 2.50

  • Please log in to reply
15 replies to this topic

#16 linkinsphere

linkinsphere

    Junior

  • Members
  • Location:US

Posted 10 September 2016 - 09:27 PM

Elemental damage... The easiest way to do this without making huge engine modifications, is to put a flag on every weapon that you create, using a ->Misc[index].

Let's say, this:
 

WFLG_ICE = 01b;
WFLG_FIRE = 10b;
WFLG_SONIC = 100b;
WFLG_ELECT = 1000b;
WFLG_LIGHT = 10000b;
WFLG_DARK = 100000b;
WFLG_WATER = 10000000b;
WFLG_EARTH = 10000000b;

MISC_WFLAGS = 15;

void SetWeaponElement(lweapon l, int flag) { l->Misc[MISC_WFLAGS] |= flag; }
void SetWeaponElement(eweapon l, int flag) { l->Misc[MISC_WFLAGS] |= flag; }

bool GetWeaponElement(lweapon l, int element) { return l->Misc[MISC_FLAGS]&element != 0; }
bool GetWeaponElement(eweapon l, int element) { return l->Misc[MISC_FLAGS]&element != 0; }

You can handle weapon elemental damage with Link easily enough, but handling it with enemies is a right pain.

The easy option is to assign a ghost script to every enemy that gives enemies custom defence properties, but that can become problematic.

I do it globally, by changing the 'Script' defence based on a huge array that holds extended defs for every enemy in the game.

If you aren't modifying damage, but adding special properties (stun, freeze, burn, and so forth) to what weapons do, you can handle those with the global script by checking for collision, reading the weapon flag, and producing an effect.

Really, it's damage modification, and the inability to set every one of the ten script types as a unique weapon defence property, that make this tedious.

 

If you want any of the files from me, that work as an elemental damage system for enemies, using that list, let me know.

Sorry for the delay. But sure! Thanks a lot, bro! I'll get back to you on that when the time comes,





Also tagged with one or more of these keywords: Script, Help, 2.50

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users