• 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.

[General] How to make it so quests are only visible to a certain player?

Status
Not open for further replies.
Level 15
Joined
Aug 7, 2013
Messages
1,338
Hi,

How do I make it so a quest is only visible in the F9 log to the player who unlocked/started it?

I'm looking at the API for making quests but there's nothing that takes a Player or pid as an argument...
 
When you create the quest, just disable it globally:
JASS:
local quest q = CreateQuest()
call QuestSetEnabled(q, false)

You can locally enable it:
JASS:
if GetLocalPlayer() == Player(0) then
    call QuestSetEnabled(q, true) // enables only for player(0), a.k.a. Player 1 (Red)
endif
For whichever players you want. You'll also probably want to set a boolean, depending on the player you enable the quest for:
JASS:
if GetLocalPlayer() == Player(0) then
    call QuestSetEnabled(q, true)
endif
set qenabled[0] = true // the index will be the player ID
That way, you can just check qenabled[GetPlayerId(p)] when you need to check if a player "has" a quest. If you use IsQuestEnabled, it may return different values for different players and you'll run into some strange errors.

For more info on GetLocalPlayer(), see:
http://www.thehelper.net/threads/jass-getlocalplayer.77369/
 
Status
Not open for further replies.
Top