• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Inventory Switching :3

Status
Not open for further replies.
Level 11
Joined
Oct 31, 2010
Messages
1,057
anyone tell me why this doesn't work O:? i tried changing the trigger of this inventory system by the flood to make it switch when a unit casts a spell but it does not work O:

The system makes it so when you click the helmet (item) it changes your inventory to another inventory

the original triggers activate when the unit clicks on the helmet icon

while i tried changing it and making it activate when the units starts the spell

the problem is that the messages in the triggers run but the inventory switch does not run O:

  • Open Eq Menu
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Equipment Menu
    • Actions
      • Set InEqMenu[(Player number of (Owner of (Triggering unit)))] = True
      • -------- - - - - --------
      • -------- Store items in the normal inventory. --------
      • -------- - - - - --------
      • Set Item_Normal1[(Player number of (Owner of (Triggering unit)))] = (Item-type of (Item carried by Hero[(Player number of (Owner of (Triggering unit)))] in slot 1))
      • Set Item_Normal1_ChargesLeft[(Player number of (Owner of (Triggering unit)))] = (Charges remaining in (Item carried by (Triggering unit) in slot 1))
      • Set Item_Normal2[(Player number of (Owner of (Triggering unit)))] = (Item-type of (Item carried by Hero[(Player number of (Owner of (Triggering unit)))] in slot 2))
      • Set Item_Normal2_ChargesLeft[(Player number of (Owner of (Triggering unit)))] = (Charges remaining in (Item carried by (Triggering unit) in slot 2))
      • Set Item_Normal3[(Player number of (Owner of (Triggering unit)))] = (Item-type of (Item carried by Hero[(Player number of (Owner of (Triggering unit)))] in slot 3))
      • Set Item_Normal3_ChargesLeft[(Player number of (Owner of (Triggering unit)))] = (Charges remaining in (Item carried by (Triggering unit) in slot 3))
      • Set Item_Normal4[(Player number of (Owner of (Triggering unit)))] = (Item-type of (Item carried by Hero[(Player number of (Owner of (Triggering unit)))] in slot 4))
      • Set Item_Normal4_ChargesLeft[(Player number of (Owner of (Triggering unit)))] = (Charges remaining in (Item carried by (Triggering unit) in slot 4))
      • Set Item_Normal5[(Player number of (Owner of (Triggering unit)))] = (Item-type of (Item carried by Hero[(Player number of (Owner of (Triggering unit)))] in slot 5))
      • Set Item_Normal5_ChargesLeft[(Player number of (Owner of (Triggering unit)))] = (Charges remaining in (Item carried by (Triggering unit) in slot 5))
      • Set Item_Normal6[(Player number of (Owner of (Triggering unit)))] = (Item-type of (Item carried by Hero[(Player number of (Owner of (Triggering unit)))] in slot 6))
      • Set Item_Normal6_ChargesLeft[(Player number of (Owner of (Triggering unit)))] = (Charges remaining in (Item carried by (Triggering unit) in slot 6))
      • For each (Integer B) from 1 to 6, do (Actions)
        • Loop - Actions
          • Item - Remove (Item carried by Hero[(Player number of (Owner of (Triggering unit)))] in slot (Integer B))
      • -------- - - - - --------
      • -------- Recreate the items in your equipment menu. --------
      • -------- - - - - --------
      • Hero - Create Item_Head[(Player number of (Owner of (Triggering unit)))] and give it to Hero[(Player number of (Owner of (Triggering unit)))]
      • Item - Make (Last created item) Undroppable
      • Hero - Create Item_Armor[(Player number of (Owner of (Triggering unit)))] and give it to Hero[(Player number of (Owner of (Triggering unit)))]
      • Item - Make (Last created item) Undroppable
      • Hero - Create Item_Weapon[(Player number of (Owner of (Triggering unit)))] and give it to Hero[(Player number of (Owner of (Triggering unit)))]
      • Item - Make (Last created item) Undroppable
      • Hero - Create Item_Shield[(Player number of (Owner of (Triggering unit)))] and give it to Hero[(Player number of (Owner of (Triggering unit)))]
      • Item - Make (Last created item) Undroppable
      • Hero - Create Item_Amulet[(Player number of (Owner of (Triggering unit)))] and give it to Hero[(Player number of (Owner of (Triggering unit)))]
      • Item - Make (Last created item) Undroppable
      • Hero - Create Item_Ring[(Player number of (Owner of (Triggering unit)))] and give it to Hero[(Player number of (Owner of (Triggering unit)))]
      • Item - Make (Last created item) Undroppable
      • -------- - - - - --------
      • Set playergroup = (Player group((Owner of (Triggering unit))))
      • Game - Display to playergroup for 5.00 seconds the text: |cffffcc00Exit the ...
      • Custom script: call DestroyForce(udg_playergroup)
[/trigger]
  • Close Eq Menu
    • 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
      • Player - Player 5 (Yellow) skips a cinematic sequence
      • Player - Player 6 (Orange) skips a cinematic sequence
      • Player - Player 7 (Green) skips a cinematic sequence
      • Player - Player 8 (Pink) skips a cinematic sequence
      • Player - Player 9 (Gray) skips a cinematic sequence
      • Player - Player 10 (Light Blue) skips a cinematic sequence
      • Player - Player 11 (Dark Green) skips a cinematic sequence
      • Player - Player 12 (Brown) skips a cinematic sequence
    • Conditions
      • InEqMenu[(Player number of (Triggering player))] Equal to True
    • Actions
      • Set InEqMenu[(Player number of (Triggering player))] = False
      • -------- - - - - --------
      • -------- Store items in the equipment menu. --------
      • -------- - - - - --------
      • Set Item_Head[(Player number of (Triggering player))] = (Item-type of (Item carried by Hero[(Player number of (Triggering player))] in slot 1))
      • Set Item_Armor[(Player number of (Triggering player))] = (Item-type of (Item carried by Hero[(Player number of (Triggering player))] in slot 2))
      • Set Item_Weapon[(Player number of (Triggering player))] = (Item-type of (Item carried by Hero[(Player number of (Triggering player))] in slot 3))
      • Set Item_Shield[(Player number of (Triggering player))] = (Item-type of (Item carried by Hero[(Player number of (Triggering player))] in slot 4))
      • Set Item_Amulet[(Player number of (Triggering player))] = (Item-type of (Item carried by Hero[(Player number of (Triggering player))] in slot 5))
      • Set Item_Ring[(Player number of (Triggering player))] = (Item-type of (Item carried by Hero[(Player number of (Triggering player))] in slot 6))
      • For each (Integer B) from 1 to 6, do (Actions)
        • Loop - Actions
          • Item - Remove (Item carried by Hero[(Player number of (Triggering player))] in slot (Integer B))
      • -------- - - - - --------
      • -------- Recreate the items in your normal inventory. --------
      • -------- - - - - --------
      • Hero - Create Item_Normal1[(Player number of (Triggering player))] and give it to Hero[(Player number of (Triggering player))]
      • Unit - Order Hero[(Player number of (Triggering player))] to move (Last created item) to inventory slot 1
      • Item - Set charges remaining in (Last created item) to Item_Normal1_ChargesLeft[(Player number of (Triggering player))]
      • -------- - - - - --------
      • Hero - Create Item_Normal2[(Player number of (Triggering player))] and give it to Hero[(Player number of (Triggering player))]
      • Unit - Order Hero[(Player number of (Triggering player))] to move (Last created item) to inventory slot 2
      • Item - Set charges remaining in (Last created item) to Item_Normal2_ChargesLeft[(Player number of (Triggering player))]
      • -------- - - - - --------
      • Hero - Create Item_Normal3[(Player number of (Triggering player))] and give it to Hero[(Player number of (Triggering player))]
      • Unit - Order Hero[(Player number of (Triggering player))] to move (Last created item) to inventory slot 3
      • Item - Set charges remaining in (Last created item) to Item_Normal3_ChargesLeft[(Player number of (Triggering player))]
      • -------- - - - - --------
      • Hero - Create Item_Normal4[(Player number of (Triggering player))] and give it to Hero[(Player number of (Triggering player))]
      • Unit - Order Hero[(Player number of (Triggering player))] to move (Last created item) to inventory slot 4
      • Item - Set charges remaining in (Last created item) to Item_Normal4_ChargesLeft[(Player number of (Triggering player))]
      • -------- - - - - --------
      • Hero - Create Item_Normal5[(Player number of (Triggering player))] and give it to Hero[(Player number of (Triggering player))]
      • Unit - Order Hero[(Player number of (Triggering player))] to move (Last created item) to inventory slot 5
      • Item - Set charges remaining in (Last created item) to Item_Normal5_ChargesLeft[(Player number of (Triggering player))]
      • -------- - - - - --------
      • Hero - Create Item_Normal6[(Player number of (Triggering player))] and give it to Hero[(Player number of (Triggering player))]
      • Unit - Order Hero[(Player number of (Triggering player))] to move (Last created item) to inventory slot 6
      • Item - Set charges remaining in (Last created item) to Item_Normal6_ChargesLeft[(Player number of (Triggering player))]
  • Open Eq Menu
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • InEqMenu[(Player number of (Triggering player))] Equal to True
      • (Ability being cast) Equal to Inventory Switch
    • Actions
      • Set InEqMenu[(Player number of (Owner of (Triggering unit)))] = True
      • -------- - - - - --------
      • -------- Store items in the normal inventory. --------
      • -------- - - - - --------
      • Set Item_Normal1[(Player number of (Owner of (Triggering unit)))] = (Item-type of (Item carried by Hero[(Player number of (Owner of (Triggering unit)))] in slot 1))
      • Set Item_Normal1_ChargesLeft[(Player number of (Owner of (Triggering unit)))] = (Charges remaining in (Item carried by (Triggering unit) in slot 1))
      • Set Item_Normal2[(Player number of (Owner of (Triggering unit)))] = (Item-type of (Item carried by Hero[(Player number of (Owner of (Triggering unit)))] in slot 2))
      • Set Item_Normal2_ChargesLeft[(Player number of (Owner of (Triggering unit)))] = (Charges remaining in (Item carried by (Triggering unit) in slot 2))
      • Set Item_Normal3[(Player number of (Owner of (Triggering unit)))] = (Item-type of (Item carried by Hero[(Player number of (Owner of (Triggering unit)))] in slot 3))
      • Set Item_Normal3_ChargesLeft[(Player number of (Owner of (Triggering unit)))] = (Charges remaining in (Item carried by (Triggering unit) in slot 3))
      • Set Item_Normal4[(Player number of (Owner of (Triggering unit)))] = (Item-type of (Item carried by Hero[(Player number of (Owner of (Triggering unit)))] in slot 4))
      • Set Item_Normal4_ChargesLeft[(Player number of (Owner of (Triggering unit)))] = (Charges remaining in (Item carried by (Triggering unit) in slot 4))
      • Set Item_Normal5[(Player number of (Owner of (Triggering unit)))] = (Item-type of (Item carried by Hero[(Player number of (Owner of (Triggering unit)))] in slot 5))
      • Set Item_Normal5_ChargesLeft[(Player number of (Owner of (Triggering unit)))] = (Charges remaining in (Item carried by (Triggering unit) in slot 5))
      • Set Item_Normal6[(Player number of (Owner of (Triggering unit)))] = (Item-type of (Item carried by Hero[(Player number of (Owner of (Triggering unit)))] in slot 6))
      • Set Item_Normal6_ChargesLeft[(Player number of (Owner of (Triggering unit)))] = (Charges remaining in (Item carried by (Triggering unit) in slot 6))
      • For each (Integer B) from 1 to 6, do (Actions)
        • Loop - Actions
          • Item - Remove (Item carried by Hero[(Player number of (Owner of (Triggering unit)))] in slot (Integer B))
      • -------- - - - - --------
      • -------- Recreate the items in your equipment menu. --------
      • -------- - - - - --------
      • Hero - Create Item_Head[(Player number of (Owner of (Triggering unit)))] and give it to Hero[(Player number of (Owner of (Triggering unit)))]
      • Item - Make (Last created item) Undroppable
      • Hero - Create Item_Armor[(Player number of (Owner of (Triggering unit)))] and give it to Hero[(Player number of (Owner of (Triggering unit)))]
      • Item - Make (Last created item) Undroppable
      • Hero - Create Item_Weapon[(Player number of (Owner of (Triggering unit)))] and give it to Hero[(Player number of (Owner of (Triggering unit)))]
      • Item - Make (Last created item) Undroppable
      • Hero - Create Item_Shield[(Player number of (Owner of (Triggering unit)))] and give it to Hero[(Player number of (Owner of (Triggering unit)))]
      • Item - Make (Last created item) Undroppable
      • Hero - Create Item_Amulet[(Player number of (Owner of (Triggering unit)))] and give it to Hero[(Player number of (Owner of (Triggering unit)))]
      • Item - Make (Last created item) Undroppable
      • Hero - Create Item_Ring[(Player number of (Owner of (Triggering unit)))] and give it to Hero[(Player number of (Owner of (Triggering unit)))]
      • Item - Make (Last created item) Undroppable
      • -------- - - - - --------
      • Set playergroup = (Player group((Owner of (Triggering unit))))
      • Game - Display to playergroup for 5.00 seconds the text: |cffffcc00Exit the ...
      • Custom script: call DestroyForce(udg_playergroup)
  • Close Eq Menu
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • InEqMenu[(Player number of (Triggering player))] Equal to True
      • (Ability being cast) Equal to Inventory Switch
    • Actions
      • Set InEqMenu[(Player number of (Triggering player))] = False
      • -------- - - - - --------
      • -------- Store items in the equipment menu. --------
      • -------- - - - - --------
      • Set Item_Head[(Player number of (Triggering player))] = (Item-type of (Item carried by Hero[(Player number of (Triggering player))] in slot 1))
      • Set Item_Armor[(Player number of (Triggering player))] = (Item-type of (Item carried by Hero[(Player number of (Triggering player))] in slot 2))
      • Set Item_Weapon[(Player number of (Triggering player))] = (Item-type of (Item carried by Hero[(Player number of (Triggering player))] in slot 3))
      • Set Item_Shield[(Player number of (Triggering player))] = (Item-type of (Item carried by Hero[(Player number of (Triggering player))] in slot 4))
      • Set Item_Amulet[(Player number of (Triggering player))] = (Item-type of (Item carried by Hero[(Player number of (Triggering player))] in slot 5))
      • Set Item_Ring[(Player number of (Triggering player))] = (Item-type of (Item carried by Hero[(Player number of (Triggering player))] in slot 6))
      • For each (Integer B) from 1 to 6, do (Actions)
        • Loop - Actions
          • Item - Remove (Item carried by Hero[(Player number of (Triggering player))] in slot (Integer B))
      • -------- - - - - --------
      • -------- Recreate the items in your normal inventory. --------
      • -------- - - - - --------
      • Hero - Create Item_Normal1[(Player number of (Triggering player))] and give it to Hero[(Player number of (Triggering player))]
      • Unit - Order Hero[(Player number of (Triggering player))] to move (Last created item) to inventory slot 1
      • Item - Set charges remaining in (Last created item) to Item_Normal1_ChargesLeft[(Player number of (Triggering player))]
      • -------- - - - - --------
      • Hero - Create Item_Normal2[(Player number of (Triggering player))] and give it to Hero[(Player number of (Triggering player))]
      • Unit - Order Hero[(Player number of (Triggering player))] to move (Last created item) to inventory slot 2
      • Item - Set charges remaining in (Last created item) to Item_Normal2_ChargesLeft[(Player number of (Triggering player))]
      • -------- - - - - --------
      • Hero - Create Item_Normal3[(Player number of (Triggering player))] and give it to Hero[(Player number of (Triggering player))]
      • Unit - Order Hero[(Player number of (Triggering player))] to move (Last created item) to inventory slot 3
      • Item - Set charges remaining in (Last created item) to Item_Normal3_ChargesLeft[(Player number of (Triggering player))]
      • -------- - - - - --------
      • Hero - Create Item_Normal4[(Player number of (Triggering player))] and give it to Hero[(Player number of (Triggering player))]
      • Unit - Order Hero[(Player number of (Triggering player))] to move (Last created item) to inventory slot 4
      • Item - Set charges remaining in (Last created item) to Item_Normal4_ChargesLeft[(Player number of (Triggering player))]
      • -------- - - - - --------
      • Hero - Create Item_Normal5[(Player number of (Triggering player))] and give it to Hero[(Player number of (Triggering player))]
      • Unit - Order Hero[(Player number of (Triggering player))] to move (Last created item) to inventory slot 5
      • Item - Set charges remaining in (Last created item) to Item_Normal5_ChargesLeft[(Player number of (Triggering player))]
      • -------- - - - - --------
      • Hero - Create Item_Normal6[(Player number of (Triggering player))] and give it to Hero[(Player number of (Triggering player))]
      • Unit - Order Hero[(Player number of (Triggering player))] to move (Last created item) to inventory slot 6
      • Item - Set charges remaining in (Last created item) to Item_Normal6_ChargesLeft[(Player number of (Triggering player))]
 

Attachments

  • Equipment System The_Flood(Flood) V2.2a.w3x
    81.6 KB · Views: 44
Level 12
Joined
Oct 16, 2010
Messages
680
  • Conditions
    • InEqMenu[(Player number of (Triggering player))] Equal to True
    • (Ability being cast) Equal to Inventory Switch
  • Conditions
    • InEqMenu[(Player number of (Triggering player))] Equal to True
    • (Ability being cast) Equal to Inventory Switch
see? in the upper trigger InEqMenu should Equal to False

that is why the upper trigger will run always..
 
Level 12
Joined
Oct 16, 2010
Messages
680
EqOrUnEq trigger were hylarious. changed


you doesen't set event for the initializations...

Added
JASS:
function HeadInit takes nothing returns nothing
    local trigger trig = CreateTrigger()
    call TriggerRegisterTimerEvent(trig , 0.01 , false)
    call TriggerAddAction(trig, function InitTrig_Head_Initialization)
endfunction

and i think the reason it don't opens the "eq inventory"

when two triggers called for the same event
thay will run after each other

since you set inEqMenu ... = true
it will allow the second trigger to run as well

to solve
I created a second spell for exiting eq menu

wait a few min im still testing
 
Level 12
Joined
Oct 16, 2010
Messages
680
finally it works perfectly.

cleaned up a bit the EqOrUnEq triggers

"switch inventory quit" spell added

and now it actually sets your initializing trigger

(the initializings were 1 single functions . Thats not how it works. In Jass you have to create the trigger and register it on an event - or if not it will run on map init) You can see how i did.



EDIT: and replace these
  • Hero - Create Item_Normal1[(Player number of (Triggering player))] and give it to Hero[(Player number of (Triggering player))]
with
  • Hero - Create Item_Normal1[(Player number of (Triggering player))] and give it to (Triggering Unit)
in Hero array you should store Hero types not exact units
 
Level 11
Joined
Oct 31, 2010
Messages
1,057
i already have a save/load system,but the problem is how do i make the save/load system detect the invisible inventory and save it then load it so at the next game , the player will have the inventory system
 
Level 12
Joined
Oct 16, 2010
Messages
680
is the save/load system had been created by you?

if not that would be quite a challange

mainly you don't save the inventory in this situation,BUT the variables storing your equipment and normal items
You already have the items saved in the variables, now you just need to code it somehow.
 
Level 11
Joined
Oct 31, 2010
Messages
1,057
um, no but the save/load system i got seems very easy and i could understand the triggers,
  • SaveLoad Save All
    • Events
      • Player - Player 1 (Red) types a chat message containing -save as An exact match
      • Player - Player 2 (Blue) types a chat message containing -save as An exact match
      • Player - Player 3 (Teal) types a chat message containing -save as An exact match
      • Player - Player 4 (Purple) types a chat message containing -save as An exact match
    • Conditions
    • Actions
      • -------- Prepare the save array with this player's Hero --------
      • Set SaveCount = 0
      • -------- Player's Gold --------
      • Set SaveCount = (SaveCount + 1)
      • Set Save[SaveCount] = ((Triggering player) Current gold)
      • -------- Take all Heroes --------
      • Set UnitGroup = (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True))
      • Set SaveCount = (SaveCount + 1)
      • Set Save[SaveCount] = (Number of units in UnitGroup)
      • Unit Group - Pick every unit in UnitGroup and do (Actions)
        • Loop - Actions
          • -------- Save the Hero --------
          • Set SaveCount = (SaveCount + 1)
          • Set TempUnit = (Picked unit)
          • Custom script: set udg_Save[udg_SaveCount] = SaveLoad_Unit2Integer( udg_TempUnit )
          • -------- Hero Experience --------
          • Set SaveCount = (SaveCount + 1)
          • Set Save[SaveCount] = (Hero experience of (Picked unit))
          • -------- Hero Position X --------
          • Set SaveCount = (SaveCount + 1)
          • Set Save[SaveCount] = (Integer((X of (Position of (Picked unit)))))
          • -------- Hero Position Y --------
          • Set SaveCount = (SaveCount + 1)
          • Set Save[SaveCount] = (Integer((Y of (Position of (Picked unit)))))
          • -------- How many items does he carry --------
          • Set SaveCount = (SaveCount + 1)
          • Set Save[SaveCount] = (Number of items carried by (Picked unit))
          • -------- Add all items --------
          • For each (Integer A) from 1 to 6, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Item carried by (Picked unit) in slot (Integer A)) is owned) Equal to True
                • Then - Actions
                  • -------- The actual item --------
                  • Set SaveCount = (SaveCount + 1)
                  • Set TempItem = (Item carried by (Picked unit) in slot (Integer A))
                  • Custom script: set udg_Save[udg_SaveCount] = SaveLoad_Item2Integer( udg_TempItem )
                  • -------- The number of charges it has --------
                  • Set SaveCount = (SaveCount + 1)
                  • Set Save[SaveCount] = (Charges remaining in (Item carried by (Picked unit) in slot (Integer A)))
                • Else - Actions
      • -------- Turn values into code --------
      • Custom script: set udg_Code = SaveLoad_Encode()
      • -------- Show code to player --------
      • Quest - Display to (Player group((Triggering player))) the Secret message: Your code:
      • Game - Display to (Player group((Triggering player))) for 60.00 seconds the text: Code
  • SaveLoad Load All
    • Events
      • Player - Player 1 (Red) types a chat message containing -load as A substring
      • Player - Player 2 (Blue) types a chat message containing -load as A substring
      • Player - Player 3 (Teal) types a chat message containing -load as A substring
      • Player - Player 4 (Purple) types a chat message containing -load as A substring
    • Conditions
      • (Substring((Entered chat string), 1, 6)) Equal to (Matched chat string)
      • (Length of (Entered chat string)) Greater than 6
    • Actions
      • -------- Try to decode what was typed --------
      • Set Code = (Substring((Entered chat string), 7, (Length of (Entered chat string))))
      • Custom script: set udg_Validate = SaveLoad_Decode( udg_Code )
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Validate Equal to False
        • Then - Actions
          • -------- Invalid code --------
          • Game - Display to (Player group((Triggering player))) the text: There's some error ...
          • Skip remaining actions
        • Else - Actions
      • -------- It worked, let's do something with it --------
      • Unit Group - Pick every unit in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
      • Set SaveCount = 1
      • -------- Restore Gold --------
      • Player - Set (Triggering player) Current gold to Save[SaveCount]
      • -------- For "number of Heroes", do --------
      • Set SaveCount = (SaveCount + 1)
      • For each (Integer B) from 1 to Save[SaveCount], do (Actions)
        • Loop - Actions
          • -------- Restore Hero --------
          • Set SaveCount = (SaveCount + 1)
          • Custom script: set udg_TempUnitType = SaveLoad_Integer2Unit(udg_Save[udg_SaveCount])
          • Unit - Create 1 TempUnitType for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
          • -------- Set Experience --------
          • Set SaveCount = (SaveCount + 1)
          • Hero - Set (Last created unit) experience to Save[SaveCount], Hide level-up graphics
          • -------- Move to saved position --------
          • Set SaveCount = (SaveCount + 1)
          • Unit - Move (Last created unit) instantly to (Point((Real(Save[SaveCount])), (Real(Save[(SaveCount + 1)]))))
          • Set SaveCount = (SaveCount + 1)
          • -------- Recreate all items --------
          • Set SaveCount = (SaveCount + 1)
          • For each (Integer A) from 1 to Save[SaveCount], do (Actions)
            • Loop - Actions
              • -------- The actual item --------
              • Set SaveCount = (SaveCount + 1)
              • Custom script: set udg_TempItemType = SaveLoad_Integer2Item(udg_Save[udg_SaveCount])
              • Hero - Create TempItemType and give it to (Last created unit)
              • -------- Number of charges --------
              • Set SaveCount = (SaveCount + 1)
              • Item - Set charges remaining in (Last created item) to Save[SaveCount]
this save/load system seems simple because ,

savecount [1] would be the gold
savecount [2] units owned
savecount [3] hero
savecount [4] hero exp
savecount [5] hero position X
savecount [6] hero position Y
savecount [7] items carried amount
savecount [8-14] items that are in inventory
---------------------------------------
so i want to put savecount[15-21] as the items in the inventory system but i don't know which variable to take O:
 
Level 12
Joined
Oct 16, 2010
Messages
680
the problem is... the systems inventory saving is simple

your system acts as you have two inventory, but... you don't
if you currently in the equipment inventory

this system will save that stuff instead your normal items:/

but as i said, do this:


  • ------- The actual item --------
    • Set SaveCount = (SaveCount + 1)
    • Custom script: set udg_Save[udg_SaveCount] = SaveLoad_Item2Integer(Item_Normal1[(Player number of (Triggering player))] )
    • Set SaveCount = (SaveCount + 1)
    • Custom script: set udg_Save[udg_SaveCount] = Item_Normal_Charges1[(Player number of (Triggering player))]
    • Set SaveCount = (SaveCount + 1)
    • Custom script: set udg_Save[udg_SaveCount] = SaveLoad_Item2Integer(Item_Normal2[(Player number of (Triggering player))] )
    • Set SaveCount = (SaveCount + 1)
    • Custom script: set udg_Save[udg_SaveCount] = Item_Normal_Charges2[(Player number of (Triggering player))]
    • Set SaveCount = (SaveCount + 1)
    • Custom script: set udg_Save[udg_SaveCount] = SaveLoad_Item2Integer(Item_Normal3[(Player number of (Triggering player))] )
    • Set SaveCount = (SaveCount + 1)
    • Custom script: set udg_Save[udg_SaveCount] = Item_Normal_Charges3[(Player number of (Triggering player))]
    • Set SaveCount = (SaveCount + 1)
    • Custom script: set udg_Save[udg_SaveCount] = SaveLoad_Item2Integer(Item_Normal4[(Player number of (Triggering player))] )
    • Set SaveCount = (SaveCount + 1)
    • Custom script: set udg_Save[udg_SaveCount] = Item_Normal_Charges4[(Player number of (Triggering player))]
    • Set SaveCount = (SaveCount + 1)
    • Custom script: set udg_Save[udg_SaveCount] = SaveLoad_Item2Integer(Item_Normal5[(Player number of (Triggering player))] )
    • Set SaveCount = (SaveCount + 1)
    • Custom script: set udg_Save[udg_SaveCount] = Item_Normal_Charges5[(Player number of (Triggering player))]
    • Set SaveCount = (SaveCount + 1)
    • Custom script: set udg_Save[udg_SaveCount] = SaveLoad_Item2Integer(Item_Normal6[(Player number of (Triggering player))] )
    • Set SaveCount = (SaveCount + 1)
    • Custom script: set udg_Save[udg_SaveCount] = Item_Normal_Charges6[(Player number of (Triggering player))]


same method for eq items


  • Set SaveCount = (SaveCount + 1)
  • Custom script: set udg_Save[udg_SaveCount] = SaveLoad_Item2Integer(Item_Hero1[(Player number of (Triggering player))] )
  • Set SaveCount = (SaveCount + 1)
  • Custom script: set udg_Save[udg_SaveCount] = 0
  • Set SaveCount = (SaveCount + 1)
  • Custom script: set udg_Save[udg_SaveCount] = SaveLoad_Item2Integer(Item_Hero2[(Player number of (Triggering player))] )
  • Set SaveCount = (SaveCount + 1)
  • Custom script: set udg_Save[udg_SaveCount] = 0
  • Set SaveCount = (SaveCount + 1)
  • Custom script: set udg_Save[udg_SaveCount] = SaveLoad_Item2Integer(Item_Hero3[(Player number of (Triggering player))] )
  • Set SaveCount = (SaveCount + 1)
  • Custom script: set udg_Save[udg_SaveCount] = 0
  • Set SaveCount = (SaveCount + 1)
  • Custom script: set udg_Save[udg_SaveCount] = SaveLoad_Item2Integer(Item_Hero4[(Player number of (Triggering player))] )
  • Set SaveCount = (SaveCount + 1)
  • Custom script: set udg_Save[udg_SaveCount] = 0
  • Set SaveCount = (SaveCount + 1)
  • Custom script: set udg_Save[udg_SaveCount] = SaveLoad_Item2Integer(Item_Hero5[(Player number of (Triggering player))] )
  • Set SaveCount = (SaveCount + 1)
  • Custom script: set udg_Save[udg_SaveCount] = 0
  • Set SaveCount = (SaveCount + 1)
  • Custom script: set udg_Save[udg_SaveCount] = SaveLoad_Item2Integer(Item_Hero6[(Player number of (Triggering player))] )
  • Set SaveCount = (SaveCount + 1)
  • Custom script: set udg_Save[udg_SaveCount] = 0


normal inventory array , normal inventory charges array , hero inventory array --- these are standing for your system arrays
indexing is similar to the one in your system. just use integer A for the loop instead single integers

EDIT: oops , i just checked your scripts and it turned out that you use different arrays for item slots...
I edited the triggers according to this

sad that this way your saved number of items always will be 12 (6 normal item - 6 hero item)
and because of the system you have to add charges saved to eq as well :/
 
Last edited:
Level 1
Joined
Jun 21, 2009
Messages
282
How much more inventory does the system provide you?

I also need both of these systems for my RPG(Save and Load, and able to save extra inventory), I can't start it until I get these 2 systems implemented because they're really vital to my map.

Darkzxx if you have the systems set up to where you want it, could you please share them with me?
 
Status
Not open for further replies.
Top