maldruzard
Member
- Reaction score
- 2
Hey there!
So I'm attempting to make some sort of 'cook food' trigger, in which a player types a command, and some raw meat from his inventory is removed and cooked meat in given to him. However, a condition for this to happen is that he must be standing near a fire in order to do so. I have currently been able to trigger this successfully, despite many different attempts.
Here is what I have currently got:
Checking Distance Trigger -
Events
Time - Every 0.10 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Picked unit)) Equal to Campfire
Then - Actions
Unit Group - Pick every unit in (Units in (Region centered at (Position of (Picked unit)) with size (200.00, 200.00))) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Picked unit)) Equal to Survivor
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Picked unit)) Equal to Player 1 (Red)
Then - Actions
Set campfireradiusTF[1] = True
Cooking meat trigger -
Events
Player - Player 1 (Red) types a chat message containing -cook meat as An exact match
Conditions
Actions
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
campfireradiusTF[1] Equal to True
Then - Actions
Item - Remove (Item carried by play1cam of type Raw Meat)
Hero - Create Crude Fencing and give it to play1cam
Else - Actions
So far the trigger is pretty basic, though it is entirely non-functional, for reasons beyond my meagre understanding of triggers. Can anyone tell me why this doesn't work, and perhaps suggest another valid method for checking whether the hero is standing next to the campfire unit?
Cheers
So I'm attempting to make some sort of 'cook food' trigger, in which a player types a command, and some raw meat from his inventory is removed and cooked meat in given to him. However, a condition for this to happen is that he must be standing near a fire in order to do so. I have currently been able to trigger this successfully, despite many different attempts.
Here is what I have currently got:
Checking Distance Trigger -
Events
Time - Every 0.10 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Picked unit)) Equal to Campfire
Then - Actions
Unit Group - Pick every unit in (Units in (Region centered at (Position of (Picked unit)) with size (200.00, 200.00))) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Picked unit)) Equal to Survivor
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Picked unit)) Equal to Player 1 (Red)
Then - Actions
Set campfireradiusTF[1] = True
Cooking meat trigger -
Events
Player - Player 1 (Red) types a chat message containing -cook meat as An exact match
Conditions
Actions
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
campfireradiusTF[1] Equal to True
Then - Actions
Item - Remove (Item carried by play1cam of type Raw Meat)
Hero - Create Crude Fencing and give it to play1cam
Else - Actions
So far the trigger is pretty basic, though it is entirely non-functional, for reasons beyond my meagre understanding of triggers. Can anyone tell me why this doesn't work, and perhaps suggest another valid method for checking whether the hero is standing next to the campfire unit?
Cheers