• 🏆 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!

System Reinventing

So this is a list of submissions we might not want to forget and maybe re-create them.

- Some authors might still want to improve
- Some of the submissions only serve as idea platform
- Some authors don't care anymore

I didn't do any deep thoughts, but just wrote out some concept that seemed overall or partialy interesting.

Finaly we might interact with author first, if we are unsure he is not working on it anymore.

Submission ThemeAttempt (old)Attempt (new)

Item Identify
Link-

MS Dependency
Link-


ArrowKeySequence
LinkLink 1
Link 2


Santa spells
Link-


Timed Capturing
LinkLink


Interactive Conversation
Link-


Mount System
Link-


Waypoints
Link-


Unit Fusion
LinkLink


ReadyDialogue
LinkLink


TradeDialogue
Link-


CustomBunker
LinkLink


Radar
Link-


UnitReputation
Link-


AC Recycling
Link-


String Binding
LinkLink


Clip Maker
LinkLink


Light System
Link-


Parachute
Link-


CombatSystem
LinkLink


UnitDisarm
LinkLink


Lightning Figure
Link-


Eating Plant
Link-


If someone still knows a good one, go ahead and share. :)
 
Last edited:
Level 13
Joined
Nov 7, 2014
Messages
571
My attempt at "String Binding".

JASS:
library StringNextChar

struct StringNextChar
    string s
    private integer a = 0
    private integer b = 1
    string cc = "" // current color
    readonly boolean no_next_char = false

    static method create takes string s returns thistype
        local thistype this = allocate()
        set this.s  = s
        return this
    endmethod

    //
    // the default destroy method is sufficient
    //

    method next_char takes nothing returns string
        local string c
        local string cff

        if no_next_char then
            return ""
        endif

        // note: s = this.s, a = this.a, b = this.b

loop
        set c = SubString(s, a, b)

        if c == "" then
            set no_next_char = true
            return ""

        elseif c == "|" then
            set c = SubString(s, a + 1, b + 1)
            if c == "c" then
                set cff = SubString(s, a + 1, b + 3)
                if StringCase(cff, /*upper:*/ false) == "cff" then
                    set cc = SubString(s, b + 3, b + 9)
                    set c = SubString(s, b + 9, b + 10) // empty color codes (e.g: "|cffFF0000|r") are not handled correctly
                    set a = b + 10
                    set b = a + 1
                    exitwhen true

                else
                    // c == "c"
                    set a = a + 2
                    set b = a + 1
                    exitwhen true
                endif

            elseif c == "r" then
                set cc = ""
                set a = a + 2
                set b = a + 1
                // continue

            else
                set c = "|"
                set a = a + 2
                set b = a + 1
                exitwhen true
            endif

        else
            set a = a + 1
            set b = a + 1
            exitwhen true
        endif

endloop

        if cc != "" then
            return "|cff" + cc + c + "|r"
        endif
        return c
    endmethod

    method reset takes nothing returns nothing
        set this.a = 0
        set this.b = 1
        set no_next_char = false
    endmethod

    method set_string takes string s returns nothing
        set this.s = s
        call this.reset()
    endmethod
endstruct

endlibrary

JASS:
library Example initializer init requires StringNextChar

globals
    private StringNextChar snc = 0
    private timer tmr = CreateTimer()
    private string msg = ""
endglobals

private function show_next_char takes nothing returns nothing
    if snc.no_next_char then
        call PauseTimer(tmr)
        return
    endif

    call ClearTextMessages()
    set msg = msg + snc.next_char()
    call BJDebugMsg(msg)
endfunction

private function snc_init takes nothing returns nothing
    if snc == 0  then
        set snc = StringNextChar.create("|cff0000FFT|r|cff0000DDh|r|cff0000BBi|r|cff000099s|r |cff000077i|r|cff000055s|r |cff000033m|r|cff000011y|r |cff000033s|r|cff000055t|r|cff000077r|r|cff000099i|r|cff0000BBn|r|cff0000DDg.|r |cff0000FFT|r|cff0000DDh|r|cff0000BBe|r|cff000099r|r|cff000077e|r |cff000055a|r|cff000033r|r|cff000011e|r |cff000033m|r|cff000055a|r|cff000077n|r|cff000099y|r |cff0000BBl|r|cff0000DDi|r|cff0000FFk|r|cff0000DDe|r |cff0000BBi|r|cff000099t|r|cff000077,|r |cff000055b|r|cff000033u|r|cff000011t|r |cff000033t|r|cff000055h|r|cff000077i|r|cff000099s|r |cff0000BBo|r|cff0000DDn|r|cff0000FFe|r |cff0000DDi|r|cff0000BBs|r |cff333333mine.|r")
    else
        call snc.reset()
    endif
endfunction

private function on_esc takes nothing returns nothing
    call snc_init()
    set msg = ""
    call TimerStart(tmr, 0.05, true, function show_next_char)
endfunction

private function init takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterPlayerEventEndCinematic(t, Player(0))
    call TriggerAddAction(t, function on_esc)

    call BJDebugMsg("Press Esc and try to read the string... =)")
endfunction

endlibrary
 
Removed Multiboard from the list, we actually have Nestharus's. I forgot.

Aniki, nice.
For better reading I wanted to "fix" the line where you define the long string, and made a new line several times.
I found out some interesting behaviour which I have not thought is possible before. Test this (care at Message indention in game):

JASS:
library Example initializer init requires StringNextChar

globals
    private StringNextChar snc = 0
    private timer tmr = CreateTimer()
    private string msg = ""
endglobals

private function show_next_char takes nothing returns nothing
    if snc.no_next_char then
        call PauseTimer(tmr)
        return
    endif

    call ClearTextMessages()
    set msg = msg + snc.next_char()
    call BJDebugMsg(msg)
endfunction

private function snc_init takes nothing returns nothing
    if snc == 0  then
        set snc = StringNextChar.create("|cff0000FFT|r|cff0000DDh|r|cff0000BBi|r|cff000099s|r |cff000077i|r|cff000055s|r |cff000033m|r|cff000011y|r
 |cff000033s|r|cff000055t|r|cff000077r|r|cff000099i|r|cff0000BBn|r|cff0000DDg.|r |cff0000FFT|r|cff0000DDh|r|cff0000BBe|r|cff000099r|r
      |cff000077e|r |cff000055a|r|cff000033r|r|cff000011e|r |cff000033m|r|cff000055a|r|cff000077n|r|cff000099y|r |cff0000BBl|r|cff0000DDi|r
        |cff0000FFk|r|cff0000DDe|r |cff0000BBi|r|cff000099t|r|cff000077,|r |cff000055b|r|cff000033u|r|cff000011t|r |cff000033t|r|cff000055h|r
    |cff000077i|r|cff000099s|r |cff0000BBo|r|cff0000DDn|r|cff0000FFe|r |cff0000DDi|r|cff0000BBs|r |cff333333mine.
|cff000077i|r|cff000099s|r |cff0000BBo|r|cff0000DDn|r|cff0000FFe|r |cff0000DDi|r|cff0000BBs|r |cff333333mine.|r")
    else
        call snc.reset()
    endif
endfunction

private function on_esc takes nothing returns nothing
    call snc_init()
    set msg = ""
    call TimerStart(tmr, 0.05, true, function show_next_char)
endfunction

private function init takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterPlayerEventEndCinematic(t, Player(0))
    call TriggerAddAction(t, function on_esc)

    call BJDebugMsg("Press Esc and try to read the string... =)")
endfunction

endlibrary

it hold the spaces you make in JASS. (!)

So I tried to construct it dynamicly with adding new strings, and it actually works fine:

JASS:
struct S extends array
    private static method onInit takes nothing returns nothing
        local string s = ""
        local integer i
        local integer j
        local integer mode = 1  // set it to 1 or 2
    
        if mode == 1 then
            set s = "1\n  2\n    3\n      4\n        5\n      6\n    7\n  8\n9"
    
        elseif mode == 2 then
    
            set i = 1
            loop
                exitwhen i >= 9
            
                set s = s + "\n"
                set j = 1
            
                loop
                    exitwhen j >= i
                        set s = s + "  "
                    set j = j + 1
                endloop
            
                set s = s + I2S(i)
                set i = i + 1
            endloop
        
        endif
    
        call BJDebugMsg(s)
    endmethod
endstruct

So.. native DisplayTextToPlayer takes player toPlayer, real x, real y, string message returns nothing does not allow to have different indentions at once, but forces alignment.
But we actually might manipulate one string to have multiple lines with individual indentions with mimicing indention with a certain amount of spaces.

So we can do something like this:
test-png.250774
 

Attachments

  • Test.PNG
    Test.PNG
    521.7 KB · Views: 848
Last edited:

Deleted member 219079

D

Deleted member 219079

I would love to do man eating plant, but I bet someone is already doing it lol :D

It would take like months for me so I won't even bother, just to see someone else submitting it first.
 
Level 13
Joined
Nov 7, 2014
Messages
571
But we actually might manipulate one string to have multiple lines with individual indentions with mimicing indention with a certain amount of spaces.

Okay... but I think this:
JASS:
    set s = "1\n  2\n    3\n      4\n        5\n      6\n    7\n  8\n9"
    call BJDebugMsg(s)

displays the same thing as this:
JASS:
call BJDebugMsg("1")
call BJDebugMsg("  2"
call BJDebugMsg("    3"
call BJDebugMsg("      4"
call BJDebugMsg("        5"
call BJDebugMsg("      6"
call BJDebugMsg("    7"
call BJDebugMsg("  8"
call BJDebugMsg("9")


And (as far as I know) to the Jass parser the string:
JASS:
set s = "
A
    B
C    "

is exactly the same as this:
JASS:
set s = "\nA\n    B\nC    "
 
Level 13
Joined
Nov 7, 2014
Messages
571
Yes. So if we replace the native indention "x" from he DisplayText function wich a respective amount of spaces we could also intuitivly set indentions for our texts. For example print("Hallo", 0.5") could start at half of screen, and "0" at very left.

Well... how many spaces would move the text exactly to the middle of the screen?
It probably depends on the font, Options/Video/Resolution, window size (in window mode), etc., so I think that would be difficult to work out.
 
Yes, tested it, you're right. It becomes pretty senseless for global submissions.

Aniki, I also added Cine Filter Fun to "Click Maker", it's not the exact same goal, but similar I guess. (?) : )

edit:
I contacted rulerofiron99 because of "Unit Fusion", and asked about planned updates-- else I would probably give it a shot.

edit 2:

he won't work anymore on "Unit Fusion", but thinking about it more I can't get a too generic and useful enough approach.
I would make it probably always map specific, so I think won't make a submission.
 
Last edited:

Deleted member 219079

D

Deleted member 219079

I think we don't have aura system atm either?
 

Deleted member 219079

D

Deleted member 219079

But I'm not very sure what your suggestion is.
It just manages aura member insertion/removal. I've one on my HDD, but it has non-hive deps:
JASS:
library AuraMan requires /*
    */ AIDS,        /* http://www.thehelper.net/threads/advanced-indexing-data-storage.116539/
    */ UnitAlloc     // https://www.dropbox.com/s/v0rdg9mqnyxeeik/UnitAlloc.j?dl=1
  
    // AuraMan v1.0.0
    // by jondrean
  
    // d:05.04.16
  
    // Manages aura abilities.
  
    // ---------------
    //      USAGE
    // ---------------

    //! novjass
  
    struct MyStruct extends array
  
        static constant real tickRate=.03125000
            // Interval of unit enumeration
      
        method onInsert takes unit u returns nothing
        method onErase takes unit u returns nothing
            // Catch when unit is added/removed (OPTIONAL)
      
        method getRange takes nothing returns real
        static method filter takes nothing returns boolean
            // Enumerate how distant units? Also who to add?
      
        implement AuraMan
            static method operator filtOwner takes nothing returns player
                // Use inside of filter
            static method insertHost takes unit u returns nothing
            static method insertHostById takes integer u returns nothing
                // Registers host (aura wielder)
            method eraseHost takes unit u returns nothing
            method eraseHostById takes integer u returns nothing
                // Unregisters host
      
    endstruct
  
    //! endnovjass
  
// ---------------
  
    globals
        private group G=CreateGroup()
        private player P
    endglobals
  
// ---------------
  
    module AuraMan
  
        private thistype n     // next node / first allocation node
        private thistype p     // previous node / rest of allocation nodes
        private thistype h     // head node
        private unit u         // node host
        private boolean new // relevant node = DON'T deallocate
  
        player pl             // owner of host
      
    // ---------------
  
        implement UnitAlloc
        private static timer C=CreateTimer()
        debug private boolean used
      
    // ---------------
      
        static method operator filtOwner takes nothing returns player
            return P
        endmethod
      
    // ---------------
      
        private static method onExpire takes nothing returns nothing
            local thistype this=thistype(0).next
            local unit FoG
            local thistype n
            loop
                if(UnitAlive(unit))then
                    set P=pl
                    call GroupEnumUnitsInRange(G,GetUnitX(unit),GetUnitY(unit),getRange(),Filter(function thistype.filter))
                    loop
                        set FoG=FirstOfGroup(G)
                        exitwhen(FoG==null)
                        set n=h
                        loop
                            if(n==0)then
                                //! runtextmacro AURAMAN_ALLOCN()
                                exitwhen(true)
                            endif
                            exitwhen(n.u==FoG)
                            set n=n.n
                        endloop
                        set n.new=true
                        call GroupRemoveUnit(G,FoG)
                    endloop
                    set n=h
                    loop
                        exitwhen(n==0)
                        if(n.new)then
                            set n.new=false
                        else
                            //! runtextmacro AURAMAN_DEALLOCN()
                        endif
                        set n=n.n
                    endloop
                else
                    set n=h
                    loop
                        exitwhen(n==0)
                        //! runtextmacro AURAMAN_DEALLOCN()
                        set n=n.n
                    endloop
                    set pl=null
                    set h=0
                    //! runtextmacro UNITALLOC_DEALLOC("thistype","this")
                    if(empty)then
                        call PauseTimer(C)
                    endif
                endif
                set this=this.next
                exitwhen(this==0)
            endloop
        endmethod
      
        //! textmacro AURAMAN_ALLOCN
            debug if(thistype(0).n==8191)then
            debug     call BJDebugMsg("|cffff0000"+thistype.onExpire.name+" ERROR: Exceeding node limit")
            debug else
                static if(thistype.onInsert.exists)then
                    call this.onInsert(FoG)
                endif
                set h.p=thistype(0).n
                set thistype(0).n.n=h
                set h=thistype(0).n
                set thistype(0).n=thistype(0).n.p
                set h.u=FoG
                set h.new=true
            debug endif
        //! endtextmacro
        //! textmacro AURAMAN_DEALLOCN
            static if(thistype.onErase.exists)then
                call this.onErase(n.u)
            endif
            set n.u=null
            if(n==h)then
                set h=n.n
                set n.n.p=0
            else
                set n.p.n=n.n
                set n.n.p=n.p
            endif
            set n.p=thistype(0).n
            set thistype(0).n=n
        //! endtextmacro
      
    // ---------------
      
        static method insertHostById takes thistype this returns nothing
            local unit FoG
            debug if(used)then
            debug     call BJDebugMsg("|cffff0000"+thistype.insertHostById.name+" ERROR: Double allocation")
            debug     return
            debug endif
            debug set used=true
            if(empty)then
                call TimerStart(C,thistype.tickRate,true,function thistype.onExpire)
            endif
            set pl=GetOwningPlayer(unit)
            //! runtextmacro UNITALLOC_ALLOC("thistype","this")
            set P=pl
            call GroupEnumUnitsInRange(G,GetUnitX(unit),GetUnitY(unit),getRange(),Filter(function thistype.filter))
            loop
                set FoG=FirstOfGroup(G)
                exitwhen(FoG==null)
                //! runtextmacro AURAMAN_ALLOCN()
                call GroupRemoveUnit(G,FoG)
            endloop
        endmethod
        static method insertHost takes unit u returns nothing
            debug if(GetUnitUserData(u)==0)then
            debug   call BJDebugMsg("|cffff0000"+thistype.insertHost.name+" ERROR: Removed/unindexed unit given")
            debug   return
            debug endif
            call insertHostById(GetUnitId(u))
        endmethod
      
    // ---------------
      
        static method eraseHostById takes thistype this returns nothing
            local thistype n=h
            debug if(not used)then
            debug     call BJDebugMsg("|cffff0000"+thistype.eraseHostById.name+" ERROR: Double free")
            debug     return
            debug endif
            debug set used=false
            loop
                exitwhen(n==0)
                //! runtextmacro AURAMAN_DEALLOCN()
                set n=n.n
            endloop
            set h=0
            set pl=null
            //! runtextmacro UNITALLOC_DEALLOC("thistype","this")
            if(empty)then
                call PauseTimer(C)
            endif
        endmethod
        static method eraseHost takes unit u returns nothing
            debug if(GetUnitUserData(u)==0)then
            debug   call BJDebugMsg("|cffff0000"+thistype.eraseHost.name+" ERROR: Removed/unindexed unit given")
            debug   return
            debug endif
            call eraseHostById(GetUnitId(u))
        endmethod
      
    // ---------------
      
        private static method onInit takes nothing returns nothing
            local integer n=8190
            loop
                set thistype(n).p=n+1
                exitwhen(n==1)
                set n=n-1
            endloop
            set thistype(0).n=1
        endmethod
      
    endmodule
  
// ---------------

endlibrary

I would of course rewrite it :) also, it's not optimal performance-wise.

Edit: Oh now I know why this was confusing, I didn't link the orignal one LOL
(system) [vJass] CustomAura
 
I was a bit confused at first because my initial intention was not to forget submissions that were never good enough to be approved, but had an interesting concept.
But finding (meanwhile) lacking approved submissions and re-create them is in the end something similar, so I guess it's okay, too, and fitting the thread.

But though it would be good to point out the original submission's weak points to make it valid to write a new same concept attempt.
You could for example make a statement in it's thread why it is not sufficient/lacking so we might even evaluate to re-approve it. Then, it would make perfect sense for us to write an improved version since it's author is not active anymore.
 

Deleted member 219079

D

Deleted member 219079

point out the original submission's weak points to make it valid to write a new same concept attempt
Well this is alarmingly bad performance:
Yeah! It's great, I loved this system but it was very laggy with 10+ units with auras haha
I hope it was improved upon there
In its periodic function, it does a crap load of native group function calls, which I'm pretty sure are the cause of bad performance. Also the interface calls result in filth. On top of that, bad function placements have resulted in filth on top of filth:
JASS:
function s__CustomAura_create takes unit theUnit returns integer
    local integer this= s__CustomAura__allocate()
 
    set s__CustomAura_affect[this]=NewGroup()
    set s__CustomAura_last[this]=NewGroup()
    set s__CustomAura_theUnit[this]=theUnit
 
    set s__CustomAura_index[this]=s__CustomAura_a
    set s__CustomAura_i[s__CustomAura_index[this]]=this
    set s__CustomAura_a=s__CustomAura_a + 1
    if s__CustomAura_a == 1 then
        call TimerStart(s__CustomAura_t, CustomAura__PERIOD, true, function sc__CustomAura_run)
    endif
 
    return this
endfunction
And quess what sc__CustomAura_run is?
JASS:
function sc__CustomAura_run takes nothing returns nothing
    call TriggerEvaluate(st__CustomAura_run)
endfunction
And spell submission rules state:
  • The spell/system must have decent performance. If you're constantly repeating function calls and using nested group enumerations, or even using too many special effects, you may face lag spikes while casting your spell.

Edit: I realized I repeated what PnF has said: (system) [vJass] CustomAura
 
Last edited by a moderator:
Some minor efficiency flaws are probably not enough for an unapproval.
And overriding the past verdict for little stuff is perhaps no good way, too.

Though if the flaws are critical and make markable difference it might be valid.
(e.g. you can test if his system really can handles only 10 units,
and then show what your method can handle instead)
But please, you should write the critiques in his thread, not here.
 

Deleted member 219079

D

Deleted member 219079

Last edited by a moderator:
Level 31
Joined
Jul 10, 2007
Messages
6,306
There is this old thing

JASS/script.j at master · nestharus/JASS · GitHub

Best not to start an aura thing from scratch. I think that lib went through 2 years of debugging to handle a seemingly endless amount of fringe cases ;o. If anyone wants to revive it, you have my blessing ; ). Should perform faster than whatever is out there at the moment short of c#.


There are a ton of resources in my git repo that are using outdated systems or contain bugs that I never got around to fixing if anyone wants to tackle them.


There are also a few resources that are solved but nobody has coded yet.


I am likely never going to code for Warcraft 3 again : /.
 
Last edited:
Level 12
Joined
Jun 12, 2010
Messages
413
I have a pretty configurable combat system in my unreleased systems (see signature). It's pretty modular though, so it comes out of the box only allowing you to make units enter, leave combat and check if a unit is in combat. So you have to define your own methods of entering and leaving combat.

The biggest differential feature is that it creates a unit group for each indexed unit in the map that keeps track of what units that unit is currently in combat with. I haven't seen another combat system doing this, though there might be one out there.

The test map comes with a nice pre-coded example of defining methods to leave and enter combat. It uses my Timer System.

GUI Combat System | HIVE

I haven't posted it in the spell section because I already have 5 pending systems in the first page there, so I would feel like I'm flooding it way too much.
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
@IcemanBo Oh, hey! Don't want to bother you too much, maybe there is a reason for skipping over, but may I point your attention to this

I just found this pretty interesting thread and was looking through thinking "I can give a try to this... and this other thing... I've done one of those but never published and one for this but highly-customized" and then I saw the "CustomBunker" and thought... "Eeeeh, what is happening here?" as this was the only thing that I've published myself on THW... :|

There was this guy in WE Help Zone who said "Hey lads, how do I make a starcraft-like bunker from which each unit can shoot?" and both me & ruller thought "Hm, that may actaully be intereating to do, why isn't one out there already" and made system that supports this in a way pretty much at the same time...
 
Top