• 🏆 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!

Quest for one player

Status
Not open for further replies.
  • Custom script - if GetLocalPlayer = 'Player' then
  • Actions 'for specific players'
  • Custom script - endif
There is no trigger that makes a quest for a specific player that is in GUI but you can use the custom script 'if GetLocalPlayer = 'Player' then' then the actions in between that action and the end if are only shown for that specific player but only keep use this for such things as messages until you recognize what could desinc your map.
 

Bannar

Code Reviewer
Level 26
Joined
Mar 19, 2008
Messages
3,140
  • Custom script - if GetLocalPlayer = 'Player' then
  • Actions 'for specific players'
  • Custom script - endif
There is no trigger that makes a quest for a specific player that is in GUI but you can use the custom script 'if GetLocalPlayer = 'Player' then' then the actions in between that action and the end if are only shown for that specific player but only keep use this for such things as messages until you recognize what could desinc your map.

Your custom script is wrong. It doesn't check if player curently executing code is given player but just set player executing code to given player 'Player' what is wierd, since after 'if' there should always be a comparison. Use '==' instead of '=' for negating that mistake.

Furthermore, your script doesn't even call function GetLocationPlayer() since you have missed '()' part - it's important: even if function requires no variables you have write those brackets. Now you cuz call integer variable, since function without passed variables one just numbers.

Proper script:
JASS:
    if GetLocalPlayer() == Player then
        //actions
    endif
Where Player is your given player.
 
Level 17
Joined
Feb 11, 2011
Messages
1,860
So, is this correct:

  • Q1 Barrens Cleansing
    • Events
      • Unit - A unit enters Quest 1 <gen>
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Custom script: if GetLocalPlayer() == GetOwningPlayer(GetEnteringUnit()) then
      • Quest - Create a Required quest titled Kill Stuff with the description Kill everyone, using icon path ReplaceableTextures\CommandButtons\BTNAmbush.blp
      • Custom script: endif
 

Bannar

Code Reviewer
Level 26
Joined
Mar 19, 2008
Messages
3,140
Try
  • Set LocalPlayer = Player 1 (Red) //modify this to whatever player you want to show it for
  • Custom script: if GetLocalPlayer() != udg_LocalPlayer then
  • <Your shit here>
  • Custom script: endif
So its more easy.

If there any difference in your solution and mine? no.
You just set player variable first, and I used GetOwningPlayer(unit) immidiately in script, since he asked for it.
 
Level 17
Joined
Feb 11, 2011
Messages
1,860
Thanks, but what is the "!" for? It gives an error if I include it. My trigger looks like this:

  • Kill Centaurs
    • Events
      • Unit Dies
    • Conditions
      • Owner of Dying unit Equal to Neutral Hostile
    • Actions
      • Set Local_Player = (Owner of (Killing unit))
      • Custom script: if GetLocalPlayer() == udg_Local_Player then
      • [ACTIONS]
      • Custom script: endif
This should still work, right?

- Mr_Bean
 
Level 17
Joined
Feb 11, 2011
Messages
1,860
This is what my quest currently looks like:

  • Quest 1
    • Events
      • Player - Player 1 (Red) Selects a unit
      • Player - Player 2 (Blue) Selects a unit
      • Player - Player 3 (Teal) Selects a unit
      • Player - Player 4 (Purple) Selects a unit
      • Player - Player 5 (Yellow) Selects a unit
    • Conditions
    • Actions
      • Custom script: if GetLocalPlayer() == GetTriggerPlayer() then
      • Quest - Create a Required quest titled Barrens Cleansing with the description Greetings, Hero. Th..., using icon path ReplaceableTextures\CommandButtons\BTNcentaur.blp
      • Quest - Display to (All players) the Quest Discovered message: |cffffcc00Quest Acc...
      • Special Effect - Destroy Quest_Unobtained_Effect[1]
      • Special Effect - Create a special effect attached to the overhead of Quest_Giver[1] using floating questionmark_v2.mdx
      • Custom script: endif
      • Set Quest[1] = (Last created quest)
      • Quest - Create a quest requirement for Quest[1] with the description Kill 10 Centaurs.
      • Quest - Create a quest requirement for Quest[1] with the description Return to the Serge...
      • Set Quest_Obtained_Effect[1] = (Last created special effect)
"Quest_Unobtained_Effect" is an exclamation mark above the quest giver's head.
"Quest_Obtained_Effect" is a question mark above the quest giver's head.

There should be no problems with this, right? Will it cause a desync or will it cause no issues?

Thanks,

- Mr_Bean
 
do this instead if your going to use conditions :p

joinminus.gif
cond.gif
Conditions
line.gif
joinbottom.gif
if.gif
(Entering unit) Equal to your_unit[(Player number of (triggering player))]
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,182
then use

  • Untitled Trigger 001
    • Events
      • Unit - A unit enters Region 000 <gen>
    • Conditions
      • (Entering unit) Equal to your_unit[(Player number of (Owner of (Entering unit)))]
    • Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Triggering unit) Equal to your_unit[player number of player you want quest to work for]
    • Then - Actions
  • your actions here
    • Else - Actions
 
Status
Not open for further replies.
Top