HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

JASS - Inventory Equipment System (Help)

11-17-2008, 01:43 AM#1
xAbysSx
Okay, so I'm using the AAA Intventory system in my map. I have the Caster System and everything, but I'm not the best at Jass. When I try to enable the triggers, I get tons of errors, and I dont know why but its telling me its 'Expected a Name'.
Here is the main line I have been working on, Ive got the trigger customised and ready, just needs to be fixed up to fit my map.

Code:
function BackpackHasEmptySlots takes string s returns boolean
    local integer a = 1
    loop
        exitwhen a > BackpackSize()
        if GetTableItem(s, "BackpackItem"+I2S(a)) == null then
            return true
        endif
        set a = a+1
    endloop
    return false
endfunction
The specific line im looking at is:
if GetTableItem(s, "BackpackItem"+I2S(a)) == null then

And the I2S is here (if you're wondering what that is):
Code:
function SetItemBonuses takes integer itemId, integer dmg, integer arm, integer hp, integer mp, integer str, integer agi, integer int, integer abil, string equipSlot, string equipFunc, string unequipFunc returns nothing
    local gamecache g = InventoryCache()
    local string s = I2S(itemId)

So if I could get help on the 'Expected a Name' thing, that would be great.
11-17-2008, 01:56 AM#2
Here-b-Trollz
make sure caster system is in your custom script, since you are going retro on us.

oh, and also: [jass][/jass]
11-17-2008, 02:21 AM#3
xAbysSx
Well yeah, this trigger requires it, so I imagine its already able to load it. But the part that "Expected a Name" has me stumped. It works perfect in the AAAInventory map, but not mine, and I have all the variables from that map.
11-17-2008, 03:27 AM#4
Here-b-Trollz
jesus. I had to get out vanilla editor in order to get this error. It looks like you get it when trying to use a variable/function that doesn't exist/is not yet declared.

You are sure that the Caster System is before this system in your map script?
11-17-2008, 07:03 AM#5
xAbysSx
Okay, forget that above, theres one last thing stopping me from this working properly.

In the AAA Inventory map theres a GUI Custom Script, that my map will not let me paste. I've customised it so that it works at the right time, thats all. I also tried at Map Init, like the Inventory Map has, that works on that map, still doesnt work on my map.

The line is:
Code:
Custom script:   call CreateExtendedInventory(udg_TESTUNIT)

Heres the AAA Inventory map's trigger, containing this code:
Code:
Initialization
    Events
        Map initialization
    Conditions
    Actions
        Custom script:   call BJDebugMsg("|cffccff00AAAInventory System - Azeroth's Arcane Arena|r")
        Custom script:   call BJDebugMsg("* System and demo map by: |cffccff00Blade.dk|r")
        Custom script:   call BJDebugMsg("* Caster system and modifications to BonusMod by: |cffccff00Vexorian|r")
        Custom script:   call BJDebugMsg("* BonusMod by: |cffccff00weaaddar|r")
        Custom script:   call BJDebugMsg("GIVE CREDIT IF YOU USE OR EDIT THIS SYSTEM!")
        Custom script:   call InitBonusMod()
        Set TESTUNIT = Blademaster 0001 <gen>
        Custom script:   call CreateExtendedInventory(udg_TESTUNIT)
        Set TESTUNIT = Blood Mage 0033 <gen>
        Custom script:   call CreateExtendedInventory(udg_TESTUNIT)

Heres what I did, and when I try to host my game to test it says 'Game Not Found'
Code:
Defender
    Events
        Player - Player 1 (Red) types a chat message containing -def as An exact match
        Player - Player 2 (Blue) types a chat message containing -def as An exact match
        Player - Player 3 (Teal) types a chat message containing -def as An exact match
        Player - Player 4 (Purple) types a chat message containing -def as An exact match
        Player - Player 5 (Yellow) types a chat message containing -def as An exact match
        Player - Player 6 (Orange) types a chat message containing -def as An exact match
        Player - Player 7 (Green) types a chat message containing -def as An exact match
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Number of units in (Units in (Playable map area) owned by (Triggering player))) Equal to 0
            Then - Actions
                Camera - Reset camera for (Triggering player) to standard game-view over 0.00 seconds
                Unit - Create 1 Defender for (Triggering player) at (Center of Respawn <gen>) facing Default building facing degrees
                Set Hero[(Player number of (Owner of (Last created unit)))] = (Last created unit)
                Selection - Select Hero[(Player number of (Triggering player))] for (Triggering player)
                Camera - Pan camera for (Owner of (Last created unit)) to (Center of Respawn <gen>) over 0.00 seconds
                Set TESTUNIT = Hero[(Player number of (Owner of (Last created unit)))]
                Player - Set (Owner of Hero[(Player number of (Owner of (Last created unit)))]) Current lumber to 1
                Custom script:   call CreateExtendedInventory(udg_TESTUNIT)
            Else - Actions
11-19-2008, 07:36 AM#6
xAbysSx
Still havent found a solution, and to eliminate another possibility, I do have the trigger for the .w3x copied to my map from the other.
11-23-2008, 03:44 AM#7
xAbysSx
Nevermind everyone, after all the time I spent with it, I decided to use a better, more complex system. Haha, oh well, I learned a couple things from it anyhow.