• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Need Help for a Trigger

Is that possible ? :(

  • yep

    Votes: 0 0.0%
  • nop

    Votes: 0 0.0%

  • Total voters
    0
Status
Not open for further replies.
Level 4
Joined
Feb 28, 2020
Messages
48
Hi, im actualy doing a map like a real RPG, playing like a MMO, u chose your hero you farm, do donjon and do some quest.

I want to player can farm all the creature they want, so i need to make respawn the "neutral hostile" creature i put on the map, i would like to keep then "item table" for drop sometimes, i havent succeeds to do that, if that possible please i really need help this this trigger.

Im sorry if my english is bad, i hope you will understand what i want to do with this trigger

Thx a lot
 
Level 4
Joined
Jun 2, 2018
Messages
54
So you want neutral hostile creeps that are spread around the map to have chances at dropping different items when they are slain?

Depending on the volume of items and creep types you're working with, you'd likely be best off storing this data in array variables, then calling upon a procedure when a creep dies that determines if an item should drop.

FYI, this should be posted in the World Editor Help Zone subforum but I'm not a mod by any means, just a heads up. :)

To keep it sort of beginner friendly, something like this:

Initialize your item array variables on map start:
  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set VariableSet itypearrayItemID[1] = Claws of Attack +15
      • Set VariableSet itypearrayItemID[2] = Crown of Kings +5
      • Set VariableSet itypearrayItemID[3] = Skeletal Artifact
      • Set VariableSet itypearrayItemID[4] = Scroll of Resurrection
      • Set VariableSet itypearrayItemID[5] = Potion of Invulnerability
      • Set VariableSet itypearrayItemID[6] = Essence of Aszune
      • Set VariableSet itypearrayItemID[7] = Moon Key
      • Set VariableSet itypearrayItemID[8] = Scepter of Healing
      • Set VariableSet itypearrayItemID[9] = Bladebane Armor
      • Set VariableSet itypearrayItemID[10] = Firehand Gauntlets
Then create your procedure to drop one of these 10 items at random when a neutral hostile unit dies:
  • Item Drops
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Triggering unit)) Equal to Neutral Hostile
    • Actions
      • Set VariableSet Temp_RandomNumber = (Random integer number between 1 and 10)
      • Set VariableSet Temp_Point = (Position of (Triggering unit))
      • Item - Create itypearrayItemID[Temp_RandomNumber] at Temp_Point
      • Custom script: call RemoveLocation(udg_Temp_Point)
*edited above, overcomplicated it the first time lol.*


If you want there to be times where no item drops, or multiple items, you'll of course have to expand upon this. Also, it's important to realize that human input is the best randomizer. I like to change vars based on player input that are involved in RNG calculations.

Hope this helps, sorry if there's errors or it doesn't make sense, kind of did this for you in a small hurry. Best of luck!
 
Last edited:
Level 4
Joined
Feb 28, 2020
Messages
48
Thx a lot, i will try it and see if that help, the big thing is this map will be like a real MMORPG with zone at theme and diffirent creature to bit, im scare if all this trigger not gonna be to heavy for the map, i have many other trigger to work on it
 
Level 4
Joined
Feb 28, 2020
Messages
48
So i have do that for all the creature i want (11 on the frist zone of my map) idk if this is cause i always use the same variable, but i doesnt work well, sometimes the creature doesnt come back
 

Attachments

  • Capture.PNG
    Capture.PNG
    26 KB · Views: 34
Level 4
Joined
Jun 2, 2018
Messages
54
I think you would benefit from looking into GUI triggering tutorials, there are quite a lot of fundamental issues with the triggers you posted. Read this and threads here to find guidance.

For example, there's issues with the way you're using waits - triggering unit is a global variable, it can only have one value stored to it at any one time. What happens when the event is triggered again during the wait of the first time? The (triggering unit) will be overwritten with the new triggering unit, abandoning the first triggering unit. This is why sometimes they don't respawn. Whenever you kill one before the 180 sec wait has a chance to catch up, you're overwriting variable data that you still need. You need to learn about indexing data to use waits properly.

You should also refrain from using the Do Nothing function as it is inefficient, leaving it blank is a better way to 'do nothing'.

You are on the right track with your thinking. Keep working at it and learning from online resources and proper examples and you'll figure out the best ways to do what you want.
 
Level 4
Joined
Feb 28, 2020
Messages
48
Thx a lotfor help.
My project its very very very big, i do my best for all this trigger will work was they should :)
 
Status
Not open for further replies.
Top