• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Script Error with H2L Sorter

Status
Not open for further replies.
Level 16
Joined
Mar 27, 2011
Messages
1,349
I am receiving this error after implementing the http://www.hiveworkshop.com/forums/spells-569/high-low-sorter-v-1-0-2-5-a-240626/?prev=search%3Dsorter%26d%3Dlist%26r%3D20. I already have the "create unknown variables data" checked.

Error.jpg


What am I doing wrong? It's probably something simple. I don't know jass, so maybe I copied the Jass part of the system over wrong?
 
Level 16
Joined
Mar 27, 2011
Messages
1,349
It's no problem. It happens. Glad you found the solution.

I hope you like the system.

Yeah this system is just what I needed in my map. I appreciate you spending the time to develop it. I'm using it for a turn based battle system. I needed to sort out who goes first based on who has the highest "speed" stat. When I finish it I'll let you know. Thanks man.
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
Yeah this system is just what I needed in my map. I appreciate you spending the time to develop it. I'm using it for a turn based battle system. I needed to sort out who goes first based on who has the highest "speed" stat. When I finish it I'll let you know. Thanks man.

Cool I look forward to try it. I love the old style turn based games.
 
Level 16
Joined
Mar 27, 2011
Messages
1,349
When 2 or more units have the same speed stat, they are both given the same placement order.

For example:

Fish's custom value = 5
Shark's custom value = 4
Squid's custom value = 3

There is 1 Fish, 1 Shark and 2 Squids (4 units total)

The returned values are:

Fish = 1
Shark = 2
Squid = 4
Squid = 4

I could probably find a workaround to this problem, but I thought I'd let you know of this. Not sure of the best way to go about it. Maybe the first Squid entered gets Number 3 placement while the second Squid registered gets the 4th placement?
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
When 2 or more units have the same speed stat, they are both given the same placement order.

For example:

Fish's custom value = 5
Shark's custom value = 4
Squid's custom value = 3

There is 1 Fish, 1 Shark and 2 Squids (4 units total)

The returned values are:

Fish = 1
Shark = 2
Squid = 4
Squid = 4

I could probably find a workaround to this problem, but I thought I'd let you know of this. Not sure of the best way to go about it. Maybe the first Squid entered gets Number 3 placement while the second Squid registered gets the 4th placement?

Yes that is how this is meant to work as they are the same so they are technically tied for 3rd place but you can't store 2 units at the same index so moving one to 4th is what is needed.
 
Status
Not open for further replies.
Top