Author Topic: [Scripts] Domino Spell (Somewhat Epic.)  (Read 676 times)

0 Members and 1 Guest are viewing this topic.

Platinum Dryym

  • Supreme Member
  • *****
  • Posts: 4254
  • What's yours is mine. ~TM's Resident Master Thief~
  • Awards Members who have unlocked the robotic avatar Awarded to exemplary forum members 2 years on site+300 posts 3 years on site+600 posts Site art contributions/TPs in-game/Contest winners 1 year on site+100 posts
    • View Profile
    • Awards
  • Xbox: dryym
[Scripts] Domino Spell (Somewhat Epic.)
« on: October 08, 2016, 05:49:31 PM »
Alright, So normally I wouldn't make a topic for something as mundane as a spell, But I think this one is unique to anything anyone else has done with scripts so far.


Anyway. I have created a witch spell known as "Domino" which is totally original and definitely not in any way stolen from Dishonored 2.


To work the spell, You must select it and cast it towards multiple targets. Once you do, Their health bars will become linked. This means that any damage done to one enemy will be translated to all other enemies linked to them.

This is proportionate to the HP of each mob. So dealing 1 damage to a mob with 10  max HP will deal 10 damage to a mob with 100 HP that is linked to it.

It also should be multiplayer compatible in theory. But scripts that should work fine for multiplayer in theory don't always do so well in practice.


Anyways, On to the script.


Ignore the Essencia, Karma, And Cooldown stuff. That's just specific to how I do my spells. Really, The only parts relevant to the script are the var line and script line.




This is the meat of the script, The loop.
This runs on all targeted entities until they die.

The first section of the script queries whether or not the entity running the script is dead. If so, It changes the global HP history value to 0 (Necessary because if I did not do this, A mob dying would not kill the other mobs.) Then it exits the script instance.

The next line changes the var for the percentage of max HP from the last iteration of the loop to the old percentage of max HP. After that it calculates the current percentage of max HP then removes anything after the decimal to make it a whole number.

I am not entirely sure if this last step is necessary, But it is possible to have a non whole percentage and that would probably mess with the next part.


The last portion of the script is what puts it all together.

First it checks to see if there has been any change in HP since the last iteration of the loop. If there has, It will set the global caster history to the caster ID determined in the previous script. Then it will set the global HP history to the HP percentage value.

If there has been no change in HP then it checks if the HP percentage matches the HP history, And if the caster ID of this instance of the script is the same as the caster history.

If so then it does some fancy math talk that just means "Set my HP to Domino\HP%"

Then it loops.



There are still some problems I need to fix. One being that this does not handle regenerating entities well. I need to find a way around that. Currently what happens is that the nonregenerative entity basically becomes immortal because the regenerating entity's HP is dominant due to it updating faster.


I am not sure what would happen if you linked two regenerating players together, But I suspect they may become gods.
It would only be possible to kill them if you attacked them both at the same time.

Another slight issue is that despawning does not register to the script as having 0% HP. But I think IsMobCount is an easy fix for that.



I hope that after seeing this, Craig may add some official networking commands and conditionals to PC. The TM script engine is not meant for this. I had to do kind of a hacky solution to make this work to any extent.

It is fantastic though IMO. Killing 20 goblins in one sword swing is sooooo satisfying.

Creator of the term "Deathmine "
Jared [19|Oct 07:12 PM]: "It changes everything" Dryym

Godlyvex5

  • Fresh Meat
  • *
  • Posts: 7
    • View Profile
    • Awards
  • Xbox: Godlyvex5
  • Steam: Godlyvexx
Re: Domino Spell (Somewhat Epic.)
« Reply #1 on: July 11, 2017, 11:47:14 PM »
Is this two different scripts? If so, what should their names be?

TheDestinedCrab

  • Legendary Member
  • *****
  • Posts: 1310
  • Did you see that? Me neither.
  • Awards 3 years on site+600 posts Donated a giveaway prize. (Must be a prize of cash value.) 2 years on site+300 posts 1 year on site+100 posts
    • View Profile
    • Awards
Re: Domino Spell (Somewhat Epic.)
« Reply #2 on: July 12, 2017, 04:36:00 PM »
Another brilliant script Dryym. Wish I was as good as you. I wonder if we'll start seeing more maps with advanced scripts such as this one soon.

It'd be great to see more scripts.
Crab.

Is this two different scripts? If so, what should their names be?

Whilst this script isn't mine I think I can help you.

The first picture is one script. Dryym has used the name magic/naturestaff/spells/dominoe/spell

The second and third picture is the next script. I believe Dryym has called this one dominoe loop.

You can change their names but you would have to change it where they are used in the script aswell.

Hope you found this useful,
Crab.
Thanks Gold Knight for the amazing sig!

Platinum Dryym

  • Supreme Member
  • *****
  • Posts: 4254
  • What's yours is mine. ~TM's Resident Master Thief~
  • Awards Members who have unlocked the robotic avatar Awarded to exemplary forum members 2 years on site+300 posts 3 years on site+600 posts Site art contributions/TPs in-game/Contest winners 1 year on site+100 posts
    • View Profile
    • Awards
  • Xbox: dryym
Re: Domino Spell (Somewhat Epic.)
« Reply #3 on: July 12, 2017, 06:06:26 PM »
Another brilliant script Dryym. Wish I was as good as you. I wonder if we'll start seeing more maps with advanced scripts such as this one soon.

It'd be great to see more scripts.
Crab.

Is this two different scripts? If so, what should their names be?

Whilst this script isn't mine I think I can help you.

The first picture is one script. Dryym has used the name magic/naturestaff/spells/dominoe/spell

The second and third picture is the next script. I believe Dryym has called this one dominoe loop.

You can change their names but you would have to change it where they are used in the script aswell.

Hope you found this useful,
Crab.

You are partially correct with the names. I use aliases very heavily in my scripts so technically, All scripts that call to this use the "Script [Domino]" and the domino that script calls to a script with an alias of "DominoLoop". But the names literally do not matter as long as you match them up.

Creator of the term "Deathmine "
Jared [19|Oct 07:12 PM]: "It changes everything" Dryym

Jaz

  • Supreme Member
  • *****
  • Posts: 2953
  • ヽ(`⌒)ノ
  • Awards Awarded to exemplary forum members 3 years on site+600 posts Was in the top 10 of the forum stats page as of 4/12/15 Former MotM winners 4 years on site+1000 posts Donated a giveaway prize. (Must be a prize of cash value.) 2 years on site+300 posts 1 year on site+100 posts
    • View Profile
    • cluckinbellhappychicken
    • Awards
  • Xbox: Jaz the MAN 2
  • PSN: Jaz_the_MAN_2
  • Steam: Jaz the MAN 2
Re: Domino Spell (Somewhat Epic.)
« Reply #4 on: July 13, 2017, 05:13:42 AM »
Got any vids of this?

"I know not with what weapons World War III will be fought, but World War IV will be fought with sticks and stones" ~ Albert Einstein