Orpg Quest Help

xmkiller

New Member
Reaction score
6
Alright. I have been having a mind block lately and I can not figure this one out. What I would like is..

If any player selects unit it will start the trigger. It will check what unit they had selected and will then check if ALL the players has done the quest yet. Basicly I tryed an array like...


"questlostdog[1] = 0"
"questlostdog[2] = 0"
(etc untill questlostdog[10])

0 = Have not done it
1 = Currently doing it
2 = Already Completed

Now I could make a huge ammount of If/then/else functions but im sure their is an easyer way that I would like to figure out.

if then else function
if questlostdog[1] = 0 then do <whatever>
if questlostdog[1] = 1 then do <whatever>
if questlostdog[1] = 2 then do <whatever>
if then else function
if questlostdog[2] = 0 then do <whatever>
if questlostdog[2] = 1 then do <whatever>
if questlostdog[2] = 2 then do <whatever>




Doing if then else functions for every player thats 10 in total x3 for each check. Thats 30 if then else functions, which is not not right in my opinion.

Thanks for all your help, I hope you understand my problem.

You may include any other ideas that may be easyer to produce, that would be great.
 
G

g1real

Guest
I'm the integer man here



Code:
For each integer A 1,10 do:
      Loop actions :
            if/then/else
                  If questlostdog[(Playernumber(Integer A))] = "0"
            then do:
                  Whatever you want it to do.
            Else: Do  nothing/proceed with next if/then/else

The integer 1,10 will run 10 times, 1x for every player


~~Just trying to help~~
 

LordOglog

New Member
Reaction score
16
Cant you just do.
If lost dog(quest variable) is compleated is equal to true
and stuff like that rather than using arrays.
 

xmkiller

New Member
Reaction score
6
@ Kakolukia

Thanks that makes a bit of sense, I'll go try it out. Im still not used to Integer loop functions yet.

@LordOglog

Because the quest is going to more then one player. I don't know if you can accually, I guess its easyer for me =P.
 

xmkiller

New Member
Reaction score
6
A little update on my quest which is working perfectly fine I might add. :)
Thanks alot for your help!

(used chat events because its faster to test)
Getting kills.

Code:
Lost Dog Objective
    Events
        Player - Player 1 (Red) types a chat message containing -kill as An exact match
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Entered chat string) Equal to -kill
            Then - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        _quest_lostdog_objective Less than 4
                    Then - Actions
                        Set _quest_lostdog_objective = (_quest_lostdog_objective + 1)
                        Game - Display to (All players) the text: (Kill typed correctly + ((String(_quest_lostdog_objective)) +  times.))
                    Else - Actions
                        Game - Display to (All players) the text: Quest Completed, go...
            Else - Actions
                Do nothing

(Used chat message instead of selection event because it wasn't working for some reason.)

Getting quest, Checking quest, and Finishing quest.


Code:
Lost Dog
    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
        Player - Player 6 (Orange) Selects a unit
        Player - Player 7 (Green) Selects a unit
        Player - Player 8 (Pink) Selects a unit
        Player - Player 9 (Gray) Selects a unit
        Player - Player 10 (Light Blue) Selects a unit
        Player - Player 1 (Red) types a chat message containing -test as An exact match
    Conditions
        Or - Any (Conditions) are true
            Conditions
                (Unit-type of (Triggering unit)) Equal to Quest Find Dog
                (Entered chat string) Equal to -test
    Actions
        Game - Display to (All players) the text:  test omg u selecte...
        For each (Integer A) from 1 to 10, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        _quest_lostdog[(Player number of (Player((Integer A))))] Equal to 0
                    Then - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                _quest_lostdog_objective Greater than or equal to 5
                            Then - Actions
                                Game - Display to (All players) the text: You have completely...
                                Set _quest_lostdog[(Player number of (Player((Integer A))))] = 2
                            Else - Actions
                                Game - Display to (Player((Integer A))), at offset (0.00, 0.00) the text: Blast! Those damn m...
                                Wait 2.00 seconds
                                Game - Display to (Player((Integer A))), at offset (0.00, 0.00) the text: (Murlocs killed  + ((String(_quest_lostdog_objective)) + /10))
                                Set _quest_lostdog[(Player number of (Player((Integer A))))] = 1
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                _quest_lostdog[(Player number of (Player((Integer A))))] Equal to 2
                            Then - Actions
                                Game - Display to (Player((Integer A))), at offset (0.00, 0.00) the text: Thank you hero! You...
                                Unit Group - Pick every unit in (Units owned by (Player((Integer A)))) and do (Actions)
                                    Loop - Actions
                                        Hero - Add 120 experience to (Picked unit), Show level-up graphics
                            Else - Actions
                                Game - Display to (Player((Integer A))), at offset (0.00, 0.00) the text: Hello again, are yo...


Again thanks for all your help.
 

xmkiller

New Member
Reaction score
6
I have made some changes and is having problems. I knew the post I posted above would not work in the long run so I put them together like so. And now it crashes asoon as I type in the event. Can anyone tell me whats wrong with my code?

Code:
Lost Dog
    Events
        Player - Player 1 (Red) types a chat message containing -test as An exact match
        Player - Player 1 (Red) types a chat message containing -kill as An exact match
    Conditions
        Or - Any (Conditions) are true
            Conditions
                (Entered chat string) Equal to -test
                (Entered chat string) Equal to -kill
    Actions
        -------- Doing Objective --------
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                And - All (Conditions) are true
                    Conditions
                        (Entered chat string) Equal to -kill
                        _quest_lostdog[(Player number of (Player((Integer A))))] Equal to 1
            Then - Actions
                For each (Integer B) from 1 to 10, do (Actions)
                    Loop - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                _quest_lostdog[(Player number of (Player((Integer A))))] Equal to 1
                            Then - Actions
                                Set _quest_lostdog_objective[(Player number of (Player((Integer B))))] = (_quest_lostdog_objective[(Player number of (Player((Integer B))))] + 1)
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        _quest_lostdog_objective[(Player number of (Player((Integer B))))] Less than or equal to 5
                                    Then - Actions
                                        Game - Display to (Player((Integer B))), at offset (0.00, 0.00) the text: (Murlocs Killed:  + ((String(_quest_lostdog_objective[(Player number of (Player((Integer B))))])) + /10))
                                    Else - Actions
                                        Game - Display to (Player((Integer B))), at offset (0.00, 0.00) the text: Slaughter the Murlo...
                            Else - Actions
                                Do nothing
            Else - Actions
        -------- Getting, Finishing, Complete. --------
        For each (Integer A) from 1 to 10, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        And - All (Conditions) are true
                            Conditions
                                (Entered chat string) Equal to -test
                                _quest_lostdog[(Player number of (Player((Integer A))))] Equal to 0
                    Then - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                _quest_lostdog_objective[(Player number of (Player((Integer B))))] Greater than or equal to 5
                            Then - Actions
                                Game - Display to (All players) the text: You have completed ...
                                Set _quest_lostdog[(Player number of (Player((Integer A))))] = 2
                            Else - Actions
                                Game - Display to (Player((Integer A))), at offset (0.00, 0.00) the text: Blast! Those damn m...
                                Set _quest_lostdog[(Player number of (Player((Integer A))))] = 1
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                _quest_lostdog[(Player number of (Player((Integer A))))] Equal to 2
                            Then - Actions
                                Game - Display to (Player((Integer A))), at offset (0.00, 0.00) the text: Thank you hero! You...
                                Unit Group - Pick every unit in (Units owned by (Player((Integer A)))) and do (Actions)
                                    Loop - Actions
                                        Hero - Add 120 experience to (Picked unit), Show level-up graphics
                            Else - Actions
                                Game - Display to (Player((Integer A))), at offset (0.00, 0.00) the text: Hello again, are yo...

Its really messy =P.
Thanks in advance.
 

xmkiller

New Member
Reaction score
6
**Friendly Bump :)
Never mind I figured it out..

If anyone could help me find a solution to this problem I would be so greatful.
 
G

g1real

Guest
Got no time to think, reserving this post to post a solution at 10:30

10:30:

Code:
Lost Dog
    Events
        Player - Player 1 (Red) types a chat message containing -test as [B]An exact match[/B]        Player - Player 1 (Red) types a chat message containing -kill as [B]An exact match[/B]
    Conditions
         [I]No need for conditions[/I]    Actions
        -------- Doing Objective --------
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                And - All (Conditions) are true
                    Conditions
                        (Entered chat string) Equal to -kill
                        _quest_lostdog[(Player number of [COLOR="Red"](Player((Integer A))))] [/COLOR]Equal to 1 [B](No integer A specified before this)[/B]
            Then - Actions
                For each (Integer B) from 1 to 10, do (Actions)
                    Loop - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                _quest_lostdog[(Integer A)] Equal to 1
                            Then - Actions
                                Set _quest_lostdog_objective[(Player number of (Player((Integer B))))] = (_quest_lostdog_objective[(Player number of (Player((Integer B))))] + 1)
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        _quest_lostdog_objective[(Player number of (Player((Integer B))))] Less than or equal to 5
                                    Then - Actions
                                        Game - Display to (Player((Integer B))), at offset (0.00, 0.00) the text: (Murlocs Killed:  + ((String(_quest_lostdog_objective[(Player number of (Player((Integer B))))])) + /10))
                                    Else - Actions
                                        Game - Display to (Player((Integer B))), at offset (0.00, 0.00) the text: Slaughter the Murlo...
                            Else - Actions
                                Do nothing
            Else - Actions
        -------- Getting, Finishing, Complete. --------
        For each (Integer A) from 1 to 10, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        And - All (Conditions) are true
                            Conditions
                                (Entered chat string) Equal to -test
                                _quest_lostdog[(Player number of (Player((Integer A))))] Equal to 0
                    Then - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                _quest_lostdog_objective[(Player number of (Player((Integer B))))] Greater than or equal to 5
                            Then - Actions
                                Game - Display to (All players) the text: You have completed ...
                                Set _quest_lostdog[(Player number of (Player((Integer A))))] = 2
                            Else - Actions
                                Game - Display to (Player((Integer A))), at offset (0.00, 0.00) the text: Blast! Those damn m...
                                Set _quest_lostdog[(Player number of (Player((Integer A))))] = 1
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                _quest_lostdog[(Player number of (Player((Integer A))))] Equal to 2
                            Then - Actions
                                Game - Display to (Player((Integer A))), at offset (0.00, 0.00) the text: Thank you hero! You...
                                Unit Group - Pick every unit in (Units owned by (Player((Integer A)))) and do (Actions)
                                    Loop - Actions
                                        Hero - Add 120 experience to (Picked unit), Show level-up graphics
                            Else - Actions
                                Game - Display to (Player((Integer A))), at offset (0.00, 0.00) the text: Hello again, are yo...

Too confusing. I don't have WE at hand either. Can you explain what this is meant to do, i DID edit the first part tho so it might help.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top