RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Fully Automated Tournament System

DevXLX

Sorceror
Some questions:

How can we know if xx amount of players are signed up, when we are not using funding barrel?
I mean, if we want to run it manually, how do I make sure if i make the tournament for 32 players, that I indeed do have 32 people signed in before i click "Start Tournament" ?

Also, what happends if I start it with say 30, when I set min requirement to 32, because I cant see if it reached 32 signups. ? will it crash?

And if players logs out during this tournament, does it throw them out, and in that case, how does it settle the fights with an un-even number like say 31?

Thanks :)

/
 

Jeff

Lord
Milt is away till next week I believe so I will try and help him answer your questions as we are good mates.

DevXLX said:
Some questions:

How can we know if xx amount of players are signed up, when we are not using funding barrel?
I mean, if we want to run it manually, how do I make sure if i make the tournament for 32 players, that I indeed do have 32 people signed in before i click "Start Tournament" ?/

I dont totally know if you can do a running check on how many are signed up, I would have to review milts code. But you may be able todo a [props on the signup book or something to see the current count.

DevXLX said:
Also, what happends if I start it with say 30, when I set min requirement to 32, because I cant see if it reached 32 signups. ? will it crash?/

Nothing the tournament will go according to planned just only with 30 ppl.

DevXLX said:
And if players logs out during this tournament, does it throw them out, and in that case, how does it settle the fights with an un-even number like say 31?
Yes if someone logs out at any given time during the match or during the wait for a match, he/she will be booted from the tournament and if in a match will be the loser then booted.

Milt has built in a system to handle uneven amounts of players in a tournament, you can start a tournament with any number of players even or odd and it will figure itself out. Basically does kind of a wild card event. One player gets picked at random to be placed in the wild card, I believe this person will fight 1+ more times then anyone else, but this is the only efficient way around having a odd number of players.
 

Crowley62

Sorceror
i would like to let this tourney run using the barrel for players to start but when the barrel reaches the set amount and enough have signed up the tourney statrts. When the tourney ends and a player has won the message comes up that the barrel is funded and suign up for tourney. Well no one put any cash in barrel it just stays funded so the tourney never shuts off. Can you fix it so the barrel empties when tourney starts abnd players need to fund it again to start the tourney. It would be great if players can activate the tourney THX
 

milt

Knight
Sorious, thanks for helping everyone out as I have been away.

As of now, there is not any support for displaying the amount of players that are currently in the tournament. I was kind of in a hurry to release it, and I guess that was my fault. In any case, there would be a simple way to do this. Go into MasterTStone.cs and find the lines where it says:
Code:
[CommandProperty( AccessLevel.GameMaster )]
public int ArenaZ
{
        get{ return m_ArenaZ; }
        set{ m_ArenaZ = value; }
}
After this block, you can add something like the following:
Code:
[CommandProperty( AccessLevel.GameMaster )]
public int PlayerCount
{
        get{ if( m_Players != null ) return m_Players.Count; }
}
Something like that would probably work, then you can just [props the stone in game and see how many are signed up.

Anyway, I have to go I will be back on tomorrow. Sorry!
 

Scripture

Wanderer
I really love your work milt, superb job!

But i'm having two things come up for myself, whenever anyone signs up, a asterisk ( This thing "*"), gets added to their name and stays there even after the tournament is over.

Also, after the tournament is over, the fundingbarrel gets hidden, is there anyway to stop this from being hidden so people can start a tournament whenever they like?

I'd really appreciate even a point in the right direction as to what i'd need to change. Sorry i'm not anywhere near your caliber of programming, otherwise i'd of figured it out myself by now!


EDIT: I get the following error when trying to add the change you recommended above for the player count

Code:
RunUO - [www.runuo.com] Version 1.0.0, Build 36918
Scripts: Compiling C# scripts...failed (1 errors, 2 warnings)
 - Warning: Scripts\Customs\A_Li_N's Paintball 1.1.0\PBGameItem.cs: CS0183: (lin
e 196, column 13) The given expression is always of the provided ('Server.Mobile
') type
 - Warning: Scripts\Customs\Samurai Empire\Mobiles\SE Monsters\YomotsuElder.cs:
CS0162: (line 15, column 19) Unreachable code detected
 - Error: Scripts\Milt's Auto Tourney System\Items\MasterTStone.cs: CS0161: (lin
e 115, column 9) 'Server.Items.MasterTStone.PlayerCount.get': not all code paths
 return a value
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.
 

Jeff

Lord
Scripture said:
I really love your work milt, superb job!

But i'm having two things come up for myself, whenever anyone signs up, a asterisk ( This thing "*"), gets added to their name and stays there even after the tournament is over.

Also, after the tournament is over, the fundingbarrel gets hidden, is there anyway to stop this from being hidden so people can start a tournament whenever they like?

I'd really appreciate even a point in the right direction as to what i'd need to change. Sorry i'm not anywhere near your caliber of programming, otherwise i'd of figured it out myself by now!


EDIT: I get the following error when trying to add the change you recommended above for the player count

Code:
RunUO - [www.runuo.com] Version 1.0.0, Build 36918
Scripts: Compiling C# scripts...failed (1 errors, 2 warnings)
 - Warning: Scripts\Customs\A_Li_N's Paintball 1.1.0\PBGameItem.cs: CS0183: (lin
e 196, column 13) The given expression is always of the provided ('Server.Mobile
') type
 - Warning: Scripts\Customs\Samurai Empire\Mobiles\SE Monsters\YomotsuElder.cs:
CS0162: (line 15, column 19) Unreachable code detected
 - Error: Scripts\Milt's Auto Tourney System\Items\MasterTStone.cs: CS0161: (lin
e 115, column 9) 'Server.Items.MasterTStone.PlayerCount.get': not all code paths
 return a value
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.


change it to this
Code:
[CommandProperty( AccessLevel.GameMaster )]
public int PlayerCount
{
        get
        { 
             if( m_Players != null ) 
                 return m_Players.Count; 
             else
                 return 0;
        }
}
 

milt

Knight
Scripture said:
I really love your work milt, superb job!

But i'm having two things come up for myself, whenever anyone signs up, a asterisk ( This thing "*"), gets added to their name and stays there even after the tournament is over.

Also, after the tournament is over, the fundingbarrel gets hidden, is there anyway to stop this from being hidden so people can start a tournament whenever they like?

I'd really appreciate even a point in the right direction as to what i'd need to change. Sorry i'm not anywhere near your caliber of programming, otherwise i'd of figured it out myself by now!


EDIT: I get the following error when trying to add the change you recommended above for the player count

Code:
RunUO - [www.runuo.com] Version 1.0.0, Build 36918
Scripts: Compiling C# scripts...failed (1 errors, 2 warnings)
 - Warning: Scripts\Customs\A_Li_N's Paintball 1.1.0\PBGameItem.cs: CS0183: (lin
e 196, column 13) The given expression is always of the provided ('Server.Mobile
') type
 - Warning: Scripts\Customs\Samurai Empire\Mobiles\SE Monsters\YomotsuElder.cs:
CS0162: (line 15, column 19) Unreachable code detected
 - Error: Scripts\Milt's Auto Tourney System\Items\MasterTStone.cs: CS0161: (lin
e 115, column 9) 'Server.Items.MasterTStone.PlayerCount.get': not all code paths
 return a value
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.

Sorious is correct, what he put will work :)

As for the asteriek thing, that would have nothing to do with anything that I coded, I beleive someone in this thread suggested code to add and that is what makes it have the astereiks. I think, (but am not positive) that it was added in TJoinBookGump.cs, but like I said, it might be something else.

I've been really busy because I am currently moving and I have 4 hockey games this week, along with my Indoor Drumline... very very busy week for me.
 

burento

Wanderer
something that I missed in the serialization of the TFundingBarrel as well... a silly little break.


I noticed you showed where the break was lost on the one fix but you did not mention where an addition to the TFundingBarrel code would fix the repeated tourney starts.

We have an issue now where if we use them the tournaments run back to back forever..
 

burento

Wanderer
Sorious said:
As I understood, that was the idea behind the funding barrel, fill it up to its specified amount and it starts a tournament, I also believe that there is a reward, which is a Tournament Ticket, and the admin of the server needed to setup what it did. I dunno I could be wrong, I havent played with this much since we tested it before release

Please be aware that currently using the funding barrel will make the tourneys spawn back to back without adding more gold.

Which means 3 people can sit back and farm tourney tickets all day.. If you do like we do with rewarding 100k for every ticket it can cause a headache.

So until it gets fixed i think the funding barrel is out of the question.
 

Jeff

Lord
burento said:
Please be aware that currently using the funding barrel will make the tourneys spawn back to back without adding more gold.

Which means 3 people can sit back and farm tourney tickets all day.. If you do like we do with rewarding 100k for every ticket it can cause a headache.

So until it gets fixed i think the funding barrel is out of the question.
I think, but havent tested, that the issue isnt that the bin stays full, but yet it never registers that is needs to be filled again. By this i mean when the bin gets filled up to the specified amount, it registers a true value for full. Then when the tournament empties the bin empties but the value never goes to false.

If you change the this.
Code:
[CommandProperty( AccessLevel.GameMaster )]
		public bool FReady
		{
			get
			{
                return m_FReady;
            }

			set
			{
				m_FReady = value;

				if(value)
				{
					Visible = false;
					Broadcast( "The event barrel has been funded, and a tournament is about to begin." );
				}

				else
				{
					Visible = true;
					Broadcast( String.Format( "The event has finished and the event barrel at {0} ({1}) is now accessible.", this.Location, Region.Find( this.Location, this.Map ).Name ) );
					m_Link.DespawnGates();
				}
			}
		}

To this
Code:
[CommandProperty( AccessLevel.GameMaster )]
		public bool FReady
		{
			get
			{
                if( FCurrent >= FMax )
                    return true;
                else
                    return false;
            }

			set
			{
				m_FReady = value;

				if(value)
				{
					Visible = false;
					Broadcast( "The event barrel has been funded, and a tournament is about to begin." );
				}

				else
				{
					Visible = true;
					Broadcast( String.Format( "The event has finished and the event barrel at {0} ({1}) is now accessible.", this.Location, Region.Find( this.Location, this.Map ).Name ) );
					m_Link.DespawnGates();
				}
			}
		}

I believe this will solve your problem. Again tho I did not test this yet.

this edit needs to be done in TFundingBarel.cs
 

burento

Wanderer
I am sorry for being dumb. I am not C++ savy but i can figure out code from example. I have looked through the codes and made changes to get the fel gate warning off and i added a few gate locations and changed some of the wording.

I want to make the ticket reward into a 100k check. We have a stationary tourney and it is player run from the funding barrel. I want to have the reward be a bank check for 100k. I was wondering if you think the code below would work.

This is my first time every altering a code and i added the worth = 100000 and i figured it might work that way but wanted to clarify.



Code:
using System;
using Server;
using Server.Items;
using Server.Mobiles;
using Server.Gumps;

namespace Server.Items
{
	public class BankCheck : Item
	{
		[Constructable]
		public BankCheck() : base( 0x14F0 )
		{
			Movable = true;
			Worth = 100000
			LootType = LootType.Blessed;
			Hue = 52;
		}

		public BankCheck( Serial serial ) : base( serial )
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int)0 );
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
		}
	}
}
 

sordican

Sorceror
@ Burento: I doubt that would work, as the class BankCheck is already present. You need to make a new class for it if you want to make it a new item. (for use in other scripts or w/e)

However you can add something like this in the section where it distributes rewards:

Code:
  BankCheck tourneycheck = new BankCheck();
     tourneycheck.Worth = 100000;
  winner.AddtoBackpack( tourneycheck );

If you're gonna make a new class for Tourneychecks and can't make it work, please post your attempts in the script support forum so this thread will be kept for Milt and his Tourney-script.
 

burento

Wanderer
i think i completely understand what you are saying i should do.. it is just how.. hehehehe..

Code:
winner.AddToBackpack( new TourneyBankCheck();

Code:
using System;
using Server;
using Server.Items;
using Server.Mobiles;
using Server.Gumps;

namespace Server.Items
{
	public class TourneyBankCheck : Item
	{
		[Constructable]
		public TourneyBankCheck() : base( 0x14F0 )
		{
			Movable = true;
			Worth = 100000
			LootType = LootType.Blessed;
			Hue = 52;
		}

		public TourneyBankCheck( Serial serial ) : base( serial )
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int)0 );
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
		}
	}
}
Also i think you have to change TourneyTicket.cs to TourneyBankCheck.cs

Wont post about it again if this wont work. sorry but many people ahve asked for this on here and if we can figure it out then about 10 people will be thrilled by it.
 

Jeff

Lord
burento said:
i think i completely understand what you are saying i should do.. it is just how.. hehehehe..

Code:
winner.AddToBackpack( new TourneyBankCheck();

Code:
using System;
using Server;
using Server.Items;
using Server.Mobiles;
using Server.Gumps;

namespace Server.Items
{
	public class TourneyBankCheck : Item
	{
		[Constructable]
		public TourneyBankCheck() : base( 0x14F0 )
		{
			Movable = true;
			Worth = 100000
			LootType = LootType.Blessed;
			Hue = 52;
		}

		public TourneyBankCheck( Serial serial ) : base( serial )
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int)0 );
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
		}
	}
}
Also i think you have to change TourneyTicket.cs to TourneyBankCheck.cs

Wont post about it again if this wont work. sorry but many people ahve asked for this on here and if we can figure it out then about 10 people will be thrilled by it.
Ya, many have asked and thanks for posting this, I know milt left this part open on purpose so the admins to add their own rewards
 

milt

Knight
Also, instead of making a new object, etc... you could just do this:

Code:
winner.AddToBackpack( new BankCheck( 100000 ) );

There's no need to make a new item and stuff :)
 

Asmir3

Sorceror
i think on next release if you have time for this you should make so staff can set the prize for the tournament on the stone so it can be different prizes each time
milt said:
Also, instead of making a new object, etc... you could just do this:

Code:
winner.AddToBackpack( new BankCheck( 100000 ) );

There's no need to make a new item and stuff :)
 

Jeff

Lord
Asmir3 said:
i think on next release if you have time for this you should make so staff can set the prize for the tournament on the stone so it can be different prizes each time
dunno how feasable that would be but the whole prize thing was left open to the server admins to create their own prize

milt said:
It is currently set up so the winner gets a 'Tourney Ticket'. You may modify this accordingly, or you can let players trade them in for prizes, etc.
 

noob2

Wanderer
man this is great you should consider implimenting 1vs1 and 2vs2 dualing like challenge game has since your code is much smoother bug free
 

Jeff

Lord
noob2 said:
man this is great you should consider implimenting 1vs1 and 2vs2 dualing like challenge game has since your code is much smoother bug free
Thats all planned for the next big release i believe
 
Top