Making a naix like corpse jump spell but....

Astal

New Member
Reaction score
1
I need to make a spell like naix corpse jump. I want my hero to jump into another heros corpse basically possessing them. I want my hero to die and their hero to die. So basically it would jump into them kill them and create and exact clone of them that I have control over. A clone similar to geomancers clones.

I havent the slightest idea how to do this. Ive tried with images, and ive tried with possession. Neither work. Possession gives me permanent control of their hero for the rest of the game, so when it dies, it respawns for me, not them lol.

If anyone can help me out a little it would be much appreciated.

Edit: You guys think this would work. Its 3 seperate scripts

Code:
Take A Host
    Events
        Unit - A unit Finishes casting an ability
    Conditions
        (Ability being cast) Equal to Take A Host 
    Actions
        Set Goauld = (Casting unit)
        Unit - Change ownership of (Target unit of ability being cast) to (Owner of Goauld) and Change color
        Unit - Cause Goauld to damage Goauld, dealing 10000.00 damage of attack type Hero and damage type Normal
        Countdown Timer - Start Time_Left_In_Host as a One-shot timer that will expire in 60.00 seconds

Code:
Get Previous Owner
    Events
        Unit - A unit Changes owner
    Conditions
    Actions
        Set Host_Player = (Previous owner)

Code:
Release Host
    Events
        Time - Time_Left_In_Host expires
    Conditions
    Actions
        Unit - Change ownership of Goauld to Host_Player and Change color
        Unit - Cause (Ownership-changed unit) to damage (Ownership-changed unit), dealing 10000.00 damage of attack type Hero and damage type Normal
 

Sooda

Diversity enchants
Reaction score
318
First explain what are Geomancer and Naix? Not everyone play DotA (Though I am. It just shows your ignorance when giving half info.).

Did multiple unit compatible ability, means more than one unit can cast this ability at same time without any conflicts.

Kills caster and gives control of target for 60 seconds.
Code:
Seppuku
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Take A Host
    Actions
        -------- No additional actions before local variable declaration! --------
        -------- Local variable declaration start --------
        Custom script:       local unit saveLastUnit = bj_lastCreatedUnit
        Custom script:       local unit saveLastLoadUnit = bj_lastLoadedUnit
        Custom script:       local unit caster = GetTriggerUnit()
        Custom script:       local unit target = GetSpellTargetUnit()
        Custom script:       local integer oldPlayerIndex = GetPlayerId(GetOwningPlayer(target)) + 1 // GUI does -1 to get real player index
        Custom script:       local integer saveLoopA = 0
        -------- Local variable declaration end --------
        -------- Last Created Unit points to caster --------
        Custom script:       set bj_lastCreatedUnit = caster
        -------- Last Restored Unit points to target --------
        Custom script:       set bj_lastLoadedUnit = target
        -------- Ability actions start --------
        -------- Killing caster --------
        Unit - Kill (Last created unit)
        -------- Giving targeted unit to casting unit owner. --------
        Unit - Change ownership of (Last restored unit) to (Owner of (Last created unit)) and Change color
        Wait 60.00 game-time seconds
        -------- After each wait we need to restore global variable values from local ones. --------
        Custom script:       set bj_lastCreatedUnit = caster
        Custom script:       set bj_lastLoadedUnit = target
        -------- Storing 'For Loop A' global value to later restore it. --------
        Custom script:       set saveLoopA = bj_forLoopAIndex
        -------- Getting old owner index which is stored to 'For Integer A' variable. --------
        Custom script:      set bj_forLoopAIndex = oldPlayerIndex
        Unit - Change ownership of (Last restored unit) to (Player((Integer A))) and Change color
        -------- Restoring used global variable values. --------
        Custom script:       set bj_lastCreatedUnit = saveLastUnit
        Custom script:       set bj_lastLoadedUnit = saveLastLoadUnit
        Custom script:       set bj_forLoopAIndex = saveLoopA
        -------- Nulling needed local variables --------
        Custom script:       set saveLastUnit = null
        Custom script:       set saveLastLoadUnit = null
        Custom script:       set caster = null
        Custom script:       set target = null
I assume you got triggers to resurrect dead heroes that's why I didn't revived caster in the end of ability.
 

Astal

New Member
Reaction score
1
First explain what are Geomancer and Naix? Not everyone play DotA (Though I am. It just shows your ignorance when giving half info.).

Did multiple unit compatible ability, means more than one unit can cast this ability at same time without any conflicts.

Kills caster and gives control of target for 60 seconds.
Code:
Seppuku
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Take A Host
    Actions
        -------- No additional actions before local variable declaration! --------
        -------- Local variable declaration start --------
        Custom script:       local unit saveLastUnit = bj_lastCreatedUnit
        Custom script:       local unit saveLastLoadUnit = bj_lastLoadedUnit
        Custom script:       local unit caster = GetTriggerUnit()
        Custom script:       local unit target = GetSpellTargetUnit()
        Custom script:       local integer oldPlayerIndex = GetPlayerId(GetOwningPlayer(target)) + 1 // GUI does -1 to get real player index
        Custom script:       local integer saveLoopA = 0
        -------- Local variable declaration end --------
        -------- Last Created Unit points to caster --------
        Custom script:       set bj_lastCreatedUnit = caster
        -------- Last Restored Unit points to target --------
        Custom script:       set bj_lastLoadedUnit = target
        -------- Ability actions start --------
        -------- Killing caster --------
        Unit - Kill (Last created unit)
        -------- Giving targeted unit to casting unit owner. --------
        Unit - Change ownership of (Last restored unit) to (Owner of (Last created unit)) and Change color
        Wait 60.00 game-time seconds
        -------- After each wait we need to restore global variable values from local ones. --------
        Custom script:       set bj_lastCreatedUnit = caster
        Custom script:       set bj_lastLoadedUnit = target
        -------- Storing 'For Loop A' global value to later restore it. --------
        Custom script:       set saveLoopA = bj_forLoopAIndex
        -------- Getting old owner index which is stored to 'For Integer A' variable. --------
        Custom script:      set bj_forLoopAIndex = oldPlayerIndex
        Unit - Change ownership of (Last restored unit) to (Player((Integer A))) and Change color
        -------- Restoring used global variable values. --------
        Custom script:       set bj_lastCreatedUnit = saveLastUnit
        Custom script:       set bj_lastLoadedUnit = saveLastLoadUnit
        Custom script:       set bj_forLoopAIndex = saveLoopA
        -------- Nulling needed local variables --------
        Custom script:       set saveLastUnit = null
        Custom script:       set saveLastLoadUnit = null
        Custom script:       set caster = null
        Custom script:       set target = null
I assume you got triggers to resurrect dead heroes that's why I didn't revived caster in the end of ability.

Wow your a much better coder than I. Where did you learn this stuff? Im guessing you program in some language such as C or C++, thank you for the code very much. Yeah I have resurrecting triggers.
 

Sooda

Diversity enchants
Reaction score
318
I have tinkered with World Editor more than 4 years I think. Learned JASS which is pseudo programming language used by Warcraft III maps. I don't know any real programming language :p Glad you like it.
 

Psiblade94122

In need of sleep
Reaction score
138
the code is in JASS which is wc3's language

As for geomance and niax, niax is a goul and the geomancer... well it uses thegeomancer model (nutral hostle creeps, kiblod i think)
 

Astal

New Member
Reaction score
1
I have tinkered with World Editor more than 4 years I think. Learned JASS which is pseudo programming language used by Warcraft III maps. I don't know any real programming language :p Glad you like it.

only problem im having is this line

Unit - Change ownership of (Last restored unit) to (Player((Integer A))) and Change color

I dont have an integer A to pick from because its never declared in the script editor variables table. Unless im doing something wrong. I understand a good bit of the rest and have it all typed out.

Edit: nm i see i actually use player and the index is For loop A ok... Im gonna try it out now. Im gonna have to get a book on jass or somthing lol
 

Ghostwind

o________o
Reaction score
172
Corpse jump? I know what naix is in dota but there is no ability called "corpse jump".
 

Astal

New Member
Reaction score
1
Corpse jump? I know what naix is in dota but there is no ability called "corpse jump".

its his ult. I dont know the exact name but its where he hides in a creep.

BTW the code isnt working :( it just kills me after I cast. I dont get control of the unit i cast it on.

Code
Code:
Take A Host
    Events
        Unit - A unit Finishes casting an ability
    Conditions
        (Ability being cast) Equal to Take A Host 
    Actions
        --------  No additional actions before local variable declaration! --------
        -------- Local variable declaration start --------
        Custom script:   local unit saveLastUnit = bj_lastCreatedUnit
        Custom script:   local unit saveLastLoadUnit = bj_lastLoadedUnit
        Custom script:   local unit caster = GetTriggerUnit()
        Custom script:    local unit target = GetSpellTargetUnit()
        Custom script:   local integer oldPlayerIndex = GetPlayerId(GetOwningPlayer(target)) + 1
        Custom script:   local integer saveLoopA = 0
        -------- Local variable declaration end --------
        -------- Last Created Unit points to caster --------
        Custom script:   set bj_lastCreatedUnit = caster
        -------- Last Restored Unit points to target --------
        Custom script:   set bj_lastLoadedUnit = target
        -------- Ability actions start --------
        -------- Killing caster --------
        Unit - Kill (Last created unit)
        -------- Giving targeted unit to casting unit owner. --------
        Unit - Change ownership of (Last restored unit) to (Owner of (Last created unit)) and Change color
        Wait 60.00 game-time seconds
        -------- After each wait we need to restore global variable values from local ones. --------
        Custom script:   set bj_lastCreatedUnit = caster
        Custom script:   set bj_lastLoadedUnit = target
        -------- Storing 'For Loop A' global value to later restore it. --------
        Custom script:   set saveLoopA = bj_forLoopAIndex
        -------- Getting old owner index which is stored to 'For Integer A' variable. --------
        Custom script:   set bj_forLoopAIndex = oldPlayerIndex
        Unit - Change ownership of (Last restored unit) to (Player((Integer A))) and Change color
        -------- Restoring used global variable values. --------
        Custom script:   set bj_lastCreatedUnit = saveLastUnit
        Custom script:   set bj_lastLoadedUnit = saveLastLoadUnit
        Custom script:   set bj_forLoopAIndex = saveLoopA
        -------- Nulling needed local variables --------
        Custom script:   set saveLastUnit = null
        Custom script:   set saveLastLoadUnit = null
        Custom script:   set caster = null
        Custom script:   set target = null
 

Astal

New Member
Reaction score
1
Hmm the only other thing I can think of is using possess but scripting it to unpossess on death. there is no unpossess skill however.


Damn


Just a question here, shouldnt this code work to give control back and forth to a unit?

Code:
Untitled Trigger 002
    Events
        Unit - A unit Finishes casting an ability
    Conditions
        (Ability being cast) Equal to Take A Host 
    Actions
        Set Host_Player = (Owner of (Target unit of ability being cast))
        Set Host_Unit = (Target unit of ability being cast)
        Unit - Change ownership of (Target unit of ability being cast) to (Owner of (Casting unit)) and Change color
        Wait 10.00 game-time seconds
        Unit - Change ownership of Host_Unit to Host_Player and Change color
 

Astal

New Member
Reaction score
1
Bahhh fawk it, im just gonna use charm and give it a duration. I cannot even get the most basic script to work for this. Thanks for trying to help me guys.
 

Sooda

Diversity enchants
Reaction score
318
Yes your last trigger should change ownership and after 10 seconds gives hero back.

I did test map with your quoted trigger (was it mine? :) ), works perfectly well, try it out. It does not have comments though. Learn Storm Bolt and cast it on enemy to possess it.

Your 'Take A Host' needs to target units. If 'Take A Host' is channeling spell try using event' Starts Channeling Ability' (don't know exact wording).
 

Attachments

  • Take Host Ability.w3x
    13.4 KB · Views: 157

Astal

New Member
Reaction score
1
Yes your last trigger should change ownership and after 10 seconds gives hero back.

I did test map with your quoted trigger (was it mine? :) ), works perfectly well, try it out. It does not have comments though. Learn Storm Bolt and cast it on enemy to possess it.

Your 'Take A Host' needs to target units. If 'Take A Host' is channeling spell try using event' Starts Channeling Ability' (don't know exact wording).

k, my map was acting up also. It wasnt saving right so many that had something to do with it.
 

PrisonLove

Hard Realist
Reaction score
78
why dont you just use charm with a duration, and then pause and hide the caster once he casts it. then once the charmed unit either dies or has the effect wear off, unpause and unhide the caster. im not sure if thats what "corpse jump" does, but i think its a good start point. unless of course you cant use charm on heroes or give it a duration, in which case, this wouldnt work, but im not big on charm so i dont know. give it a shot
 

Astal

New Member
Reaction score
1
See wtf, your code works perfectly in my map but mine doesnt lol. Unless the comments are messing it up. Oh well Ill be putting your name in my map for helping me. Its a sci-fi survival horror character based dota map. I checked over my code 3 times against yours and it was the same so I dunno what I missed.

Thank you so much for helping me.
 

Sooda

Diversity enchants
Reaction score
318
If all is same it must be global variables which conflict, but I made sure to save them and after wards restore.

Try deleting your made trigger and copy paste from one map to another my trigger, you can change between maps from Window drop down menu (Menus which are on top like File, Edit, View, etc).
 

Astal

New Member
Reaction score
1
If all is same it must be global variables which conflict, but I made sure to save them and after wards restore.

Try deleting your made trigger and copy paste from one map to another my trigger, you can change between maps from Window drop down menu (Menus which are on top like File, Edit, View, etc).

yeah thats what I ended up doing and it works great. Thank you
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top