• 🏆 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!

[Trigger] Using GUI to make newly spawned units with item tables

Status
Not open for further replies.
Level 2
Joined
Jul 27, 2008
Messages
6
hey guys i've been trying for like the past week to find some way of making a trigger activate a item table of a newly spawned creep. something along the lines of.... (i know it cant acually look like this)


Event:
Unit - a unit enters spider spawn <gen>

Condition:
(Unit-type of (Triggering unit)) Equal to Spider

Action: (this is where i get lost)
Give unit "spider" Item Table.


if anyone is confused as to what i'm asking, just say so and i'll try to clearify. just trying to find an easy GUI item drop system for an RPG i'm working on where respawned units have item tables.
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
No, there are not. The only way (Unless possible in JASS) to add an item table to a unit is to pre-place it on the map, dubble-click it, click the items Dropped tab, click New Set, click New Item and add as many items you want it to be able to drop. The closest you can get in GUI towards this is:
  • Triggered Item Table
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Dying unit)) Equal to Spider
        • Then - Actions
          • Set RANDOM = (Random integer number between 1 and 3)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • RANDOM Equal to 1
            • Then - Actions
              • Item - Create Orb of Frost at (Position of (Dying unit))
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • RANDOM Equal to 2
                • Then - Actions
                  • Item - Create Thunder Lizard Egg at (Position of (Dying unit))
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • RANDOM Equal to 3
                    • Then - Actions
                      • Item - Create Wand of Lightning Shield at (Position of (Dying unit))
                    • Else - Actions
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Dying unit)) Equal to Dire Wolf
            • Then - Actions
              • Set RANDOM = (Random integer number between 1 and 2)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • RANDOM Equal to 1
                • Then - Actions
                  • Item - Create Scroll of Healing at (Position of (Dying unit))
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • RANDOM Equal to 2
                    • Then - Actions
                      • Item - Create Skeletal Artifact at (Position of (Dying unit))
                    • Else - Actions
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of (Dying unit)) Equal to Green Dragon
                • Then - Actions
                  • Set RANDOM = (Random integer number between 1 and 4)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • RANDOM Equal to 1
                    • Then - Actions
                      • Item - Create Health Stone at (Position of (Dying unit))
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • RANDOM Equal to 2
                        • Then - Actions
                          • Item - Create Gloves of Spell Mastery at (Position of (Dying unit))
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • RANDOM Equal to 3
                            • Then - Actions
                              • Item - Create Gem Fragment at (Position of (Dying unit))
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • RANDOM Equal to 3
                                • Then - Actions
                                  • Item - Create Mask of Death at (Position of (Dying unit))
                                • Else - Actions
                • Else - Actions
Just add as many If/Then/Else triggers as you got unit types and item drops. Don't be scared by it's length. I made this in just 2 minutes. It's all a matter of copying and pasting.
 
Level 2
Joined
Jul 27, 2008
Messages
6
then is there a way you can do it in JASS? and if so can someone show an example so i can maybe try and manipulate it into my map. i've never used JASS before so i'm completely clueless as how to write in that language. becuase that seems like it would take FOREVER to make an item drop table for every spicific kind of unit that i make to drop items.
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
Don't be scared by it's length. I made this in just 2 minutes. It's all a matter of copying and pasting.

It wasn't even 2 minutes. If you know the unit types you're going to use and the items you want them to drop, you can do 100 unit types in an hour. With this triggered item table, you can even add chances of dropping. With pre-placed unit item tables, the drop chance is always equal. So all with all: You just need a little bit more time (really just a little bit), you can choose to add drop chances (will take some more time) and you got it available for trigger-created units.
So in my opinion all you do is give it a little more time and you got a lot better system.
 
Status
Not open for further replies.
Top