Hey ppl, I need help writing a party system, I know what a party system is but i'm not sure how to write one, especially for a text based game. If anyone could help I would greatly appreciate it! Thanks!
Wanted features for a party system.
-Displays party members name's
-Displays party members Health
-Displays party members Mana
-Displays party members Experience bar
-Displays party members Level
-Displays party members Attack
-Displays party members Defense
-Displayable Chat for party (I have no idea to write a chat.)
-When a creature dies, exp, and loot will be given to all members in the party
I tried to Google this but not much help. If anyone found some luck let me know!
Party System
- hallsofvallhalla
- Site Admin
- Posts: 12026
- Joined: Wed Apr 22, 2009 11:29 pm
Re: Party System
oooo this one will be a bit tricky but still easy nonetheless.
Basically here is one way you could do it.
create a new table called party.
have a few fields..
plname = player name
partyid = parties ID..generated randomly when party is created $partyid = rand(1000,999999999);
plleader = party leader
now when a player(halls) creates the party it creates a new line in the party table
plname = halls
partyid = 897677
plleader = halls
now when a player joins it(rapid), it creates a new line and gives the party id
plname = rapid
partyid = 897677
plleader = halls
so now you can query select * from party where partyid = $partyid AND plleader=$plleader to get all members.
You can create a for loop to loop through all the members to give out loop.
Basically here is one way you could do it.
create a new table called party.
have a few fields..
plname = player name
partyid = parties ID..generated randomly when party is created $partyid = rand(1000,999999999);
plleader = party leader
now when a player(halls) creates the party it creates a new line in the party table
plname = halls
partyid = 897677
plleader = halls
now when a player joins it(rapid), it creates a new line and gives the party id
plname = rapid
partyid = 897677
plleader = halls
so now you can query select * from party where partyid = $partyid AND plleader=$plleader to get all members.
You can create a for loop to loop through all the members to give out loop.
Re: Party System
wow hey thats a great idea! i'm glad i asked for help because what i researched i was going to do something completely different! Your idea is way simpler than my idea! Thanks i will post back as soon as i get a chance to write it out! Thank You so much for the help!
hey halls just wondering do you have any information on when the next set of videos will be released for the mmo series?
hey halls just wondering do you have any information on when the next set of videos will be released for the mmo series?
- hallsofvallhalla
- Site Admin
- Posts: 12026
- Joined: Wed Apr 22, 2009 11:29 pm
Re: Party System
i am working on them some now. Am trying to catch up my game for the contest though also.
Re: Party System
Thats awesome to hear! yea i don't blame ya good luck in the contest! thanks again for your post! i should have the system done today or tomorrow. and ill post back the results.
Re: Party System
I ran into a problem.
-With the party system how can the party quest together such as attacking the same creature?
-Also i built my game off of the MMO series so when fighting a certain creature lets say a goblin if another player is attacking that creature then they will be attacking it together, i only wanted that for the party members but dont know how to link the party members, how do i stop this?
Thank You in advance!
-With the party system how can the party quest together such as attacking the same creature?
-Also i built my game off of the MMO series so when fighting a certain creature lets say a goblin if another player is attacking that creature then they will be attacking it together, i only wanted that for the party members but dont know how to link the party members, how do i stop this?
Thank You in advance!
- hallsofvallhalla
- Site Admin
- Posts: 12026
- Joined: Wed Apr 22, 2009 11:29 pm
Re: Party System
couple options here.
1. create a field in the creatures that is called party..if $creatureinfo3['party'] = 1 then set rules to allow multiple damages.
2. create a table called partycreatures that stores the creatures a party is fighting
it is going to be super hard to make this work on a refresh system. You might want to have it query the creature right before it does damage to see if another player already killed it, you ,may also want to create a table called partymessages that store battle messages that feed out to the player so everyone knows whats going on.
partyid
partyleader
message
time
then query where partyid and partyleader equals player then print them out in order. When you attack a create it puts a message in.
1. create a field in the creatures that is called party..if $creatureinfo3['party'] = 1 then set rules to allow multiple damages.
2. create a table called partycreatures that stores the creatures a party is fighting
it is going to be super hard to make this work on a refresh system. You might want to have it query the creature right before it does damage to see if another player already killed it, you ,may also want to create a table called partymessages that store battle messages that feed out to the player so everyone knows whats going on.
partyid
partyleader
message
time
then query where partyid and partyleader equals player then print them out in order. When you attack a create it puts a message in.