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

[Solved] (GUI MPI) Quest system.

Status
Not open for further replies.
Level 10
Joined
Nov 24, 2010
Messages
546
Hello guys, So I'd like to create GUI MPI Quests.
Every player need to take quest to advance quest.
Once 1 player takes it, it displays quest in quest log for everyone with list of player names what are on quest.
Everything works fine, tested it in multiplayer with my friends, only my problem is removing player name from player list when he/she complete quest.
Here are triggers.

Setting names of each Quest.
  • QuestNames
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Quest_Names[1] = Delivery
Accepting Quest and creating Quest.
  • QuestAccept
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Tome of Experience
    • Actions
      • Set DeliveryQ_i = (DeliveryQ_i + 1)
      • Set DeliveryQ_r = (Real(DeliveryQ_i))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DeliveryQBoolean[(Player number of (Owner of (Triggering unit)))] Equal to True
        • Then - Actions
          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: You are already on ...
        • Else - Actions
          • Quest - Display to (All players) the Quest Discovered message: ((Name of (Owner of (Triggering unit))) + ( has accepted: + Quest_Names[1]))
          • Set DeliveryQBoolean[(Player number of (Owner of (Triggering unit)))] = True
          • Set DeliveryQPList = (DeliveryQPList + ( + (Name of (Owner of (Triggering unit)))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DeliveryQ_i Equal to 1
        • Then - Actions
          • Set DeliveryQuestCreated = True
          • Quest - Create a Required quest titled Delivery with the description (Players on this Quest: + DeliveryQPList), using icon path ReplaceableTextures\CommandButtons\BTNAmbush.blp
          • Set DeliveryQ_Q = (Last created quest)
        • Else - Actions
          • Quest - Change the description of DeliveryQ_Q to (Players on this Quest: + DeliveryQPList)
Finishing Quest
Here I have biggest problem, I don't know how to remove player name from quest list when completed :(
  • QuestFinish
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Tome of Agility
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DeliveryQBoolean[(Player number of (Owner of (Triggering unit)))] Equal to True
        • Then - Actions
          • Quest - Display to (All players) the Quest Update message: (((Name of (Owner of (Triggering unit))) + has completed ) + Quest_Names[1])
          • Set DeliveryQ_i = (DeliveryQ_i - 1)
          • Set DeliveryQ_r = (Real(DeliveryQ_i))
          • Set DeliveryQBoolean[(Player number of (Owner of (Triggering unit)))] = False
        • Else - Actions
          • Game - Display to (All players) the text: You cannot complete...
Destroying quest when there is noone left with it.
  • QuestDestroy
    • Events
      • Game - DeliveryQ_r becomes Equal to 0.00
    • Conditions
    • Actions
      • Quest - Destroy DeliveryQ_Q
+rep and credits for suggestions
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
You could use a loop that recreates the quest description based on the delivery boolean

Set string = "Players on this quest:"
Pick all players
loop
if quest not completed for picked player then
string = string + player name
endif
set quest description to string
 
Level 10
Joined
Nov 24, 2010
Messages
546
Thanks for trying to help, I've solved this by strange way

  • Set DeliverQString[(Player number of (Owner of (Triggering unit)))] = ( + (Name of (Owner of (Triggering unit))))
  • Set DeliveryQPList = (DeliverQString[1] + (DeliverQString[2] + (DeliverQString[3] + (DeliverQString[4] + DeliverQString[5]))))
And when completed DeliverQString(Player Number) = empty string, and again when completed Set DeliveryQPList = (DeliverQString[1] + (DeliverQString[2] + (DeliverQString[3] + (DeliverQString[4] + DeliverQString[5]))))


Note I have max 5 players in map :)
 
Status
Not open for further replies.
Top