• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Trigger help

Status
Not open for further replies.
Level 7
Joined
Nov 13, 2006
Messages
243
Hello, i need help with a trigger that can chalange another player to a duel and if the chalanged player types -ok they both go to the arena.

The thing i need is the right condition and event.
I tested some and the most promising was

  • Events
  • Player - Player 1 (Red) types a chat message containing (-challange + (String((Player number of Player 1 (Red))))) as An exact match
This event worked to chalange the player but it couldn't process if the other user accepts and so on...

So can someone help?
 
Level 13
Joined
Sep 14, 2008
Messages
1,408
For the accept you need:

A timer which checks the time (so after 1 min the callenge is over)
A boolean which is set true when a player challenges
And another trigger which runs whens somebody types -ok:

Event: Player types -ok
If(boolean[player number of trig player] = true)
Run duel
 
Level 7
Joined
Nov 13, 2006
Messages
243
For the accept you need:

A timer which checks the time (so after 1 min the callenge is over)
A boolean which is set true when a player challenges
And another trigger which runs whens somebody types -ok:

Event: Player types -ok
If(boolean[player number of trig player] = true)
Run duel

yeah but the problem is i can't do anything to check who chalanged who (an easy way)... and i kind of don't want to make a tone of triggers to do that :-|
 
Level 6
Joined
Sep 13, 2008
Messages
261
yeah but the problem is i can't do anything to check who chalanged who (an easy way)... and i kind of don't want to make a tone of triggers to do that :-|

You could use a simple integer variable and have it set to
first number is challenger second number is challengie
38 - player 3 challenged player 8 and so on.
83 - player 8 challenged player 3
if you have more players then you could make it a 4 digit integer
0310 player 3 challenged player 10

You just have to set up conditions etc for each number.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Since WE doesn't work, I'll try to do without...

Create about the same event, but like this:
  • Challenge
  • Events
    • Player - Player 1 (Red) types a chat message containing -challenge as A substring
    • Player - Player 2 (Blue) types a chat message containing -challenge as A substring
    • Player - Player 3 (Teal) types a chat message containing -challenge as A substring
    • Player - Player 4 (Purple) types a chat message containing -challenge as A substring
Now you can tell who he challenged through this action:
  • Actions
    • For loop Integer A from 1 to [Number of Players]
      • If then else, multiple conditions
        • If - conditions
          • (Substring((Entered chat string), 12, 13)) Equal to Convert String to Integer (Integer A)
        • Then - Actions
          • Set PlayerChallenged(Integer A) equal to True
          • Countdown Timer - Start (Timer[Integer A]) as a One-shot timer that will expire in 30.00 seconds
        • Else - Actions
Now, you can create a trigger that activates when a player types -ok (or -accept)

  • Accept Challenge
  • Events
    • Player - Player 1 (Red) types a chat message containing -accept as An exact string
  • Conditions
    • PlayerChallenged(Number of Triggering Player) equal to True
    • Remaining time for (Timer(Number of Triggering Player))) Greater than 0.00
  • Actions
    • Trigger - Turn off (This trigger)
    • Set PlayerChallenged(Number of Triggering Player) equal to False
    • Whatever you want to do...
    • Wait untill (Timer(Number of Triggering Player))) expires (or something like this)
    • Trigger - Turn on (This trigger)
Okey, since I couldn't open WE, some actions might be different, but this is about it...
The "As A substring" creates less events and more possibilities.

If you've got any questions, feel free to ask.
 
Status
Not open for further replies.
Top