• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Making a quest for specific player

Status
Not open for further replies.
Level 5
Joined
Jul 23, 2013
Messages
95
ok i searched the net, the hive, and everywhere but couldent understand what everyone was talking about.
i want to know how to make a quest thats ONLY for player red, and another quest for ONLY player blue, anyone please can help me???
 
Level 11
Joined
Jun 20, 2009
Messages
880
You have to use integer arrays to do it

  • Kill
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Knight
    • Actions
      • Set X = (Player number of (Owner of (Killing unit)))
      • Set UnitKills[X] = (UnitKills[X] + 1)
  • Finish
    • Events
      • Unit - A unit enters Region 000 <gen>
    • Conditions
      • UnitKills[(Player number of (Owner of (Triggering unit)))] Greater than or equal to 10
    • Actions
      • Set X = (Player number of (Owner of (Entering unit)))
      • Game - Display to (Player group((Owner of (Entering unit)))) for 30.00 seconds the text: YOU HAVE COMPLETED ...
      • Set UnitKills[X] = 0

Like this.
The integer called X will be the number of the players. So if you're Red, it will be 1.

If you kill an unit, we will only modify the integer X(1), so other players integers will remain the same. This way you can make quests for just one players.
It might take a while to understand, but just study the triggers and eventually you'll understand.
 
Level 25
Joined
Sep 26, 2009
Messages
2,378
All players will still see the quest in the quest window imo.

What you need to use is a GetLocalPlayer function. What this function does is it checks if the player on PC is "the player you want" and if yes, it does thing A, else it does thing B.

For example you can check if LocalPlayer is player 1 (red). If yes, you show special effect, if not, you show "none" effect, etc.

GetLocalPlayer function is used in the spell "Mirror Image" - when you are the player who cast this spell, you see the images blue-colored, while other players don't. That's basically GetLocalPlayer - if LocalPlayer == Casting Player, change color of images, else change no color.
Look in this tutorial: http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/getlocalplayer-225738/ - pay extra attention to the last part of the tutorial (Desynchronization), because badly used/set up GetLocalPlayer causes desynchronization.
 
Status
Not open for further replies.
Top