• 🏆 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] How do you trigger a conveyor belt

Status
Not open for further replies.
Level 25
Joined
Sep 26, 2009
Messages
2,387
determine the order in which items are moved. Put all items into item array, where the item with the lowest index will be the item moved first.
Then periodically every 0.03 second loop through all items on conveyor belt and move them a bit (e.g. by 20 units). Don't forget to set the locations into variables first, so you don't get memory leak.
 
I am not sure if there is an action called "for each item in region" (there is such a think in JASS i know), but if there is, you can just do that periodically every 0.03 seconds and move them in some direction, perhaps using polar offset. Otherwise, add a trigger with the event "a unit drops an item" (or whatever it is called), and then check "position of item is within region 'conveyor belt'", and if so, add the item to some kind of list of items within the belt. You also need a trigger for when a player picks up an item.

Really though, i could write a quick jass script which could do this for you in 5 minutes... you will not need to know jass to use it, just a single custom script line.
 
Level 13
Joined
Dec 21, 2010
Messages
541
as Nichilus said..

  • Conveyor Init
    • Events
      • Map Initialization
    • Conditions
    • Actions
      • -------- The speed of the items------
      • Set Conveyor_Speed = 5
      • -------- The direction of the items------
      • Set Conveyor_Angle = 90
  • Conveyor Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Item - Pick every item in (Conveyor Region <gen>) and do (Actions)
        • Loop - Actions
          • Set - Item_Point[0] = (Position of Picked Item)
          • Set - Item_Point[1] = ((Item_Point[0]) offset by Conveyor_Speed towards Conveyor_Angle degrees
          • Item - Move (Picked Item) to Item_Point[1]
          • Custom script: call RemoveLocation (udg_Item_Point[0])
          • Custom script: call RemoveLocation (udg_Item_Point[1])
 
Status
Not open for further replies.
Top