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 havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  4. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  5. Units have been turned into heroes in our latest Icon Contest! Vote for the best icon set at the Icon Contest #18 Poll!
    Dismiss Notice
  6. The poll for Hive's 12th Concept Art Contest is up! Go cast your vote for your favourite genie!
    Dismiss Notice
  7. The raddest synthwave tracks were chosen - Check out our Music Contest #12 - Results and congratulate the winners!
    Dismiss Notice
  8. 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.

Item drops

Discussion in 'World Editor Help Zone' started by qwehe, Aug 14, 2007.

  1. qwehe

    qwehe

    Joined:
    Aug 11, 2007
    Messages:
    42
    Resources:
    0
    Resources:
    0
    Hi im making a rpg and i want the creeps to drop specific items (like in defiance) but i can only make them able to drop the once (when they respawn they cant drop it anymore), anyone has a trigger or anything for that?
     
  2. Eleandor

    Eleandor

    Joined:
    Aug 21, 2005
    Messages:
    3,681
    Resources:
    2
    Models:
    1
    Tutorials:
    1
    Resources:
    2
    you don't give them an item set, instead you create a trigger like this

    Events: A unit dies
    Conditions : unit type of dying unit = Yourcreep
    Actions: If random integer between 1 and 100 < 20 (this way there's 20% chance to drop the item, you don't need this)
    --- Then: set Variable: "TempLoc" = position of dying unit
    ------ Item - create a "item-type" at "TempLoc"
    ------ custom script to remove the leak
    --- Else: do nothing
     
  3. qwehe

    qwehe

    Joined:
    Aug 11, 2007
    Messages:
    42
    Resources:
    0
    Resources:
    0
    hmm is that JASS code ? cus i dont use JASS
     
  4. qwehe

    qwehe

    Joined:
    Aug 11, 2007
    Messages:
    42
    Resources:
    0
    Resources:
    0
    ah never mind think i got it ty for help
     
  5. Eleandor

    Eleandor

    Joined:
    Aug 21, 2005
    Messages:
    3,681
    Resources:
    2
    Models:
    1
    Tutorials:
    1
    Resources:
    2
    Yeah sorry but I don't use trigger tags unless I make the triggers in WE first; This one was without WE. It's just that it doesn't look good with trigger tags unless you do 'copy as text'...
     
  6. qwehe

    qwehe

    Joined:
    Aug 11, 2007
    Messages:
    42
    Resources:
    0
    Resources:
    0
    are u shore this one works? cus i dont think it does
     
  7. YoshiRyu

    YoshiRyu

    Joined:
    Jun 26, 2007
    Messages:
    686
    Resources:
    0
    Resources:
    0
    ... "sure", not "shore" (shore is the meet of ground and sea ^^)
    it should works, post your trigger, we will search for the error
     
  8. Eleandor

    Eleandor

    Joined:
    Aug 21, 2005
    Messages:
    3,681
    Resources:
    2
    Models:
    1
    Tutorials:
    1
    Resources:
    2
    Keep in mind that i fyou copied my trigger exactly, it'll only drop an item 1 out of 5 times.

    If you want it to be dropped always, just remove the "IF/THEN/ELSE" and only use the actions
     
  9. Steel_Cold

    Steel_Cold

    Joined:
    Apr 16, 2005
    Messages:
    154
    Resources:
    0
    Resources:
    0
    Woah, i didnt no that you could do the random interger thing without creating a variable first.
     
  10. Eleandor

    Eleandor

    Joined:
    Aug 21, 2005
    Messages:
    3,681
    Resources:
    2
    Models:
    1
    Tutorials:
    1
    Resources:
    2
    Well, if you only have one option like here: drop or not drop, you don't need a variable. However, keep in mind that if there are multiple options (e.g. 10% chance to do action A, 10% chance to do action B, 80% chance to do action C), you need to store the random integer in a variable first.
     
  11. YoshiRyu

    YoshiRyu

    Joined:
    Jun 26, 2007
    Messages:
    686
    Resources:
    0
    Resources:
    0
    • Actions
      • If
        • random integer between 1 and 100 < 10
      • Then
        • Action A
      • Else
        • If
          • random integer between 1 and 90 < 10
        • Then
          • Action B
        • Else
          • Action C


    ;p
     
  12. qwehe

    qwehe

    Joined:
    Aug 11, 2007
    Messages:
    42
    Resources:
    0
    Resources:
    0
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Random integer number between 1 and 100) Equal to 15
      • Then - Actions
        • Region - Center ITEM <gen> on (Position of (Dying unit))
        • Item - Create Gnoll Club at (Center of ITEM <gen>)
      • Else - Actions

    would this work or do i need a variable?? cus i tried with variable and it didnt work
     
  13. YoshiRyu

    YoshiRyu

    Joined:
    Jun 26, 2007
    Messages:
    686
    Resources:
    0
    Resources:
    0
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Random integer number between 1 and 100) [COLOR="Red"]not greater than[/COLOR] 15 [COLOR="SeaGreen"]// if you want 15%, your's was 1%[/COLOR]
      • Then - Actions
        • Set PositionVariable = (Position of (Dying unit)) [COLOR="seagreen"]// you need a variable to prevent memory leak[/COLOR]
        • Item - Create Gnoll Club at PositionVariable [COLOR="SeaGreen"]// = create Gnoll Club at position of dying unit[/COLOR]
        • Custom script : call RemoveLocation( udg_PositionVariable ) [COLOR="seagreen"]// here you remove the used point from the memory[/COLOR]
      • Else - Actions

    And so, you don't need the "ITEM" Region
     
  14. qwehe

    qwehe

    Joined:
    Aug 11, 2007
    Messages:
    42
    Resources:
    0
    Resources:
    0
    hehe aha ty for the help man

    -edit-
    got a problem... when i try to save with thecustom script it only says exepting a name
     
  15. Eleandor

    Eleandor

    Joined:
    Aug 21, 2005
    Messages:
    3,681
    Resources:
    2
    Models:
    1
    Tutorials:
    1
    Resources:
    2
    custom scripts are very case-sensitive. Make sure the variable you use (PositionVariable in the exampletrigger) is a POINT variable. Make absolute sure that the variable used in the custom scripts is exactly the same name as the other one.

    For example:
    set VariableName = position of dying unit
    Custom script: call RemoveLocation( udg_Variablename) will not work because I forgot the capital letter "N" in VariableName.
     
  16. qwehe

    qwehe

    Joined:
    Aug 11, 2007
    Messages:
    42
    Resources:
    0
    Resources:
    0
    ok cus i made the variable a region ty
     
  17. Deathclaw24

    Deathclaw24

    Joined:
    May 3, 2006
    Messages:
    81
    Resources:
    2
    Icons:
    2
    Resources:
    2
    Why dont u just create the item at the position of dying unit?

    A unit dies

    unit = ur unit <<< this isnt needed

    create 1 Potion of Health at position of dying unit
    (OR what I use for my RPG's is create 1 random artifact of level 8)
    and set all the items I use to lvl 8 artifacts so the unit will drop one of them and you can even check the level of the dying unit or life and drop an item from a group that fits the unit, peasant drops mantle of intelligence, ogre drops boots of speed.
     
  18. qwehe

    qwehe

    Joined:
    Aug 11, 2007
    Messages:
    42
    Resources:
    0
    Resources:
    0
    that might work^^ takes all the annoying custom scirpts away (still doesnt work..)
     
  19. Eleandor

    Eleandor

    Joined:
    Aug 21, 2005
    Messages:
    3,681
    Resources:
    2
    Models:
    1
    Tutorials:
    1
    Resources:
    2
    The whole point of the custom scripts are (mainly) to remove memory leaks. If you don't remove those leaks, your map will start lagging after some time, especially if you run this trigger frequently.

    Feel free not to use custom scripts to remove leaks, I'm just warning you that your map will lag terribly after some time.
     
  20. Deathclaw24

    Deathclaw24

    Joined:
    May 3, 2006
    Messages:
    81
    Resources:
    2
    Icons:
    2
    Resources:
    2
    Ok wait I mightve forgotten a trigger cuz i got it to work on mine, try making the item appear at the position of killing unit