Jesus4Lyf
Good Idea™
- Reaction score
- 397
Edit: Jump to here for post regarding inventory system.
In case we ran out of interfacing confusion...
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:
and it will compile to both object editor data, and JASS code. :thup:
I'm looking at you, Viikuna.
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]=039;0$SYSID$X039;
//! 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=039;AZ00039;
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.