prevent Random Hero

Do you need World Editor help? Ask here!
Forum rules
Before making a new topic:
First, check if your question has already been answered in the Tutorials section.
If you didn't find a solution, use the search function.
If searching didn't help either, you can make a new topic.

Topic title & content:
You must use a descriptive title. (Help plz is not good) (Need help with Dialog buttons is good)
Go into much detail when posting. You should post attachments. Like screenshots of the problem, the map you are making, replays of the error. Or you could even make a screencast (video) of your problem and upload it here.

Spelling:
Grammar seems to be a serious problem amongst teenagers, so use a spell checker or you will get no love.
Read your posts twice, before pressing the reply button.
And do not use profanity. Chatspeak (y r u nub) and Leetspeak (1 C4N S33 H4X) are not welcome here either.

Only World Editor related questions are allowed here!
(Click for Battle.net help) (Click for World Editor help)
BugMeNot
Posts: 141
Joined: Wed Jan 21, 2009 12:46 pm

prevent Random Hero

Unread post by BugMeNot »

In advanced option map. Theres checkbox list random hero. How to disable this ?
This is a guest account intended for use by people who wish to remain anonymous or hate registering.
(Please don't forget to sign your posts with your name if you want us to know who you are.)
http://www.bugmenot.com/view/3ice.hu

User avatar
3ICE
Admin
Posts: 2629
Joined: Sat Mar 01, 2008 11:34 pm
Realm: Europe
Account: 3ICE
Clan: 3ICE
Location: Hungary
Contact:

Re: prevent Random Hero

Unread post by 3ICE »

Asked by Rayhan.
How to prevent Random Hero ?

Daniel Berezvai:

Easy enough, I think. The idea is:
Event: Elapsed game time 0.01 sec (or something similar, just do it right after map initialization)
Action: Delete all heroes from the map by doing this sequence:
For loop: Pick each unit in (playable map area) matching (picked unit is a hero)*
Remove picked unit from the game.
* explained in followup comment.

*= It has been a while since I used GUI. This Unit group - pick all units thing might go differently, for example:
All units in area matching condition
condition=Unit has flag
has flag = is a hero
area=entire map

Good luck!

Alejandro: that might work

Daniel Berezvai Also also: make sure you don't remove heroes you yourself placed in the map, for example if you use the wisp + circle of power + hero standing next to it hero pick scheme, exclude those heroes from the unit group. (With something like: units owned by player matching condition)

Rayhan ggwp :D. Thankyou so much for the information. I will try it !!

Daniel Berezvai Here I opened the editor and made this:
t_ugr Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) is A Hero) Equal to True)) and do (Unit - Remove (Picked unit) from the game)

Important to change every instance of "triggering unit" to either "picked" or "matching" unit, as appropriate.

Without JASS it is impossible to get rid of the useless "Equal to True" bit. Not really a big performance hit anyway. Just hurts to see any inefficiency. We can probably ignore the memory leak too (one unit group), as this code only runs once.

Every time I post in a closed group I feel sad. Why don't we allow the whole world to see this?

To alleviate that effect I copied my solution to my website so anyone googling this problem, who is not in this closed facebook group, can find it easily.
http://forum.3ice.hu/viewtopic.php?f=14&t=973
ImageImageImageImageImage
Image
ImageImage

Post Reply

Who is online

Users browsing this forum: No registered users and 21 guests