• 🏆 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!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

Strange Quest Related Problem

Status
Not open for further replies.
Level 2
Joined
Feb 5, 2011
Messages
16
Hello, I am currently having problems with quests.

I shall give you all a brief idea of the problem and hope that someone out there can enlighten me after looking at my trigger and tell me what went wrong.

This is roughly how I wanted the trigger to work:

Tested out one other friend (total of 2 players), this part has no problems
--------------------------------------------------
Players able to buy quest from quest giver. (Let's say the quest is to kill 3 units)
Two quests will be created in Quest(F9) in game (One for me one for friend)
Killing of units is independent, so means each of us has to kill 3 units individually
When 3 units are killed, quest is marked as completed.
Only if the quest is completed can you receive rewards (gain EXP) from quest giver.


Ok, this is the part which I cannot figure out how to fix
-----------------------------------------------------
When I (Player 1) killed 3 units, the quest in Quest(F9) is marked as COMPLETED and I can claim the reward from the quest giver and repeat quest as per normal.
However, when another player (Player 2) killed 3 units, nothing shows up in the quest in Quest(F9) and the discovered quest will remain only as discovered and not being COMPLETED no matter how many units are killed. Hence Player 2 is unable to claim reward and continue as per normal as only Players with the "Kill 3 units" quest as completed can retake the same quest.

So, the strange thing is that my coding for the trigger is working perfectly fine for Player 1 but it is bugged for Player 2 (and possibly other Players).
----------------------------------------------

I have tried my best to describe the problems I am facing.
As attached is a screenshot of the trigger where something might have ran wrong (the problem with this quest is that only Player 2 (and possibly other players) is unable to mark quest as COMPLETED even though requirements of quest are met and only Player 1 is able to run the quest smoothly).


tumblr_lgm6qg3sCl1qe4n8io1_1280.jpg


Please ask me if you do not understand my problem.

Thanks.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
A few side-notes:
  • You can easily copy/paste triggers by right-clicking the thing above "Events" and selecting "Copy as Text", then you can paste it here and type [trigger] (pasted trigger) [/trigger].
  • You can show quests ONLY for the player who is on that quest (so although 2 quests will have been created, you can only see 1: the quest you are on).
    How this is done is explained later on.
  • The action "Do Nothing" DOES run a function, but that function doesn't do anything. That means you better delete it (because running a function that doesn't do anything wastes CPU).
  • You can remove the second If/Then/Else-multiple completely and move the actions to the "else"-part of the previous If/Then/Else-Multiple.
    That's because you say if kills < 5 then Act1 else nothing if kills >= 5 then Act2 else nothing - this can be combined to if kills < 5 then Act1 else Act2 (if kills isn't smaller than 5, it has to be greater than or equal to).
  • There is no use for the If/Then/Else-single: You said "if kills >= 5 then if kills >= 5 then actions" - as you can see, the second condition can be removed.

Solution: (maybe)

The condition is wrong.
There is no "buying unit" in your trigger.


Showing quests for only 1 player:

  • Actions
    • Quest - Create a Required quest titled with the description <Empty String>, using icon path ReplaceableTextures\CommandButtons\BTNAmbush.blp
    • Set Quest = (Last created quest)
    • Quest - Disable Quest
    • Set Player = Player 1 (Red)
    • Custom script: if GetLocalPlayer == udg_Player then
    • Quest - Enable Quest
    • Custom script: endif
The first part is easy: you create a quest and disable (thus hiding) it for everyone.
I now set a GUI-variable called "Player" for your simplicity: the quest will enable ONLY for the player stored in that variable, so that player will be the only one to see it.
 
Level 2
Joined
Feb 5, 2011
Messages
16
  • Start Track Down The Bandits
    • Events
      • Unit - Fledglings Encampment Quest Giver 0028 <gen> Sells an item (from shop)
    • Conditions
      • (Quest[((Player number of (Owner of (Buying unit))) + 1)] is enabled) Equal to False
      • (Item-type of (Sold Item)) Equal to Track Down The Bandits!
    • Actions
      • Item - Remove (Sold Item)
      • Quest - Display to (Player group((Owner of (Buying unit)))) the Quest Update message: Help! The Bandits h...
      • Quest - Create a Required quest titled Track Down The Band... with the description The Bandits have st..., using icon path ReplaceableTextures\CommandButtons\BTNAmbush.blp
      • Set Quest[((Player number of (Owner of (Buying unit))) + 1)] = (Last created quest)
      • Quest - Disable Quest[((Player number of (Owner of (Buying unit))) + 1)]
      • Set Players[(Player number of (Owner of (Buying unit)))] = (Owner of (Buying unit))
      • Custom script: if GetLocalPlayer == udg_Players then
      • Quest - Enable Quest[((Player number of (Owner of (Buying unit))) + 1)]
      • Custom script: endif
I tried using your Single Player Quest system but something else seems to be wrong. some how the trigger cannot be turned on due to 2 errors (it says something wrong with the custom script).

How can I fix it?
 
Level 2
Joined
Feb 5, 2011
Messages
16
Haha yeah ok thanks. but now there is this server split problem i suppose?

After my friend kills one unit after activating the quest, he gets disconnected.

Is there a way to solve this problem?
 
Level 2
Joined
Feb 5, 2011
Messages
16
hmm the problem i face is that the player gets dc after killing a unit, after activating the quest.

i'm not so sure what kind of problem is that though.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
It has to be the system I've given you: GetLocalPlayer() is well-known for desyncing the game.
Very short explanation: the GetLocalPlayer() function takes all player and does the actions ONLY FOR THAT PLAYER (so if you create a unit after GetLocalPlayer(), then the unit is only created in his game - obviously causes a desync).

You should try some of these other options:
  • Actions
    • Set Player = Player 1 (Red)
    • Quest - Create a Required quest titled Title with the description Description, using icon path ReplaceableTextures\CommandButtons\BTNAbomination.blp
    • Custom script: if GetLocalPlayer() != udg_Player then
    • Quest - Destroy (Last created quest)
    • Custom script: endif
  • Actions
    • Set Player = Player 1 (Red)
    • Custom script: if GetLocalPlayer() == udg_Player then
    • Quest - Create a Required quest titled Title with the description Description, using icon path ReplaceableTextures\CommandButtons\BTNAbomination.blp
    • Custom script: endif
But since even enabling a quest locally desyncs the player according to you, then these might fail as well.
 
I have question related to quests, I started working on them but I hate error created when I want to display string variable trough quest message, it's seams code for color work but code for new line don't (|n) :(
Still created quest, using same variable, look perfectly fine...

Not such deal, that's just few lines of text, instead of variables, but still I would like to know why? :)
 
Status
Not open for further replies.
Top