repick hero help

thomas9999

New Member
Reaction score
0
Hey i want to know how to make it so that you can repick a hero
i know how to make it so that u go in a circle and make a wisp where heroes are but when you do repick you lose all your items so i was wondering how to repick and keep items??
thanks
 

istar

New Member
Reaction score
31
6 item variable
event -repick
set item variable1 = item in hero inventory slot 1, repeat for 6 items
drop items from hero
remove hero
create new hero
give item variable 1 to new hero, repeat for 6 items
 

istar

New Member
Reaction score
31
event-player type -repick
action-pick unit variable(you put the hero in this variable when you select it)
set item variable1 = item in hero inventory slot 1, repeat for 6 items
drop items from hero
remove hero
create new hero
give item variable 1 to new hero, repeat for 6 items
set unit variable=new hero

to create variable click the yellow X in trigger editor
 

thomas9999

New Member
Reaction score
0
no sorry im still stuck would u b able to make one of those box things?

im really new to making map sorry
 

hopy

Active Member
Reaction score
64
You will need a 6 array Item Variable (open variable menu and create one for Item, with an Array size of 6.

Next up is the trigger itself:

Trigger:
  • Repick
    • Events
      • Player - Player 1 (Red) types a chat message containing -repick as An exact match
      • Player - Player 2 (Blue) types a chat message containing -repick as An exact match
    • Conditions
    • Actions
      • Set Unit_Group = (Units owned by (Triggering player) matching (((Triggering unit) is A Hero) Equal to True))
      • Unit Group - Pick every unit in Unit_Group and do (Actions)
        • Loop - Actions
          • Set Item Variable[1] = (Item carried by (Picked unit) in slot 1)
          • Set Item Variable[2] = (Item carried by (Picked unit) in slot 2)
          • Set Item Variable[3] = (Item carried by (Picked unit) in slot 3)
          • Set Item Variable[4] = (Item carried by (Picked unit) in slot 4)
          • Set Item Variable[5] = (Item carried by (Picked unit) in slot 5)
          • Set Item Variable[6] = (Item carried by (Picked unit) in slot 6)
          • Unit - Remove (Picked unit) from the game
          • Camera - Pan camera for (Triggering player) to ((Triggering player) start location) over 0.00 seconds
          • Unit - Create 1 Wisp [Hero pick] for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
      • Custom script: call DestroyGroup(udg_Unit_Group)


Now in your hero create trigger make this:

Trigger:
  • Hero Pick Trigger
    • Events
      • Unit - A unit enters Hero Blade Master <gen>
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Wisp [Hero pick]
    • Actions
      • Unit - Hide Blademaster 0185 <gen>
      • Set Point = (Center of Start Lokation <gen>)
      • Unit - Create 1 Blademaster for (Owner of (Triggering unit)) at Point facing Default building facing degrees
      • Camera - Pan camera for (Owner of (Triggering unit)) to (Center of Start Lokation <gen>) over 0.00 seconds
      • Custom script: call RemoveLocation (udg_Point)
      • Hero - Create Item Variable[1] and give it to (Last created unit)
      • Hero - Create Item Variable[2] and give it to (Last created unit)
      • Hero - Create Item Variable[3] and give it to (Last created unit)
      • Hero - Create Item Variable[4] and give it to (Last created unit)
      • Hero - Create Item Variable[5] and give it to (Last created unit)
      • Hero - Create Item Variable[6] and give it to (Last created unit)


This should work leakless and buggless I think ... as long as its only one player playing and using repick ...

If its for multiple people you will need to check if the triggering unit owner at the hero create trigger is the same as the triggering player in the repick trigger and stuff ...

Hope that helped :) even though its a few months late.
 

SuperSoldier

New Member
Reaction score
10
4. Replying
F. Please do not revive old threads. If the thread to which you intend to reply is more than about a month old, don't reply to it. Just create a new one if you have a question about it.

While a month old is a bit too soon to consider dead, nearly a year isn't.

Oh, and your trigger is neither leakless nor bugless. If two or more people use it, only the last one to do it gets the items. Also I think when you pan the camera to that point, it leaks. Oh, and if some one does -repick, and someone hasn't chosen and they now chose a hero, they will get all of the items of the repicking guy, and so will anyone else who is just picking, along with the repicker
 

hopy

Active Member
Reaction score
64
While a month old is a bit too soon to consider dead, nearly a year isn't.

Oh, and your trigger is neither leakless nor bugless. If two or more people use it, only the last one to do it gets the items. Also I think when you pan the camera to that point, it leaks. Oh, and if some one does -repick, and someone hasn't chosen and they now chose a hero, they will get all of the items of the repicking guy, and so will anyone else who is just picking, along with the repicker

Well I was looking old posts for something when I found this one ... I made that trigger and a bit befor I was done I noticed the post time ...
I considered it a whaste to not post it afther making it ...

Also I sended him a PM to let him know about my reply, explain a few things extra, and let him know he can let me know if he needs the trigger to be for multiple player's.

Anyway's like I mentioned in my post if he wanted the trigger to be for multiple players I would have to change it but people were calling me so I finished it like this and he can call me if he needed it change.

Anyway's, how come the pan camera would leak? it goes to a point wich is destroyed later on, and I never heared about Pan camera leaking from itself.
Please explain that part to me and a way to fix this.
 
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