Keeping last hero level when recreating another hero

Yoshii

New Member
Reaction score
74
I have a problem with map,I want to make it so that if a hero(ex level 2) decide to recreate his character(thus removing it from game) and chose another from the shop,i want the new unit to keep same level as the last hero.I tryed using interger arrayanddindt work out.
Code:
Recreate hero
Action:Set HeroLevel[(Player number of (Triggering player))] = (Level of (Triggering unit))

then the buying hero trigger:
ChoseHero
    Events
        Unit - A unit Sells a unit
    Conditions
    Actions
        Unit - Remove (Buying unit) from the game
        Hero - Set (Sold unit) Hero-level to HeroLevel[(Player number of (Triggering player))], Hide level-up graphics
this aint wokring as the new hero is still Level 1
 
E

Elf-Beast

Guest
Yoshii said:
I have a problem with map,I want to make it so that if a hero(ex level 2) decide to recreate his character(thus removing it from game) and chose another from the shop,i want the new unit to keep same level as the last hero.I tryed using interger arrayanddindt work out.
Code:
Recreate hero
Action:Set HeroLevel[(Player number of (Triggering player))] = (Level of (Triggering unit))

then the buying hero trigger:
ChoseHero
    Events
        Unit - A unit Sells a unit
    Conditions
    Actions
        Unit - Remove (Buying unit) from the game
        Hero - Set (Sold unit) Hero-level to HeroLevel[(Player number of (Triggering player))], Hide level-up graphics
this aint wokring as the new hero is still Level 1

Trigger 1
Events: A unit gains a level
Conditions: Owner of unit is player 1
Actions: Set P1HeroLevel = level of leveling hero

Trigger 2
Events: Unit - a unit sells a unit
Conditions: Selling unit belongs to player 1 equal to true
Actions: Remove Buying unit from game
Hero - Set hero level of purchased unit to P1HeroLevel

Repeat the variables for each player with a hero
I hope this works . . . . :)
 

Luth

Lex Luthor!
Reaction score
41
I like his array idea...


Trigger 1
Events: A unit gains a level
Conditions: Unit is a Hero is Equal to True
Actions: Set HeroLevel[(Player number of (Owner of (Triggering unit)))] = Level of (Triggering Unit)

Trigger 2
Events: Unit - a unit sells a unit
Conditions:
Actions: Remove Buying unit from game
Hero - Set hero level of purchased unit to HeroLevel[(Player number of Owner of (Sold unit))]
 

Yoshii

New Member
Reaction score
74
Luth said:
I like his array idea...


Trigger 1
Events: A unit gains a level
Conditions: Unit is a Hero is Equal to True
Actions: Set HeroLevel[(Player number of (Owner of (Triggering unit)))] = Level of (Triggering Unit)

Trigger 2
Events: Unit - a unit sells a unit
Conditions:
Actions: Remove Buying unit from game
Hero - Set hero level of purchased unit to HeroLevel[(Player number of Owner of (Sold unit))]

thx lol my error was that I put owner of triggering UNit instead of Sold Unit
 

Luth

Lex Luthor!
Reaction score
41
Happy to help. Happier for rep. ;)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top