• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Spell] Inventory Switching

Status
Not open for further replies.
Level 17
Joined
Nov 13, 2006
Messages
1,814
Finally, a second person that understood what i want :3 but i still need to test it to see if it bugs O: and is this mui?

this is mpi, so work only if each player have 1 hero, mui mean work every unit can have inventory switch what could be madness if u got 100 hero so in that case this solution dont work but for mpi (so 1 hero/player) this is pretty easy
 
Level 1
Joined
Aug 11, 2012
Messages
5
If you want to make it REALLY simple (but kinda noobish way) you can create another dummy unit like TempItemHolder and place it on the map. So when you use your spell do this:
Items from Hero ---> TempItemHolder
Items from Stash ---> Hero
Items from Temp ---> Stash
This is even quite easily triggered :)
 
Level 11
Joined
Oct 31, 2010
Messages
1,057
hmm, yeah i thought of a triangle of 3 units but then i thought that if thats the case, then i need 12 more units, might as well post a thread here to see if i can get something easier O:

and besides, my first problem is that when the items exchange , there is a conflict if you have 6 items in each inventory,


if i knew how to do it without conflicting that a unit sends 6 items to another unit with 6 items (currently doing it with dropping the item) i do not need to have a 3rd unit
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
hmm, yeah i thought of a triangle of 3 units but then i thought that if thats the case, then i need 12 more units, might as well post a thread here to see if i can get something easier O:

and besides, my first problem is that when the items exchange , there is a conflict if you have 6 items in each inventory,


if i knew how to do it without conflicting that a unit sends 6 items to another unit with 6 items (currently doing it with dropping the item) i do not need to have a 3rd unit

y with droping u can do without 3rd unit, about hero[a], that was loop in test map but in your u know how u choose main hero, when a player choose main hero then set it hero[player number of trigger hero]=choosed hero (i dont know how u made the hero selection thats why cant say exactly where insert the line)
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
okay, good good, so if mine was a dialog button was clicked then it would be last created unit right ?[

yes, then after the create unti line just do something like this:

set hero[player number of trigger player] = last created unit
create stash unit
set stash[player number of trigger player] = last created unit

this automatical do that: if player 1 choosed hereo then its will eb hero[1]=last created unit if player 2 clicked and choosed hero then hero[2] will be the last created unit etc.
 
Level 11
Joined
Oct 31, 2010
Messages
1,057
yeah...a problem again :3

been thinking about this trigger

  • New Character 2
    • Events
      • Dialog - A dialog button is clicked for Dialog
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Dialog1
        • Then - Actions
          • Player - Add 1000 to (Triggering player) Current gold
          • Unit - Create 1 |cffffcc00Female|r for (Triggering player) at (Center of Spawn City 1 <gen>) facing Default building facing degrees
          • Unit - Create 1 |cffffcc00Mining|r for (Triggering player) at (Center of Proffesions spawn area <gen>) facing Default building facing degrees
          • Unit - Create 1 |cffffcc00Fishing|r for (Triggering player) at (Center of Proffesions spawn area <gen>) facing Default building facing degrees
          • Camera - Pan camera for (Owner of (Last created unit)) to (Position of (Last created unit)) over 0.00 seconds
          • Selection - Select (Last created unit) for (Triggering player)
        • Else - Actions
          • Player - Add 1000 to (Triggering player) Current gold
          • Unit - Create 1 |cffffcc00Male|r for (Triggering player) at (Center of Spawn City 1 <gen>) facing Default building facing degrees
          • For each (Integer SwitchinventoryA) from 1 to 12, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Player(SwitchinventoryA)) slot status) Equal to Is playing
                  • ((Player(SwitchinventoryA)) controller) Equal to User
                • Then - Actions
                  • Set Hero[SwitchinventoryA] = (Last created unit)
                  • Unit - Create 1 Stash for (Player(SwitchinventoryA)) at (Center of (Playable map area)) facing Default building facing degrees
                  • Set Stash[SwitchinventoryA] = (Last created unit)
                  • Custom script: call RemoveLocation(udg_p)
                • Else - Actions
          • Unit - Create 1 |cffffcc00Fishing|r for (Triggering player) at (Center of Proffesions spawn area <gen>) facing Default building facing degrees
          • Unit - Create 1 |cffffcc00Mining|r for (Triggering player) at (Center of Proffesions spawn area <gen>) facing Default building facing degrees
          • Camera - Pan camera for (Owner of (Last created unit)) to (Position of (Last created unit)) over 0.00 seconds
          • Selection - Select (Last created unit) for (Triggering player)
wouldn't the trigger bug and create 1 stash and one male for every player ???

how do i fix this ;3?
 
Level 12
Joined
Sep 11, 2011
Messages
1,176
  • ((Player(SwitchinventoryA)) slot status) Equal to Is playing
  • ((Player(SwitchinventoryA)) controller) Equal to User
hey, you don't need to check if the player is playing and is a user, because the only one who can click a button is the one that is playing and is a user.

the male won't be created for every player because you created it outside the loop, but i doubt about the stash since you are looping from 1 to 12.

i think testing the map with multiplayer is the best way to check.
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
dont use for loop if u have dialog system, then the array index is player number of trigger player

  • For each (Integer SwitchinventoryA) from 1 to 12, do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Player(SwitchinventoryA)) slot status) Equal to Is playing
          • ((Player(SwitchinventoryA)) controller) Equal to User
        • Then - Actions
          • Set Hero[SwitchinventoryA] = (Last created unit)
          • Unit - Create 1 Stash for (Player(SwitchinventoryA)) at (Center of (Playable map area)) facing Default building facing degrees
          • Set Stash[SwitchinventoryA] = (Last created unit)
          • Custom script: call RemoveLocation(udg_p)
        • Else - Actions
->
simple only do this
  • Set Hero[(Player number of (Triggering player))] = (Last created unit)
  • Unit - Create 1 Stash for (Triggering player) at (Center of (Playable map area)) facing Default building facing degrees
  • Set Stash[(Player number of (Triggering player))] = (Last created unit)
 
Status
Not open for further replies.
Top