Need help with triger

D

DarkKronos

Guest
I want to be able to type -buy (item) then give the person the item.
 
-.- dude ever played sheep tag reborn that has -buy, so it does got it?
 
Maybe lots of separate triggers or conditions what checks the entered string and creates the right item.
 
Code:
Events:
Player 1 types...-buy X item as an exact match
Conditions:
Actions:
Custom Script: set bj_want destroy group equal to true
Pick all heroes in playable map area and do actions
Loop Actions:
Give X item to picked unit
 
@Black Diamond, You cannot simply transform the entered string 'X' in an item.

I think the solution would be a separate trigger for each item. Lot's of ifs i don't think it would work, cuz the event would be 'enters "-buy"' and I don't think you are able to check if the player wrote something else after the -buy.

Anyway, afterall, why don't you follow Mini-Me's device? Ask the map creators themselves.

BTW, can you give me a link to this map?
 
i ment a differnt trigger for each item. all i wont is to type -buy golem and u get a stone tokin (item) in your iventry like on sheep tag reborn (str)

and if u have msn i can send u the map
 
If you wanted this, then here's a trigger:

Code:
Stone Token
    Events
        Player - Player 1 (Red) types a chat message containing -buy golem as An exact match
    Conditions
    Actions
        Hero - Create Stone Token and give it to (your hero here)
 
I think what they used in SHEEP TAG is this:

1. You have to create some variables:
HeroRED - Unit
HeroBlue - Unit
etc
2. You have to set the variables:

Set HeroRED equal to (Some Unit)
3.
Code:
    Events
        Player - Player 1 (Red) types a chat message containing -buy Invisible Sheep as An exact match
    Conditions
    Actions
        Hero - Create Invisible Sheep and give it to (HeroRED)
 
smith_s9 said:
@Black Diamond, You cannot simply transform the entered string 'X' in an item.

I think the solution would be a separate trigger for each item. Lot's of ifs i don't think it would work, cuz the event would be 'enters "-buy"' and I don't think you are able to check if the player wrote something else after the -buy.

Substrings?
 
how do i do it if hero is made by trigger :confused:
(i cant select a unit on map)
 
Make a unit variable and do:
Code:
set *your unit variable* = last created unit
 
you can make some Array system, like setting all the items and strings in arrays...
Set ItemString[1]= "potion"
...
Set Item[1]= the potion item
...
And then a trigger like this:
Code:
Events:
      Player1 (Red) enters a chat message containing "-buy " as a substring // Repeat for each player
Conditions:
Actions:
      if (entered chat string (6 - lenght of (entered chat string)) = ItemString[1]
      then do give Item[1] to player
      else do nothing
I'm not sure if you can do this, or if there is an easier way :eek: (maybe using interger A or something...)

DarkKronos said:
how do i do it if hero is made by trigger :confused:
(i cant select a unit on map)
Set Hero[Player number of (Owner of Entering unit)]= Last created unit
/\ this only works if you select heros by entering on a region, if you are using another method change the "Player number of (Owner of Entering Unit)" To something that works :p
 
aarrrrrrrrrrrrrrrrrrrrrr maybe im not cut out for all this i dun know how to do it grrrr




(entered chat string (6 - lenght of (entered chat string)) cant figure that shit out and how u do this Set Item[1]= the potion item



Events:
Player1 (Red) enters a chat message containing "-buy " as a substring // Repeat for each player
Conditions:
Actions:
if (entered chat string (6 - lenght of (entered chat string)) = ItemString[1]
then do give Item[1] to player
else do nothing :banghead: :banghead: :banghead: :banghead:
 
what he has done is a substring and for that item[1] you need a variable.
when in trigger editor press ctrl+b and create an item-type variable.
 
how will the trigger know wat item i want if it just has a name :confused:
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top