1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Lead your forces to battle in the 15th Techtree Contest. The call is yours, commander!
    Dismiss Notice
  4. The reforging of the races is complete. Come see the 14th Techtree Contest Results.
    Dismiss Notice
  5. It's time to choose your horse in the race - the 32nd Modeling Contest Poll is up!
    Dismiss Notice
  6. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[Trigger] How do i make items appearing anywhere?

Discussion in 'Triggers & Scripts' started by vegetation, Jun 9, 2009.

  1. vegetation

    vegetation

    Joined:
    Jul 20, 2008
    Messages:
    59
    Resources:
    0
    Resources:
    0
    Hello everyone. I am making a map but I really need to know how do I make items appearing anywhere on the map. Can anyone help me?
     
  2. DarkLordX

    DarkLordX

    Joined:
    Dec 3, 2008
    Messages:
    189
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    Ermm...

    • Item
    • Events
      • Time - Every 0.01 seconds
    • Conditions
    • Actions
      • Item - Create a <ItemName> at (Position)


    You mean that? :)
     
  3. Squiggy

    Squiggy

    Joined:
    Mar 25, 2008
    Messages:
    2,627
    Resources:
    18
    Maps:
    2
    Spells:
    15
    Tutorials:
    1
    Resources:
    18
    /fail
    • Items
      • Events
        • (..)
      • Conditions
      • Actions
        • Set temppoint = Random point in (Playable Map Area)
        • Item - Create a *item* at temppoint
        • Custom script: call RemoveLocation(udg_temppoint)
     
  4. baassee

    baassee

    Joined:
    Nov 14, 2008
    Messages:
    3,220
    Resources:
    17
    Spells:
    14
    Tutorials:
    3
    Resources:
    17
    squigg doesnt playable leak also or is that like "all players" in player groups leaks?

    edit:

    my bad, thought of center of playable, that's a point not a region thought regions do leak also?
     
  5. vegetation

    vegetation

    Joined:
    Jul 20, 2008
    Messages:
    59
    Resources:
    0
    Resources:
    0
    thanks squiggy, but i just dont understand the last line: Custom script: call RemoveLocation(udg_temppoint)

    Whats does it mean?
     
  6. Cokemonkey11

    Cokemonkey11

    Wurst Reviewer

    Joined:
    May 9, 2006
    Messages:
    3,234
    Resources:
    18
    Tools:
    1
    Maps:
    5
    Spells:
    3
    Tutorials:
    2
    JASS:
    7
    Resources:
    18
    locations are sets of data behind the jass/gui frontend which must be allocated. If they are not destroyed (call RemoveLocation()), they cause "leaks", which are simply undestroyed data that takes up room in the client's memory. Read more about leaks in the "what leaks" thread.
     
  7. dimitri231

    dimitri231

    Joined:
    Aug 4, 2008
    Messages:
    265
    Resources:
    0
    Resources:
    0
    On easy words, if u make an point variable, u have to remove it later, or else, the game will begins to lag.Then - call RemoveLocation (udg_(variable)
    The udg is for when u use a variable.
     
  8. Cokemonkey11

    Cokemonkey11

    Wurst Reviewer

    Joined:
    May 9, 2006
    Messages:
    3,234
    Resources:
    18
    Tools:
    1
    Maps:
    5
    Spells:
    3
    Tutorials:
    2
    JASS:
    7
    Resources:
    18
    udg stands for user defined global; if you're using variables defined in the GUI variable editor you must including the udg prefix when using jass/custom script.
     
  9. vegetation

    vegetation

    Joined:
    Jul 20, 2008
    Messages:
    59
    Resources:
    0
    Resources:
    0
    can't we make items drop but its a random item from an item table?
     
  10. Hijax

    Hijax

    Joined:
    Oct 4, 2008
    Messages:
    249
    Resources:
    0
    Resources:
    0
    just have an integer variable, set it to a random number, then with if/then/else decide which item is going to be dropped.
     
  11. Squiggy

    Squiggy

    Joined:
    Mar 25, 2008
    Messages:
    2,627
    Resources:
    18
    Maps:
    2
    Spells:
    15
    Tutorials:
    1
    Resources:
    18
    In a trigger, set up your table, means
    • Set items[0] = item1
    • Set items[1] = item2
    • Set items[2] = item3
    • Set items[3] = item4
    • Set items[4] = item5

    etc

    and for your create item trigger, do
    • Set temppoint = Random point in (Playable Map Area)
    • Item - Create a item[Random integer number between x and y] at temppoint
    • Custom script: call RemoveLocation(udg_temppoint)

    whereas x is the lowest number you've set in your table and y being the highest
     
  12. vegetation

    vegetation

    Joined:
    Jul 20, 2008
    Messages:
    59
    Resources:
    0
    Resources:
    0
    o_O thanks squiggy

    Edit: Sorry but i still need help :( ... For this line: Item - Create a item[Random integer number between x and y] at temppoint

    I can't find the "a item[Random integer number between x and y]" with my editor, can you like tell me the steps like

    1) Item-create
    2)...
     
    Last edited: Jun 26, 2009
  13. dardas

    dardas

    Joined:
    Sep 12, 2008
    Messages:
    649
    Resources:
    0
    Resources:
    0
    okay, go to item, choose the create button,
    now if you made the items variable and putted it array,
    you should have the option to press variable,
    in the array underline area, choose math - random number
    and in 1 - 10 just change to w/e you want, or how many items you got in the variable.
    hope i helped..

    edit:
    ops.. i wrote " or how many items you got in the variable"
    i meant like if there are 5 items in the variable use

    • Item - Create items[(Random integer number between 1 and 5)] at Point_Which_You_Make