HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Party system help

02-07-2006, 06:08 AM#1
Linera
Ok here is what I'm trying to do.

I'm making a party/raid system for my RPG that allows players you group for quests and dungeons.

I have tried many different ways but get stuck and just can't get it to work.

I need it to allow me to use it with a custom made exp gain system, allowing me to divide exp among party members.

The commands for this system would be as followed:
-invite (player name you're inviting)
-remove (player name you're removing)
-leave
-disband
-raid <converts from party to raid>

A party allows up to 5 players to group. Raid is a max of 10 players.

Here is my last attempt of an invite command:

Code:
Invite
    Events
        Player - Player 1 (Red) types a chat message containing -invite  as A substring
    Conditions
        (Substring((Entered chat string), 1, 8)) Equal to -invite 
    Actions
        -------- player doing invite --------
        Player Group - Pick every player in (All players matching ((Name of (Triggering player)) Equal to (Name of (Triggering player)))) and do (Actions)
            Loop - Actions
                Set Invite_Player = (Picked player)
        -------- player invited --------
        Player Group - Pick every player in (All players matching ((Name of (Picked player)) Equal to (Substring((Entered chat string), 9, (Length of (Entered chat string)))))) and do (Actions)
            Loop - Actions
                Set Invite_Player2 = (Picked player)
        For each (Integer A) from 1 to 5, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Invite_Player is in Party[(Integer A)]) Equal to True
                    Then - Actions
                        Set Invite_InParty = True
                    Else - Actions
                        Set Invite_InParty = False
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Invite_Player2 is in Party[(Integer A)]) Equal to True
                    Then - Actions
                        Set Invite_InParty2 = True
                    Else - Actions
                        Set Invite_InParty2 = False
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Invite_Player is in Raid[(Integer A)]) Equal to True
                    Then - Actions
                        Set Invite_InRaid = True
                    Else - Actions
                        Set Invite_InRaid = False
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Invite_Player2 is in Raid[(Integer A)]) Equal to True
                    Then - Actions
                        Set Invite_InRaid2 = True
                    Else - Actions
                        Set Invite_InRaid2 = False
        -------- invite process --------
        -------- party --------
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Invite_InParty2 Equal to False
                Invite_InRaid2 Equal to False
            Then - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Invite_InParty Equal to False
                    Then - Actions
                    Else - Actions
            Else - Actions
                Game - Display to (Player group((Triggering player))) the text: ((Name of Invite_Player2) +  is already in a group.)

P.S. I know I should use the trigger tags but I can't find them on the toolbar.
02-07-2006, 06:54 AM#2
qwertyui
OOT Whining: Why oh WHY noone ever uses [ jass ] and [ trigger ] tags? Its always only [ code ]! Makes it sooo hard to read :/.
Ah just noticed the P.S. Well, you just write these tags manually! [ trigger ] at start of trigger text and [ /trigger ] at end of trigger text. Remove spaces between brackets and text ofc.

Anyway this trigger contains no actions whatsoever to be done when player is in eligible for invite. So what is the question?
02-07-2006, 07:34 AM#3
Linera
I said I've tried several times to make it and every time its failed, That code i posted is what i had when i noticed it won't work that way.

I have ran out of ideas that might work. And I'm getting tired of trying, spending a few days only to find it doesn't work.

I want some help on getting this to work.
02-07-2006, 09:44 AM#4
qwertyui
Okay, but what do you intend the code to do?
The code you showed us does nothing, but setting up some booleans, based on if/then conditions.
The only more or less meaningful action it takes is displaying a message when it detect that player is already in some party.

So the problem is that it displays this message even when player is not in party?

P.S: your trigger in [ trigger ] tags for easier reading :/
Trigger:
Invite
Collapse Events
Player - Player 1 (Red) types a chat message containing -invite as A substring
Collapse Conditions
(Substring((Entered chat string), 1, 8)) Equal to -invite
Collapse Actions
-------- player doing invite --------
Collapse Player Group - Pick every player in (All players matching ((Name of (Triggering player)) Equal to (Name of (Triggering player)))) and do (Actions)
Collapse Loop - Actions
Set Invite_Player = (Picked player)
-------- player invited --------
Collapse Player Group - Pick every player in (All players matching ((Name of (Picked player)) Equal to (Substring((Entered chat string), 9, (Length of (Entered chat string)))))) and do (Actions)
Collapse Loop - Actions
Set Invite_Player2 = (Picked player)
Collapse For each (Integer A) from 1 to 5, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Invite_Player is in Party[(Integer A)]) Equal to True
Collapse Then - Actions
Set Invite_InParty = True
Collapse Else - Actions
Set Invite_InParty = False
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Invite_Player2 is in Party[(Integer A)]) Equal to True
Collapse Then - Actions
Set Invite_InParty2 = True
Collapse Else - Actions
Set Invite_InParty2 = False
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Invite_Player is in Raid[(Integer A)]) Equal to True
Collapse Then - Actions
Set Invite_InRaid = True
Collapse Else - Actions
Set Invite_InRaid = False
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Invite_Player2 is in Raid[(Integer A)]) Equal to True
Collapse Then - Actions
Set Invite_InRaid2 = True
Collapse Else - Actions
Set Invite_InRaid2 = False
-------- invite process --------
-------- party --------
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Invite_InParty2 Equal to False
Invite_InRaid2 Equal to False
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Invite_InParty Equal to False
Then - Actions
Else - Actions
Collapse Else - Actions
Game - Display to (Player group((Triggering player))) the text: ((Name of Invite_Player2) + is already in a group.)
02-07-2006, 01:51 PM#5
Linera
I didn't finish it cause i noticed it won't work that way so i stopped.

What this system will do, is work like party/raid system from games like WoW and EQ.

It will use a multiboard displayed only to members of that group in order to show who is in the party and their hp, mp and level.
02-07-2006, 04:47 PM#6
qwertyui
Okay i got what's the problem here.

Please reread your own posts and answer a simple question.
How many question marks do you see?

How are we supposed to give you an answer and help, if you don't even give a question!

Now, for any sort of invite trigger, you need:
-invite <color> command
or
-invite <playername> command
whichever suits your fancy. Both should identify the number of player giving the command, and the number of command's target player, and pass it on to inviting routine.

From there on in, i would go with a 12x12 boolean matrix implementation, which would allow you to store information on which player is the current player partied with.

Alternatively, you can create, say, a player group array. And then store party status by adding player to one of player arrays, depending on which party/raid they are in.

Another option is to create two booleans and an integer for every player, indicating if a player is in raid, is in party, and what party/raid id they are in. And then base your system on manipulating these. This would be the most effective option and you even started writing a trigger for it, but you are saying it won't work for some reason, so your call.

I wouldn't worry about multiboards until you get the basic system sorted out. For testing purposes just use text printouts.
02-07-2006, 04:57 PM#7
Immoralis
Quote:
Originally Posted by qwertyui
whichever tickles your fancy.
and 1 player group array is alot easier thatn 12x12 matrix boolean array
02-07-2006, 05:01 PM#8
qwertyui
suits your fancy can also be used :P

I simply dislike using groups for anything in WC3, unless i ABSOLUTELY need it, or need to do something real simple only once in the whole game. This is mostly due to absolutely horrible group iteration methods made by blizzard.

And i also have a soft spot for 2D arrays :P
02-07-2006, 07:11 PM#9
Linera
Just attempted the invite command again, and my testers said the invite dialog didn't open.

Trigger:
Invite
Collapse Events
Player - Player 1 (Red) types a chat message containing -invite as A substring
Collapse Conditions
(Substring((Entered chat string), 1, 8)) Equal to -invite
Collapse Actions
-------- player doing invite --------
Collapse Player Group - Pick every player in (All players matching ((Name of (Triggering player)) Equal to (Name of (Triggering player)))) and do (Actions)
Collapse Loop - Actions
Set Invite_Player = (Picked player)
-------- player invited --------
Collapse Player Group - Pick every player in (All players matching ((Name of (Picked player)) Equal to (Substring((Entered chat string), 9, (Length of (Entered chat string)))))) and do (Actions)
Collapse Loop - Actions
Set Invite_Player2 = (Picked player)
-------- Check Parties/Raids --------
Collapse For each (Integer A) from 1 to 5, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Invite_Player is in Party[(Integer A)]) Equal to True
Collapse Then - Actions
Set Invite_InParty = True
Collapse Else - Actions
Set Invite_InParty = False
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Invite_Player2 is in Party[(Integer A)]) Equal to True
Collapse Then - Actions
Set Invite_InParty2 = True
Collapse Else - Actions
Set Invite_InParty2 = False
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Invite_Player is in Raid[(Integer A)]) Equal to True
Collapse Then - Actions
Set Invite_InRaid = True
Collapse Else - Actions
Set Invite_InRaid = False
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Invite_Player2 is in Raid[(Integer A)]) Equal to True
Collapse Then - Actions
Set Invite_InRaid2 = True
Collapse Else - Actions
Set Invite_InRaid2 = False
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Raid_Leader[(Integer A)] Equal to Invite_Player
Collapse Then - Actions
Set invite_leader = True
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Party_Leader[(Integer A)] Equal to Invite_Player
Collapse Then - Actions
Set invite_leader = True
Collapse Else - Actions
Set invite_leader = False
-------- Begin Invite Process --------
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse And - All (Conditions) are true
Collapse Conditions
Invite_InParty2 Equal to False
Invite_InRaid2 Equal to False
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Invite_InParty Equal to True
invite_leader Equal to True
Collapse Then - Actions
Dialog - Change the title of Invite_Dialog to ((Name of Invite_Player) + invited you to join a party.)
Dialog - Show Invite_Dialog for Invite_Player2
Set Invite_Trigger = 1
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Invite_InParty Equal to False
Invite_InRaid Equal to False
Collapse Then - Actions
Dialog - Change the title of Invite_Dialog to ((Name of Invite_Player) + invited you to join a party.)
Dialog - Show Invite_Dialog for Invite_Player2
Set Invite_Trigger = 2
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Invite_InRaid Equal to True
invite_leader Equal to True
Collapse Then - Actions
Dialog - Change the title of Invite_Dialog to ((Name of Invite_Player) + invited you to join a raid.)
Dialog - Show Invite_Dialog for Invite_Player2
Set Invite_Trigger = 3
Collapse Else - Actions
Do nothing
Collapse Else - Actions
Game - Display to (Player group(Invite_Player)) the text: ((Name of Invite_Player2) + is already in a party.)
Trigger:
Invite Answer
Collapse Events
Dialog - A dialog button is clicked for Invite_Dialog
Collapse Conditions
(Clicked dialog button) Equal to Invite_Yes
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Invite_Trigger Equal to 1
Collapse Then - Actions
Collapse For each (Integer A) from 1 to 5, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Invite_Player is in Party[(Integer A)]) Equal to True
Collapse Then - Actions
Player Group - Add Invite_Player2 to Party[(Integer A)]
Game - Display to Party[(Integer A)] the text: ((Name of Invite_Player2) + has joined the party.)
Game - Display to (Player group(Invite_Player2)) the text: You have joined a p...
Collapse Else - Actions
Do nothing
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Invite_Trigger Equal to 2
Collapse Then - Actions
Collapse For each (Integer A) from 1 to 5, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Number of players in Party[(Integer A)]) Equal to 0
Collapse Then - Actions
Player Group - Add Invite_Player2 to Party[(Integer A)]
Player Group - Add Invite_Player to Party[(Integer A)]
Set Party_Leader[(Integer A)] = Invite_Player
Game - Display to (Player group(Invite_Player)) the text: You have joined a p...
Game - Display to (Player group(Invite_Player2)) the text: You have joined a p...
Game - Display to (Player group(Invite_Player)) the text: You are the party l...
Collapse Else - Actions
Do nothing
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Invite_Trigger Equal to 3
Collapse Then - Actions
Collapse For each (Integer A) from 1 to 5, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Invite_Player is in Raid[(Integer A)]) Equal to True
Collapse Then - Actions
Player Group - Add Invite_Player2 to Raid[(Integer A)]
Game - Display to Raid[(Integer A)] the text: ((Name of Invite_Player2) + has joined the raid.)
Game - Display to (Player group(Invite_Player2)) the text: You have joined a r...
Collapse Else - Actions
Do nothing
Collapse Else - Actions
Do nothing
02-08-2006, 07:22 AM#10
Mystic Prophet
You know people would use the jass and trigger tags more often if they were actually in the interface. There are no jass and trigger tag buttons so most people new to the site don't think to just write out the commands.
02-08-2006, 11:01 AM#11
qwertyui
Okay, first problem i spotted right away is:
Trigger:
Player Group - Pick every player in (All players matching ((Name of (Triggering player)) Equal to (Name of (Triggering player)))) and do (Actions)
Loop - Actions
Set Invite_Player = (Picked player)

Look closely at your condition for player to pick:
Name of Triggerring Player = Name of Triggerring Player

I believe it should be:
Name of Triggerring Player = Name of Matching Player.

Don't have time to look in more detail, but i definitely will so don't worry ^^
02-08-2006, 06:05 PM#12
Linera
I don't see any error in that.