- Joined
- Apr 1, 2009
- Messages
- 201
I'm in development of a looting system for a map I am making. When a unit dies it gets removed from the game and another unit of that type is placed where the unit died (Acting as a corpse). When I cast the "Loot" ability on the corpse it doesn't do what I want it to. It is supposed to create items at the looting players inventory region and when cast it doesn't do anything. The part of the system I am working on is in 3 triggers (For now). The first trigger is storing my integer values. The second trigger is when the player casts the ability "Loot". The third trigger is the chance of which item will drop and then puts it into the owner of the casting units inventory region. I think the problem is with the third trigger, where it doesn't create any items. I've modified the trigger so no matter what the chance, an item will be created. Also, I added in text messages to try and figure out where the problem is. What was displayed was 1,2,3,4,10. I've been looking at it for awhile now and have had no luck in figuring out what is wrong. I'm not that good at triggering but I try my best. I have already looked through some tutorials but have had no luck :/.
-
Setup
-
Events
-
Map initialization
-
-
Conditions
-
Actions
-
-------- Player and Player's Inventory --------
-
Set LootingPlayer[1] = Player 1 (Red)
-
Set PlayerInventory[1] = Player 1 Inventory <gen>
-
Set LootingPlayer[2] = Player 2 (Blue)
-
Set PlayerInventory[2] = Player 2 Inventory <gen>
-
Set LootingPlayer[3] = Player 3 (Teal)
-
Set PlayerInventory[3] = Player 3 Inventory <gen>
-
Set LootingPlayer[4] = Player 4 (Purple)
-
Set PlayerInventory[4] = Player 4 Inventory <gen>
-
Set LootingPlayer[5] = Player 5 (Yellow)
-
Set PlayerInventory[5] = Player 5 Inventory <gen>
-
Set LootingPlayer[6] = Player 6 (Orange)
-
Set PlayerInventory[6] = Player 6 Inventory <gen>
-
Set LootingPlayer[7] = Player 7 (Green)
-
Set PlayerInventory[7] = Player 7 Inventory <gen>
-
Set LootingPlayer[8] = Player 8 (Pink)
-
Set PlayerInventory[8] = Player 8 Inventory <gen>
-
-------- Unit Loot And Unit Trigger --------
-
Set TriggerLootUnitType[1] = Wolf (Loot)
-
Set TriggerLootType[1] = Wolf <gen>
-
-
-
Loot
-
Events
-
Unit - A unit Begins casting an ability
-
-
Conditions
-
(Ability being cast) Equal to Loot
-
-
Actions
-
For each (Integer TriggerUnitLootInt) from 1 to 2, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Unit-type of (Target unit of ability being cast)) Equal to TriggerLootUnitType[TriggerUnitLootInt]
-
-
Then - Actions
-
Game - Display to (All players) the text: 1
-
Unit - Make (Target unit of ability being cast) Invulnerable
-
Game - Display to (All players) the text: 2
-
Trigger - Run TriggerLootType[TriggerUnitLootInt] (checking conditions)
-
-
Else - Actions
-
-
-
-
-
-
Wolf
-
Events
-
Conditions
-
Actions
-
Set DropChanceInt = (Random integer number between 0 and 100)
-
Game - Display to (All players) the text: 3
-
For each (Integer LootingInt) from 1 to 2, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Owner of (Triggering unit)) Equal to LootingPlayer[LootingInt]
-
-
Then - Actions
-
Game - Display to (All players) the text: 4
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
DropChanceInt Equal to 0
-
DropChanceInt Less than or equal to 14
-
-
Then - Actions
-
Game - Display to (All players) the text: 5
-
Item - Create Wolf Fur at (Center of PlayerInventory[LootingInt])
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
DropChanceInt Equal to 15
-
DropChanceInt Less than or equal to 19
-
-
Then - Actions
-
Game - Display to (All players) the text: 6
-
Item - Create Wolf Fur at (Center of PlayerInventory[LootingInt])
-
Item - Create Wolf Fur at (Center of PlayerInventory[LootingInt])
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
DropChanceInt Equal to 20
-
DropChanceInt Less than or equal to 29
-
-
Then - Actions
-
Game - Display to (All players) the text: 7
-
Item - Create Wolf Fur at (Center of PlayerInventory[LootingInt])
-
Item - Create Wolf Fur at (Center of PlayerInventory[LootingInt])
-
Item - Create Wolf Fur at (Center of PlayerInventory[LootingInt])
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
DropChanceInt Equal to 30
-
DropChanceInt Less than or equal to 49
-
-
Then - Actions
-
Game - Display to (All players) the text: 8
-
Item - Create Wolf Fur at (Center of PlayerInventory[LootingInt])
-
Item - Create Wolf Fur at (Center of PlayerInventory[LootingInt])
-
Item - Create Wolf Fur at (Center of PlayerInventory[LootingInt])
-
Item - Create Wolf Fur at (Center of PlayerInventory[LootingInt])
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
DropChanceInt Equal to 50
-
DropChanceInt Less than or equal to 100
-
-
Then - Actions
-
Game - Display to (All players) the text: 9
-
Item - Create Wolf Fur at (Center of PlayerInventory[LootingInt])
-
Item - Create Wolf Fur at (Center of PlayerInventory[LootingInt])
-
Item - Create Wolf Fur at (Center of PlayerInventory[LootingInt])
-
Item - Create Wolf Fur at (Center of PlayerInventory[LootingInt])
-
Item - Create Wolf Fur at (Center of PlayerInventory[LootingInt])
-
-
Else - Actions
-
-
-
Else - Actions
-
Game - Display to (All players) the text: 10
-
-
-
-
-
-