nol 0 Report post Posted February 13, 2008 Ok, the title is a little...ya, anyways, I'm in desprate need for somebody to help me with this script im trying to write (dunno even where to start) I know exactly what i want, so ill tell you. But what I want to know if this could easily be done, and if so, how?Ok, this is exactly what I wantA clan is created (finished this part of the script)Now, the leader of the clan, can challenge a clan (this part I can do)The leader of the other clan, can accept the challenge, when this is done, a randomization code is started. It randomizes two things, Map played on, and Gametype. Now, this is not actually starting a game or w/e. THis is for a halo 3 clan thing. It chooses from the gametype database i made, which gametype and which map. Then it displays You will play Round 1: [gametype] on [map]Round 2: [gametype] on [map]Round 3: [gametype] on [map]Now, I really don't need the random gametype part, as itll be likeRound 1: Team slayer on [random map]etc, but for round 3 i'll need the random gametype. I'll probably keep the info on a table or something in mysql or w/e, and ill try and delete it when I can or something so ya. Is there anyway I can do this? Share this post Link to post Share on other sites
KansukeKojima 0 Report post Posted February 14, 2008 http://forums.xisto.com/topic/54092-php-random-titles-learn-to-create-neat-o-random-titles/I believe that this should cover it... of course, you'll have to modify some of the general pieces of it to suit your needs... but on the whole, the idea itself should work.... I mean... you'll have to add a file writing section to the code, etc... you probably get the idea. Share this post Link to post Share on other sites
nol 0 Report post Posted February 14, 2008 hmm, do you think id be able to do a insert command? like...i would randomize it, and then, it would insert it into the database? such as a registration code would? (not talking about login or anything) like do you get what I mean? Im wondering if that would/could even work. It would be somewhat complicated though. Not this portion, but displaying the information, however i think it wouldnt be too hard. I mean, it would just enter the data into rows right? hmm..thank you for that if someone just has a script or could tell me what functions I could use to place this information into mysql, that would be great! Share this post Link to post Share on other sites
jlhaslip 4 Report post Posted February 14, 2008 Rough outline of a Normalized Database Schema I'd look at for this would be something along these lines" Table - Map map id map name map info and descriptionTable - Gametype game id game name game info and description Table - Clans clan id name description leader name email wins lossesTable - Challenges challenge id clan1 name clan2 name clan1 issue challenge date/time clan2 accept challenge date/timeTable - Games game id clan1 id clan2 id challenge game number game type game map score clan1 score clan2 define the maps and gametypesdefine the ClansClans issue challengesClans accept challengesRandomly select 3 gametypes and maps --> this is where you need the randomization script play the challenge and record the scoresUpdate the wins/losses Would probably not need a whole bunch more than this to Admin the process, but some of the Reports might get a little hairy. Compound Joins, etc, but should be doable. Share this post Link to post Share on other sites
nol 0 Report post Posted February 14, 2008 (edited) hmm the biggest thing im having a trouble grasping is, would it be easier to have one database, for the whole site, and multiple tables, or many databases, for more organization. If i were to do the second one, would it work to have transfers from databases, and to connect to two different databases on one thing? I think I'll go towards the first one, where theres all the user info, clan info etc. Also, I can't grasp how I will show like the members in a clan. I don't really know at all how I'd do that, I like your set up jl, I might go with that, but I just don't see how I could work the members in a clan in. Unless I'd create a new table for every clan, which in that case that would take a lot of database space wouldn't it?Also, the system will run on a HONESTY system. Where, both teams report the scores after all 3 matches have been played. Clan 1Round one: (scores)Round Two: (scores)Round three: (scores)Clan 2same thingif something is clashing like the scores are different, a email will be sent (this I can probably do) and a administrator checks bungie.net for true game records. If one clan doesn't do the scores in within two hours of the first clan to put theirs in, it automatically goes as a win for the first team (or basically whatever they got)Hopefully this might be a little more detailed when it comes to the outcome of a match. However, for the clan challenges. Basically, on the forums they post a topic, another clan accepts, and then the clan sends the other clan a clan invitation. The invitation will be a generated message, they say what time they want etc, and the other clan accepts. The clan challenge will show up on both clan's recent games, however outcome will be a - . Until the game is done, and over with. Then itll say W for win L for loss. When the clans do it, the same thing will show up next to recent games, next to the - itll say Details, itll show the following somewhat:Round one: [Gametype] on [map] - [outcome here]Round two: etcRound three: etcand basically that. Later I'll probably add where it deletes this info after 48 hours, and puts it in their record etc. Does this help you ? Edited February 14, 2008 by nol (see edit history) Share this post Link to post Share on other sites
KansukeKojima 0 Report post Posted February 14, 2008 another method.... depending on how complicated you need it to be... you could use flat-files... unless it needs to be really complicated... then don't use them. Share this post Link to post Share on other sites
jlhaslip 4 Report post Posted February 14, 2008 simply add a Member Table to the above layout with their Clan id in their profile Share this post Link to post Share on other sites
nol 0 Report post Posted February 14, 2008 simply add a Member Table to the above layout with their Clan id in their profileoooh thats sneeky little man....never thought of that, so what you mean, is like I add a table like...clanmembersidclanidusernameranketc?hmm thanks hopefully i can get this randomization script working then. Haven't really tried it just yet. Share this post Link to post Share on other sites
jlhaslip 4 Report post Posted February 14, 2008 yes, like that.google on datbase normalization to see how to create Tables properly for Databases.Information should only be in a database once. notice that the clan Tables do not have a list of its members? the clanid is in the members Table row, so for each clan, just use the clanid to find its members. if the same information is in two places, you will likely have a problem ensuring the data integrity and also, duplicate information is avoided, so space is reduced. Share this post Link to post Share on other sites
nol 0 Report post Posted February 14, 2008 what do you think about like...members though like. Lets say, i have a usergroup table, and a clanmember title. Do you think it would be alright for this part, if I were to use usernames under the clan members, yet have a users table too for registered users? would that make much sense? Share this post Link to post Share on other sites
jlhaslip 4 Report post Posted February 14, 2008 yes, that would work.have a field for clanid if they belong to a Clan, blank(or minus1) if they are an observer. Share this post Link to post Share on other sites