LUA Abuse [Inventory System, need design ideas]

Jesus4Lyf

Good Idea™
Reaction score
397
Edit: Jump to here for post regarding inventory system.
In case we ran out of interfacing confusion...
JASS:
library Pockets initializer OnInit
    private function OnInit takes nothing returns nothing
        //! externalblock extension=lua ObjectMerger $FILENAME$
//===========================================================================
// SYSTEM AREA (don't touch)
//
    //===========================================================================
    // ORDER SYS (don't touch)
    //
    
    local string array orders
    //! i orders={}
    local integer maxOrders=0
    //! i maxOrders=0
    
    //! textmacro MYSYS__BeginOrders
        set maxOrders=0
        //! i maxOrders=0
    //! endtextmacro
    
    //! textmacro MYSYS__EndOrders
        //things
    //! endtextmacro
    
    //! textmacro MYSYS__AllowOrder takes ORDER
        set maxOrders=maxOrders+1
        //! i maxOrders=maxOrders+1
        set orders[maxOrders]="$ORDER$"
        //! i orders[maxOrders]="$ORDER$"
    //! endtextmacro
    
    
    //===========================================================================
    // ID SYS (don't touch)
    //
    
    local integer array sysIds
    //! i sysIds={}
    local integer maxSysIds=0
    //! i maxSysIds=0
    
    //! textmacro MYSYS__BeginSysIds
        set maxSysIds=0
        //! i maxSysIds=0
    //! endtextmacro
    
    //! textmacro MYSYS__EndSysIds
        //things
    //! endtextmacro
    
    //! textmacro MYSYS__AllowSysId takes SYSID
        set maxSysIds=maxSysIds+1
        //! i maxSysIds=maxSysIds+1
        set sysIds[maxSysIds]='0$SYSID$X'
        //! i sysIds[maxSysIds]="$SYSID$X"
    //! endtextmacro
    
    
    //===========================================================================
    // POCKET SYS (don't touch)
    //
    
    local integer maxPockets=0
    //! i maxPockets=0
    
    //! textmacro MYSYS__BeginPockets
        set maxPockets=0
        //! i maxPockets=0
    //! endtextmacro
    
    //! textmacro MYSYS__EndPockets
        debug if maxPockets!=5 then
            debug call BJDebugMsg("MYSYS - Total number of pockets declared is not 5.")
        debug endif
    //! endtextmacro
    
    //! textmacro MYSYS__CreatePocket takes NAME, ICON, TOOLTIP
        set maxPockets=maxPockets+1
        //! i maxPockets=maxPockets+1
        
    //! endtextmacro
    
    
    //===========================================================================
    // ITEM SYS (don't touch)
    //
    
    local string itemName=""
    //! i itemName=""
    //! textmacro MYSYS__SetName takes NAME
        set itemName="$NAME$"
        //! i itemName="$NAME$"
    //! endtextmacro
    
    //! i itemTooltip=""
    //! textmacro MYSYS__SetTooltip takes TOOLTIP
        //! i itemTooltip="$TOOLTIP$"
    //! endtextmacro
    
    //! i itemHotkey=""
    //! textmacro MYSYS__SetHotkey takes HOTKEY
        //! i itemHotkey="$HOTKEY$"
    //! endtextmacro
    
    local string itemIcon=""
    //! i itemIcon=""
    //! textmacro MYSYS__SetIcon takes ICON
        set itemIcon="ReplaceableTextures\\CommandButtons\\$ICON$.blp"
        //! i itemName="ReplaceableTextures\\CommandButtons\\$ICON$.blp"
    //! endtextmacro
    
    local integer itemPocket=0
    //! i itemPocket=0
    //! textmacro MYSYS__SetPocket takes POCKET
        set itemPocket=$POCKET$
        //! i itemPocket=$POCKET$
    //! endtextmacro
    
    //! i itemTargets=""
    //! textmacro MYSYS__SetTargets takes TARGETS
        //! i targets=$TARGETS$
    //! endtextmacro
    
    //! i itemRange=0
    //! textmacro MYSYS__SetRange takes RANGE
        //! i range=$RANGE$
    //! endtextmacro
    
    //! i itemTargetType=0
    //! textmacro MYSYS__SetTargetType takes TARGETTYPE
        //! i targetType=$TARGETTYPE$
    //! endtextmacro
    
    //! i itemTargetSize=0
    //! textmacro MYSYS__SetItemTargetSize takes SIZE
        //! i itemTargetSize=$SIZE$
    //! endtextmacro
    
    //! i SPELLBOOK_BASE="z"
    //! i USE_BASE="x"
    
    local integer itemNum=0
    //! i itemNum=0
    local integer itemId=0
    //! i itemId=0
    //! textmacro MYSYS__CreateItem
        set itemNum=itemNum+1
        //! i itemNum=itemNum+1
        set itemId=sysIds[itemNum]
        //! ! itemId=sysIds[itemNum]
        
        // Abilities
        //! i setobjecttype("abilities")
            
            // Channel (item dummy)
            //! i createobject("ANcl",USE_BASE..itemId)
            //! i makechange(current,"aher",0)
            //! i makechange(current,"alev",1)
            //! i makechange(current,"acat","")
            //! i makechange(current,"aeat","")
            //! i makechange(current,"aani","")
            //! i makechange(current,"atat","")
            //! i makechange(current,"Ncl1",1,0)
            
            //! i makechange(current,"Ncl2",1,itemTargetType)
            //! i makechange(current,"aran",1,itemRange)
            //! i makechange(current,"atar",1,itemTargets)
            // options
            //! i makechange(current,"Ncl3",1,1)
            //! i if itemTargetSize~=0 then
                //! i makechange(current,"Ncl3",1,3)
                //! i makechange(current,"aare",1,itemTargetSize)
            //! i end
            
            //! i makechange(current,"Ncl4",1,0)
            //! i makechange(current,"Ncl5",1,0)
            //! i makechange(current,"Ncl6",1,orders[itemNum])
            //! i makechange(current,"atp1",1,"[|cffffcc00"..itemHotkey.."|c] "..itemName)
            //! i makechange(current,"aub1",1,itemTooltip)
            //! i makechange(current,"anam",itemName)
            //! i makechange(current,"ahky",itemHotkey)
            //! i makechange(current,"aart",itemIcon)
            
            // Spellbook (group item dummies)
            //! i createobject("Aspb",SPELLBOOK_BASE..itemId)
            //! i makechange(current,"Slo1",1,0)
            //! i makechange(current,"Slo2",1,0)
            //! i makechange(current,"Slo3",1,0)
            //! i makechange(current,"ansf",orders[1])
            //! i makechange(current,"aart",icon)
            //! i makechange(current,"achd",0)
            //! i makechange(current,"anam","MyName")
            //! i makechange(current,"acdn",1,0)
            //! i makechange(current,"ahdu",1,0)
            //! i makechange(current,"adur",1,0)
            //! i makechange(current,"alev",1)
            //! i makechange(current,"amcs",1,0)
            //! i makechange(current,"abuf",1,"BBid")
            //! i makechange(current,"acas",1,0)
            //! i makechange(current,"atar",1,"self")
            //! i makechange(current,"arac","unknown")

//===========================================================================
// CONFIG AREA
//
    globals
        private constant integer ABIL_BASE='AZ00'
        private constant integer ABIL_SPELL
    endglobals
    //! runtextmacro 
//===========================================================================
        //! endexternalblock
    endfunction
endlibrary

Just something I'm working on, thought I'd show you all for kicks. Please note, it doesn't compile - it's very WIP. It's the kind of thing that we assume isn't possible - things like object data values being calculated based on user input. You can kind of see where it's going there. The way I've been (mis)using it is coding in both LUA and JASS at the same time - which means I can manipulate editor data and JASS at the same time. :thup:

If you use textmacros for functional decomposition (ew! user interface :() then you can make a config area that goes something like:
JASS:
//! runtextmacro CreateItem()
//! runtextmacro SetItemName("Barky's Head")
//! runtextmacro SetItemIcon("Dog")
//! runtextmacro CreatePocket()
//...

and it will compile to both object editor data, and JASS code. :thup:

I'm looking at you, Viikuna. ;)
 

Viikuna

No Marlo no game.
Reaction score
265
Thats quite cool stuff indeed.

If you know gsl you can also manipulate object data by doing that [lJASS]//! externalblock extension[/lJASS] thingy for GMSI, like in this lil tutorial thingy by Grim001 ( link )

Damn yo, soon enough there will probably be some object data editor scripting thingy for NewGen, like that one PurplePoot and BoBo-TheKodo are building, and soon enough people dont even remember that back in the day this stuff used to be like impossible or something.


Its kinda sad in someway, that now when people come up with all the cool stuff, wc3 modding is already almost dead...



Anyways, this your stuff never stops to amaze me really.

So the idea behind this is that same time you generate your object data with this, you also create some Jass database to get that data for your scripts?

Thats cool indeed, keep working with it.
 

Jesus4Lyf

Good Idea™
Reaction score
397
So the idea behind this is that same time you generate your object data with this, you also create some Jass database to get that data for your scripts?
Yeah, basically. It's all exploiting JassHelper a little too much, imo. But basically, since you can put functions in external blocks, and global blocks within functions, you can do this:
JASS:
library Pockets initializer OnInit
    private function OnInit takes nothing returns nothing
        //! externalblock extension=lua ObjectMerger $FILENAME$
//===========================================================================
// SYSTEM AREA (don't touch)
//
    //vars
        //! i pizza = {}
        local integer array pizza
        //! i i=0
        local integer i=0
    //endvars
    
    //! textmacro AddCode takes CODE
        //! i i=i+1
        set i=i+1
        //! i pizza<i>=&quot;$CODE$&quot;
        set pizza<i>=&#039;$CODE$&#039;
    //! endtextmacro
    
    //execute
        //! runtextmacro AddCode(&quot;A01&amp;&quot;)
        //! runtextmacro AddCode(&quot;A02&amp;&quot;)
        //! runtextmacro AddCode(&quot;A03&amp;&quot;)
        //! runtextmacro AddCode(&quot;A04&amp;&quot;)
        //! runtextmacro AddCode(&quot;A05&amp;&quot;)
        //! runtextmacro AddCode(&quot;A06&amp;&quot;)
        //! runtextmacro AddCode(&quot;A07&amp;&quot;)
        //! runtextmacro AddCode(&quot;A08&amp;&quot;)
        //! runtextmacro AddCode(&quot;A09&amp;&quot;)
        //! runtextmacro AddCode(&quot;A10&amp;&quot;)
        //! runtextmacro AddCode(&quot;A11&amp;&quot;)
        //! runtextmacro AddCode(&quot;A12&amp;&quot;)
        //! runtextmacro AddCode(&quot;A13&amp;&quot;)
        //! runtextmacro AddCode(&quot;A14&amp;&quot;)
        //! runtextmacro AddCode(&quot;A15&amp;&quot;)
        //! runtextmacro AddCode(&quot;A16&amp;&quot;)
        //! runtextmacro AddCode(&quot;A17&amp;&quot;)
        //! runtextmacro AddCode(&quot;A18&amp;&quot;)
        //! runtextmacro AddCode(&quot;A19&amp;&quot;)
        //! runtextmacro AddCode(&quot;A20&amp;&quot;)
    //endexecute
    
    //! textmacro MYSYS__StartItems
        //! i i=0
        set i=0
    //! endtextmacro
    
    //! textmacro MYSYS__CreateItem takes NAME
        //! i i=i+1
        set i=i+1
        call BJDebugMsg(&quot;Created $NAME$ as Item Id &quot;+I2S(pizza<i>)+&quot;.&quot;)
        globals
            integer $NAME$
        endglobals
        set $NAME$=pizza<i>
        //! i setobjecttype(&quot;abilities&quot;)
        //! i createobject(&quot;ANcl&quot;,pizza<i>)
        //! i makechange(current,&quot;aher&quot;,0)
        //! i makechange(current,&quot;alev&quot;,1)
        //! i makechange(current,&quot;acat&quot;,&quot;&quot;)
        //! i makechange(current,&quot;aeat&quot;,&quot;&quot;)
        //! i makechange(current,&quot;aani&quot;,&quot;&quot;)
        //! i makechange(current,&quot;atat&quot;,&quot;&quot;)
        //! i makechange(current,&quot;Ncl1&quot;,1,0)
        //! i makechange(current,&quot;Ncl4&quot;,1,0)
        //! i makechange(current,&quot;Ncl5&quot;,1,0)
        //! i makechange(current,&quot;anam&quot;,&quot;$NAME$&quot;)
    //! endtextmacro


//===========================================================================
// CONFIG AREA (touch)
//
    //! runtextmacro MYSYS__StartItems()
        //! runtextmacro MYSYS__CreateItem(&quot;Pizza&quot;)
        //! runtextmacro MYSYS__CreateItem(&quot;Rockin&quot;)
        //! runtextmacro MYSYS__CreateItem(&quot;Cake&quot;)
        //! runtextmacro MYSYS__CreateItem(&quot;Cakezor&quot;)
        //! runtextmacro MYSYS__CreateItem(&quot;Cakezor2&quot;)
        //! runtextmacro MYSYS__CreateItem(&quot;Cakezor3&quot;)
        //! runtextmacro MYSYS__CreateItem(&quot;Cakezor4&quot;)
        //! runtextmacro MYSYS__CreateItem(&quot;Cakezor5&quot;)
        //! runtextmacro MYSYS__CreateItem(&quot;Cakezor6&quot;)
        //! runtextmacro MYSYS__CreateItem(&quot;Cakezor7&quot;)
        //! runtextmacro MYSYS__CreateItem(&quot;Cakezor8&quot;)
        //! runtextmacro MYSYS__CreateItem(&quot;Cakezor9&quot;)
        //! runtextmacro MYSYS__CreateItem(&quot;Cakezor000&quot;)
        //! runtextmacro MYSYS__CreateItem(&quot;Cakezor00000&quot;)
        
    call BJDebugMsg(&quot;Test of Power: &quot;+I2S(Cakezor4))
        
//===========================================================================
        //! endexternalblock
    endfunction
endlibrary
</i></i></i></i></i>

Isn't that awesome?

By the way, that does compile, and quickly.
 

Jesus4Lyf

Good Idea™
Reaction score
397
Bump. This is what I want to recreate, with this new tool. I want opinions on what people think of this kind of inventory system.

Download the unprotected map and give it a spin. Try the sys in-game, it's very intuitive... I could recreate that and give an interface similar to SpellStruct.

Thinking something like:
JASS:
//! runtextmacro ItemType()
    //! runtextmacro SetItemName(&quot;Barky&#039;s Head&quot;)
    //! runtextmacro SetItemIcon(&quot;Dog&quot;)
//! runtextmacro ItemStruct()
    private integer i=0
    private integer souls=0
    method onAquire takes nothing returns nothing
        set this.i=this.i+1
        call BJDebugMsg(&quot;Item picked up &quot;+I2S(this.i)+&quot; times.&quot;)
    endmethod
    method onUse takes nothing returns nothing
        call KillUnit(this.owner)
        set this.souls=this.souls+1 // etc
    endmethod
//! runtextmacro EndItem()

After design opinions. :)
 

Narks

Vastly intelligent whale-like being from the stars
Reaction score
90
make a new pre-processor so we don't have to deal with textmacros
 

Tru_Power22

You can change this now in User CP.
Reaction score
144
Edit: Jump to here for post regarding inventory system.
In case we ran out of interfacing confusion...
JASS:
library Pockets initializer OnInit
    private function OnInit takes nothing returns nothing
        //! externalblock extension=lua ObjectMerger $FILENAME$
//===========================================================================
// SYSTEM AREA (don&#039;t touch)
//
    //===========================================================================
    // ORDER SYS (don&#039;t touch)
    //
    
    local string array orders
    //! i orders={}
    local integer maxOrders=0
    //! i maxOrders=0
    
    //! textmacro MYSYS__BeginOrders
        set maxOrders=0
        //! i maxOrders=0
    //! endtextmacro
    
    //! textmacro MYSYS__EndOrders
        //things
    //! endtextmacro
    
    //! textmacro MYSYS__AllowOrder takes ORDER
        set maxOrders=maxOrders+1
        //! i maxOrders=maxOrders+1
        set orders[maxOrders]=&quot;$ORDER$&quot;
        //! i orders[maxOrders]=&quot;$ORDER$&quot;
    //! endtextmacro
    
    
    //===========================================================================
    // ID SYS (don&#039;t touch)
    //
    
    local integer array sysIds
    //! i sysIds={}
    local integer maxSysIds=0
    //! i maxSysIds=0
    
    //! textmacro MYSYS__BeginSysIds
        set maxSysIds=0
        //! i maxSysIds=0
    //! endtextmacro
    
    //! textmacro MYSYS__EndSysIds
        //things
    //! endtextmacro
    
    //! textmacro MYSYS__AllowSysId takes SYSID
        set maxSysIds=maxSysIds+1
        //! i maxSysIds=maxSysIds+1
        set sysIds[maxSysIds]=&#039;0$SYSID$X&#039;
        //! i sysIds[maxSysIds]=&quot;$SYSID$X&quot;
    //! endtextmacro
    
    
    //===========================================================================
    // POCKET SYS (don&#039;t touch)
    //
    
    local integer maxPockets=0
    //! i maxPockets=0
    
    //! textmacro MYSYS__BeginPockets
        set maxPockets=0
        //! i maxPockets=0
    //! endtextmacro
    
    //! textmacro MYSYS__EndPockets
        debug if maxPockets!=5 then
            debug call BJDebugMsg(&quot;MYSYS - Total number of pockets declared is not 5.&quot;)
        debug endif
    //! endtextmacro
    
    //! textmacro MYSYS__CreatePocket takes NAME, ICON, TOOLTIP
        set maxPockets=maxPockets+1
        //! i maxPockets=maxPockets+1
        
    //! endtextmacro
    
    
    //===========================================================================
    // ITEM SYS (don&#039;t touch)
    //
    
    local string itemName=&quot;&quot;
    //! i itemName=&quot;&quot;
    //! textmacro MYSYS__SetName takes NAME
        set itemName=&quot;$NAME$&quot;
        //! i itemName=&quot;$NAME$&quot;
    //! endtextmacro
    
    //! i itemTooltip=&quot;&quot;
    //! textmacro MYSYS__SetTooltip takes TOOLTIP
        //! i itemTooltip=&quot;$TOOLTIP$&quot;
    //! endtextmacro
    
    //! i itemHotkey=&quot;&quot;
    //! textmacro MYSYS__SetHotkey takes HOTKEY
        //! i itemHotkey=&quot;$HOTKEY$&quot;
    //! endtextmacro
    
    local string itemIcon=&quot;&quot;
    //! i itemIcon=&quot;&quot;
    //! textmacro MYSYS__SetIcon takes ICON
        set itemIcon=&quot;ReplaceableTextures\\CommandButtons\\$ICON$.blp&quot;
        //! i itemName=&quot;ReplaceableTextures\\CommandButtons\\$ICON$.blp&quot;
    //! endtextmacro
    
    local integer itemPocket=0
    //! i itemPocket=0
    //! textmacro MYSYS__SetPocket takes POCKET
        set itemPocket=$POCKET$
        //! i itemPocket=$POCKET$
    //! endtextmacro
    
    //! i itemTargets=&quot;&quot;
    //! textmacro MYSYS__SetTargets takes TARGETS
        //! i targets=$TARGETS$
    //! endtextmacro
    
    //! i itemRange=0
    //! textmacro MYSYS__SetRange takes RANGE
        //! i range=$RANGE$
    //! endtextmacro
    
    //! i itemTargetType=0
    //! textmacro MYSYS__SetTargetType takes TARGETTYPE
        //! i targetType=$TARGETTYPE$
    //! endtextmacro
    
    //! i itemTargetSize=0
    //! textmacro MYSYS__SetItemTargetSize takes SIZE
        //! i itemTargetSize=$SIZE$
    //! endtextmacro
    
    //! i SPELLBOOK_BASE=&quot;z&quot;
    //! i USE_BASE=&quot;x&quot;
    
    local integer itemNum=0
    //! i itemNum=0
    local integer itemId=0
    //! i itemId=0
    //! textmacro MYSYS__CreateItem
        set itemNum=itemNum+1
        //! i itemNum=itemNum+1
        set itemId=sysIds[itemNum]
        //! ! itemId=sysIds[itemNum]
        
        // Abilities
        //! i setobjecttype(&quot;abilities&quot;)
            
            // Channel (item dummy)
            //! i createobject(&quot;ANcl&quot;,USE_BASE..itemId)
            //! i makechange(current,&quot;aher&quot;,0)
            //! i makechange(current,&quot;alev&quot;,1)
            //! i makechange(current,&quot;acat&quot;,&quot;&quot;)
            //! i makechange(current,&quot;aeat&quot;,&quot;&quot;)
            //! i makechange(current,&quot;aani&quot;,&quot;&quot;)
            //! i makechange(current,&quot;atat&quot;,&quot;&quot;)
            //! i makechange(current,&quot;Ncl1&quot;,1,0)
            
            //! i makechange(current,&quot;Ncl2&quot;,1,itemTargetType)
            //! i makechange(current,&quot;aran&quot;,1,itemRange)
            //! i makechange(current,&quot;atar&quot;,1,itemTargets)
            // options
            //! i makechange(current,&quot;Ncl3&quot;,1,1)
            //! i if itemTargetSize~=0 then
                //! i makechange(current,&quot;Ncl3&quot;,1,3)
                //! i makechange(current,&quot;aare&quot;,1,itemTargetSize)
            //! i end
            
            //! i makechange(current,&quot;Ncl4&quot;,1,0)
            //! i makechange(current,&quot;Ncl5&quot;,1,0)
            //! i makechange(current,&quot;Ncl6&quot;,1,orders[itemNum])
            //! i makechange(current,&quot;atp1&quot;,1,&quot;[|cffffcc00&quot;..itemHotkey..&quot;|c] &quot;..itemName)
            //! i makechange(current,&quot;aub1&quot;,1,itemTooltip)
            //! i makechange(current,&quot;anam&quot;,itemName)
            //! i makechange(current,&quot;ahky&quot;,itemHotkey)
            //! i makechange(current,&quot;aart&quot;,itemIcon)
            
            // Spellbook (group item dummies)
            //! i createobject(&quot;Aspb&quot;,SPELLBOOK_BASE..itemId)
            //! i makechange(current,&quot;Slo1&quot;,1,0)
            //! i makechange(current,&quot;Slo2&quot;,1,0)
            //! i makechange(current,&quot;Slo3&quot;,1,0)
            //! i makechange(current,&quot;ansf&quot;,orders[1])
            //! i makechange(current,&quot;aart&quot;,icon)
            //! i makechange(current,&quot;achd&quot;,0)
            //! i makechange(current,&quot;anam&quot;,&quot;MyName&quot;)
            //! i makechange(current,&quot;acdn&quot;,1,0)
            //! i makechange(current,&quot;ahdu&quot;,1,0)
            //! i makechange(current,&quot;adur&quot;,1,0)
            //! i makechange(current,&quot;alev&quot;,1)
            //! i makechange(current,&quot;amcs&quot;,1,0)
            //! i makechange(current,&quot;abuf&quot;,1,&quot;BBid&quot;)
            //! i makechange(current,&quot;acas&quot;,1,0)
            //! i makechange(current,&quot;atar&quot;,1,&quot;self&quot;)
            //! i makechange(current,&quot;arac&quot;,&quot;unknown&quot;)

//===========================================================================
// CONFIG AREA
//
    globals
        private constant integer ABIL_BASE=&#039;AZ00&#039;
        private constant integer ABIL_SPELL
    endglobals
    //! runtextmacro 
//===========================================================================
        //! endexternalblock
    endfunction
endlibrary

Just something I'm working on, thought I'd show you all for kicks. Please note, it doesn't compile - it's very WIP. It's the kind of thing that we assume isn't possible - things like object data values being calculated based on user input. You can kind of see where it's going there. The way I've been (mis)using it is coding in both LUA and JASS at the same time - which means I can manipulate editor data and JASS at the same time. :thup:

If you use textmacros for functional decomposition (ew! user interface :() then you can make a config area that goes something like:
JASS:
//! runtextmacro CreateItem()
//! runtextmacro SetItemName(&quot;Barky&#039;s Head&quot;)
//! runtextmacro SetItemIcon(&quot;Dog&quot;)
//! runtextmacro CreatePocket()
//...

and it will compile to both object editor data, and JASS code. :thup:

I'm looking at you, Viikuna. ;)

Damn, you just made my brain melt.
 

Rllulium

New Member
Reaction score
10
It's really quick. Adds maybe 1-2 seconds on my computer, which seems practically constant regardless of the abilities.

Seems no one cares much about the design of this.

I finally got around to test this and I must say I quite like this design. Mainly so because of how it manages to stay simple and within the usual context of WC3 design while still being able to provide the wanted improvement over the standard inventory.

I have always thought of the current inventorymods to be imperfect, either clunky to use like the ones that link several standard inventories together, or overcomplicated and heavy like the the fullscreen ones.

If I should give you one advice in how to work with this design, that would be to provide an eaier way of seeing which items that are currently equiped. But I'd guess that to be minor issue for you at the moment.

Best of luck with this project!
 

Jesus4Lyf

Good Idea™
Reaction score
397
>I am not one of them
Hence the bunny, I guess.
I finally got around to test this and I must say I quite like this design. Mainly so because of how it manages to stay simple and within the usual context of WC3 design while still being able to provide the wanted improvement over the standard inventory.

I have always thought of the current inventorymods to be imperfect, either clunky to use like the ones that link several standard inventories together, or overcomplicated and heavy like the the fullscreen ones.

If I should give you one advice in how to work with this design, that would be to provide an eaier way of seeing which items that are currently equiped. But I'd guess that to be minor issue for you at the moment.

Best of luck with this project!
Thanks a stack for your test and feedback, it's appreciated. I gather you meant you tested Savage Creed to see the sys.

I agree, and think an icon change to see what is wielded would be beautiful. Even more object data, but it doesn't cost anything with this interface. Example: You wield a sword and it glows. I might change it so you can change the icon of an item mid game.
JASS:
//! runtextmacro ItemType(&quot;Sword1&quot;)
    //! runtextmacro SetItemName(&quot;My First Sword&quot;)
    //! runtextmacro SetItemDescription(&quot;A really big sword.&quot;)
    //! runtextmacro SetItemIcon(&quot;1&quot;,&quot;ThatSwordUpgradeThing&quot;)
    //! runtextmacro SetItemIcon(&quot;1&quot;,&quot;ThatBiggerSwordUpgradeThing&quot;)
//! runtextmacro ItemStruct()
    private boolean wielded=false
    private method onUse takes nothing returns nothing
        if this.wielded then
            call this.setIcon(1)
            // debuff unit
        else
            call this.setIcon(2)
            // buff unit
        endif
    endmethod
    private method onDrop takes nothing returns nothing
        if this.wielded then
            call this.setIcon(1)
            // debuff unit.
        endif
    endmethod
//! runtextmacro EndItem()

Thoughts?

Edit: My friend suggested putting all wielded items in the buff tray.
 

weaaddar

New Member
Reaction score
6
This is quiet neat and circumvents part of the reason most people work with Items as opposed to abilities (because Items are less of a pain in the ass in the object editor).

What I would suggest is perhaps model attachment for itemtypes or option model attachments. That way one could create a modified Arthas for instance that has no weapon, and with the hammer equipped, you'd attach a hammer model to the weapon spot, and with the sword equipped you'd attach a weapon...)

I would suggest incorporating an event Model like ItemMenu's. In fact, I'd like it better if you made generic ability menus, like ItemMenu was supposed to do for items. (but I got lazy and i can't figure out some bugs). That way people can have choices between Dialogs,ItemMenus, and AbilityMenus.

Really neat work. The syntax is horrible though.
 

Hatebreeder

So many apples
Reaction score
381
Holy...
How did you manage that interface with alll the clickables?

I am starting to like this =)
Although, I am more interested in the Clickable screen thingy than the Item stuff; I can see how WC3 becomes a Mod's Platform to introduce whole new projects. Plus, those Projects are also hostable in the internet =P

I remember Nestharus or something wanting to do a MPQ hack, so that an infinite number of object can be imported. Don't know if that possible though :D

HMMMMM... ^^
 

Lyerae

I keep popping up on this site from time to time.
Reaction score
105
> wanting to do a MPQ hack

Why do an MPQ hack? Just do something with the exe, and overhaul the entire thing.
Like RtC.
There's enough programmers playing WC3 to get it done. We just need the motivation.
 

Jesus4Lyf

Good Idea™
Reaction score
397
Holy...
How did you manage that interface with alll the clickables?
XD

>I am more interested in the Clickable screen thingy than the Item stuff
That's the thing. I used a lot of object data which I created by hand for that map. It's open source now, but the point was it was impractical to map with. This item system I'm now writing is meant to do all that automatically. Basically porting it to a maintainable interface. :)

Another little preview (I don't think the syntax is too bad...):
JASS:
//! runtextmacro ItemType(&quot;BarkysHead&quot;)
    //! runtextmacro SetItemName(&quot;Barky&#039;s Head&quot;)
    //! runtextmacro SetItemIcon(&quot;ReplacableTextures\\CommandButtons\\Dog.blp&quot;)
    //! runtextmacro SetItemDescription(&quot;The head of Barky the dog. No longer barking.&quot;)
//! runtextmacro ItemStruct()
    integer clicks=0 // item attachment.
    private method onUse takes nothing returns nothing
        set this.clicks=0 // attaches value to item.
    endmethod
//! runtextmacro EndItem()

//...

call CreateItemXY(BarkysHead,0,0)
call CreateItemUnit(BarkysHead,GetTriggeringUnit())

>I remember Nestharus or something wanting to do a MPQ hack
Why is that useful?...
 
Reaction score
341
I think this would be better off with an external preprocessor.

This way you can make the syntax whatever you want.
Hell you can even make it compile into textmacros.
 
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