Outbreak191
New Member
- Reaction score
- 17
Using Vexorions SimError function I've been trying to make a message the pops up when either you have more than one weapon or armour, or you pick up an item your class cannot use. Sadly it always shows the error message for the wrong class item even to signify that you cannot have more than one weapon or armour despite the fact that the wrong class error trigger shouldnt even be running. Here are the triggers:
I have used levels to detect which class can use which items and item-classes to detect whether an item is an armour, weapon or accessory.
Code:
Only One Weapon
Events
Unit - A unit Acquires an item
Conditions
(Item-class of (Item being manipulated)) Equal to Campaign
Actions
For each (Integer B) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
(Item carried by (Hero manipulating item) in slot (Integer B)) Not equal to (Item being manipulated)
(Item-class of (Item carried by (Hero manipulating item) in slot (Integer B))) Equal to Campaign
Then - Actions
Set loc = (Position of (Hero manipulating item))
Item - Create (Item-type of (Item being manipulated)) at loc
Custom script: set udg_loc = null
Item - Remove (Item being manipulated)
Set Error_Message = You cannot have more than one weapon at a time!
Custom script: call SimError(GetOwningPlayer(GetManipulatingUnit()), udg_Error_Message)
Else - Actions
Code:
Item Class Comparison
Events
Unit - A unit Acquires an item
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
(Unit-type of (Hero manipulating item)) Equal to Dagger
(Item level of (Item being manipulated)) Not equal to 1
(Item level of (Item being manipulated)) Not equal to 8
Then - Actions
Set loc = (Position of (Hero manipulating item))
Item - Create (Item-type of (Item being manipulated)) at loc
Custom script: set udg_loc = null
Item - Remove (Item being manipulated)
Set Error_Message = Your class cannot use this item!
Custom script: call SimError(GetOwningPlayer(GetManipulatingUnit()), udg_Error_Message)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
(Unit-type of (Hero manipulating item)) Equal to Cyan
(Item level of (Item being manipulated)) Not equal to 2
(Item level of (Item being manipulated)) Not equal to 8
Then - Actions
Set loc = (Position of (Hero manipulating item))
Item - Create (Item-type of (Item being manipulated)) at loc
Custom script: set udg_loc = null
Item - Remove (Item being manipulated)
Set Error_Message = Your class cannot use this item!
Custom script: call SimError(GetOwningPlayer(GetManipulatingUnit()), udg_Error_Message)
Else - Actions
I have used levels to detect which class can use which items and item-classes to detect whether an item is an armour, weapon or accessory.