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

[Trigger] More RPG Systems Testing

Status
Not open for further replies.

Deleted member 177737

D

Deleted member 177737

Hey,

I've just tweaked a few triggers and added in a "Mailbox System" which allows the map creator to send messages to the player via mailboxes throughout the map. (More information is in the trigger descriptions).

If anyone has some free time to test the systems for bugs, or suggest things to make/fixup it would be appreciated.

+rep

(Nobody has permission to use these systems without my permission)
 

Attachments

  • RPG Test.w3x
    120.5 KB · Views: 90
Last edited by a moderator:
Level 26
Joined
Mar 19, 2008
Messages
3,140
I've looked at i for just a while, and as first in trigger 'Mail System Check Letter' I would enter:

  • For each (Integer i) from 1 to 5, do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to MailboxDialogueButtons[i]
          • MailboxLetterCheck[i] Equal to 1
        • Then - Actions
          • Game - Display to (All players) the text: MailboxLetterContense[i]
        • Else - Action
Where 'i' is integer variable.
Actually I dont see why fifth if'then'else if even used, there is nothing in else nor in then.

It can 'cut' your trigger a lot, loops have been created for thing like this.

EDIT: The same goes to 'Mail System Reset' triggers, use:
  • For each (Integer i) from 1 to 4, do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to MailboxDialogueButtons[i]
          • MailboxLetterCheck[i] Equal to 0
        • Then - Actions
          • Dialog - Hide MailboxDialogue for Player 1 (Red)
          • Dialog - Clear MailboxDialogue
          • Trigger - Run Mail System Initilize <gen> (checking conditions)
        • Else - Actions
You can even combine those triggers together since they both are using the same event:
  • Ms Dialog Manipulate
    • Events
      • Dialog - A dialog button is clicked for MailboxDialogue
    • Conditions
    • Actions
      • For each (Integer i) from 1 to 4, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Clicked dialog button) Equal to MailboxDialogueButtons[i]
            • Then - Actions
              • Dialog - Hide MailboxDialogue for Player 1 (Red)
              • Dialog - Clear MailboxDialogue
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • MailboxLetterCheck[i] Equal to 1
                • Then - Actions
                  • Game - Display to (All players) the text: MailboxLetterContense[i]
                • Else - Actions
                  • Trigger - Run Mail System Initilize <gen> (checking conditions)
            • Else - Action
Since MailboxLetterCheck can take values 0 or 1 there should be no problem with that - if this can take other values, you will have to add additional if.
 
Last edited:

Deleted member 177737

D

Deleted member 177737

Thanks for showing me how to use a loop, I totally forgot they even existed =P
The triggers work perfectly except the last one where you said I could combine the two together.

When I re-created the combined trigger and went to test it, first when there was no "mail" in the mailbox it worked correctly. But when there was "mail" (after I typed -mail) the dialogue wouldn't clear so the buttons kept piling up.
I attempted to fix the problem by messing around with the trigger but I couldn't fix the problem. (I'm going to go read a tutorial on Loops so I can fix these myself eventually)

I've uploaded the newest version of the map in the OP.
 
Level 26
Joined
Mar 19, 2008
Messages
3,140
Oh man, there was tiny mistake by me with order of actions. Look last post again for correct version. Btw I didn't even look in game how it looks like before I actually wrote the code - so, now I had troubles with testing a bit because you didn't show where mailbox is :D

To be honest your spellbook is made incorrectly too. field with Minimum spells value should be never lower than current amount of spells hold by given spellbook. Setting Shared Spell Cooldown to false would be nice too.

EDIT: In system's initialize trigger in action Show Mailbox dialogue, use (Triggering unit) instead of (Casting unit) - it's faster.
 

Deleted member 177737

D

Deleted member 177737

Thanks again for the info about the spellbook and the initialize trigger. As for the combined trigger it still has the same bug as before, when there is no mail and you go to check it works perfectly. When there is mail and you go to check the dialogue is still not being cleared as it should be.

Its kind of weird because after looking at the trigger again it looks like it should work with no problem at all. I'm going to try and fix it.

BTW if you still have some free time, could you check out a few of my other triggers for things that could fix anything up. (I want to upload these systems to THW)
 
Level 26
Joined
Mar 19, 2008
Messages
3,140
I hope you have updated your map because on my computer that combined trigger works fine :D
I don't think I'm gonna have time for checking all the triggers, got too many request (especialy with fixing systems.. it's 7th in 4 days).

The same trigger I've done yesterday except loop has now 5 rounds instead of 4 (since there is also 'Leave' butoon).
 

Attachments

  • Mail System.w3x
    121.4 KB · Views: 89
Last edited:

Deleted member 177737

D

Deleted member 177737

I hope you have updated your map because on my computer that combined trigger works fine :D
I don't think I'm gonna have time for checking all the triggers, got too many request (especialy with fixing systems.. it's 7th in 4 days).

The same trigger I've done yesterday except loop has now 5 rounds instead of 4 (since there is also 'Leave' butoon).

Its working perfectly now, thanks,
 
Status
Not open for further replies.

Similar threads

D
  • Locked
Replies
0
Views
636
Deleted member 177737
D
D
  • Locked
Replies
0
Views
607
Deleted member 177737
D
D
  • Locked
Replies
7
Views
852
Deleted member 177737
D
Top