I downloaded the custom inventory by anachron and i made it work in my map somehow... i have no knowlage in jass at all but with the test unit it spawn i could see my inventory and made a potion work all by myself with a custom icone so i think i can handle myself for the rest... problem is that i have a trigger to choose the hero and i dont know how to call the system when i spawn my hero.. I think i figured it out but the editor give me an error... can anyone take a look at it and tell me whats wrong?
The test unit script in jass is:
i picked the lines:
local unit fakeInv = null
local unit hero = null
set fakeInv = CreateInventoryUnit(Player(i), 'h000')
set hero = CreateUnit(Player(i), 'Hpal', 0., 0., 0.)
call CreateInventoryUI(hero, fakeInv)
As my trigger is based on a unit spawning when you press escape when in the right area, i changed "set hero = CreateUnit(Player(i), 'Hpal', 0., 0., 0.)" for "set hero = GetLastCreatedUnit()
Now part of my trigger look like that:
Any help...?
The test unit script in jass is:
JASS:
scope test initializer init
private function init takes nothing returns nothing
local unit fakeInv = null
local unit hero = null
local integer i = 0
loop
exitwhen i >= 12
if GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING and GetPlayerController(Player(i)) == MAP_CONTROL_USER then
set fakeInv = CreateInventoryUnit(Player(i), 'h000')
set hero = CreateUnit(Player(i), 'Hpal', 0., 0., 0.)
call CreateInventoryUI(hero, fakeInv)
endif
set i = i +1
endloop
endfunction
endscope
i picked the lines:
local unit fakeInv = null
local unit hero = null
set fakeInv = CreateInventoryUnit(Player(i), 'h000')
set hero = CreateUnit(Player(i), 'Hpal', 0., 0., 0.)
call CreateInventoryUI(hero, fakeInv)
As my trigger is based on a unit spawning when you press escape when in the right area, i changed "set hero = CreateUnit(Player(i), 'Hpal', 0., 0., 0.)" for "set hero = GetLastCreatedUnit()
Now part of my trigger look like that:
-
Geomancer choose
-

Events
-


Player - Player 1 (Red) skips a cinematic sequence
-


Player - Player 2 (Blue) skips a cinematic sequence
-


Player - Player 3 (Teal) skips a cinematic sequence
-


Player - Player 4 (Purple) skips a cinematic sequence
-
-

Conditions
-

Actions
-


Unit Group - Pick every unit in (Units in Geomancer choose <gen>) and do (Actions)
-



Loop - Actions
-




Custom script: local integer i = 0
-




Custom script: local unit fakeInv = null
-




Custom script: local unit hero = null
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






(Owner of (Picked unit)) Equal to Player 1 (Red)
-
-





Then - Actions
-






Cinematic - Clear the screen of text messages for (All players matching ((Triggering player) Equal to (Matching player)))
-






Set playerclass[1] = 1
-






Player Group - Add Player 1 (Red) to players
-






Set playersnumber = (playersnumber + 1)
-






Unit - Remove (Picked unit) from the game
-






Game - Display to Player Group - Player 1 (Red) the text: |cffFFCC00You choos...
-






Player - Set Player 1 (Red) Current gold to 200
-






Custom script: set fakeInv = CreateInventoryUnit(Player(1), 'h000')
-






Unit - Create 1 Geomancer for Player 1 (Red) at (Center of Hero Spawn <gen>) facing Default building facing degrees
-






Custom script: set hero = GetLastCreatedUnit()
-






Custom script: call CreateInventoryUI(hero, fakeInv)
-






Custom script: set i = i +1
-






Camera - Pan camera for Player 1 (Red) to (Center of Hero Spawn <gen>) over 0.00 seconds
-






Selection - Select (Last created unit) for Player 1 (Red)
-






Player - Disable Fire Burst for Player 1 (Red)
-






Player - Disable Burning Attack for Player 1 (Red)
-






Trigger - Turn on Geomancer unavaible <gen>
-






Trigger - Turn off Geomancer info <gen>
-






Trigger - Turn off (This trigger)
-
-





Else - Actions
-
-
-
-
-
Any help...?


