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!

PaintBallGame v1.0

Clarke76

Wanderer
PaintBallGame v1.3 (Updated 3-28)

Summary:
This is the old Paintball Game that I orginally had submitted. Up to four-team game. For every three hits you recieve, an armor piece gets colored. Once all your armor is painted you get auto ejected. Enjoy and have fun.

Updated: Serialize/Deserialize no longer needed. Still need to add to PlayerMobile. Armor updated so Str/Dex(equip requirment), and Weight wont affect game.

Installation:
Read the included ReadMe.TXT with the download. It will explain all. Some editing of the PlayerMobile is required.

EDIT:
This was missing in the readme file of the most recent upload:
Code:
public enum TeamType
	{
		None, One, Two, Three, Four
	}


There is a slight bug where if you do not remove the players from the game the correct way, two hours later all their items will be removed. Here is a small update to fix that problem. I'm not re-uploading the file since it is not a must bug fix. So I will leave it up to you.

In PaintBallGame.cs:
Find: "public void RemoveArmor( PlayerMobile from )"
And replace it with:
Code:
public void RemoveArmor( PlayerMobile from )
	{
		Container mobilePack = from.Backpack; 
		ArrayList equipitems = new ArrayList(from.Items);
		foreach (Item equiped in equipitems) 
		{ 
			if ((equiped.Layer != Layer.Bank) && (equiped.Layer != Layer.Backpack) && (equiped.Layer != Layer.Hair) && (equiped.Layer != Layer.FacialHair) && (equiped.Layer != Layer.Mount)) 
			{ 
				if( equiped is TeamBow || equiped is TeamArrow || equiped is PaintBallLegs 
					||equiped is PaintBallArms || equiped is PaintBallChest || equiped is PaintBallGloves 
					|| equiped is PaintBallGorget || equiped is PaintBallHelm )
				{
					mobilePack.DropItem( equiped );
				}
			} 
		}	  
		ArrayList finalitems = new ArrayList( mobilePack.Items );
		foreach (Item pack in finalitems) 
		{ 
			if( pack is TeamBow || pack is TeamArrow || pack is PaintBallLegs 
				||pack is PaintBallArms || pack is PaintBallChest || pack is PaintBallGloves 
				|| pack is PaintBallGorget || pack is PaintBallHelm )
			{
				pack.Delete();
			}
		}
	}
 

Attachments

  • paintball.zip
    9.8 KB · Views: 1,705

SV-randy

Wanderer
Clarke76 said:
Summary:
This is the old Paintball Game that I orginally had submitted. Up to four-team game. For every three hits you recieve an armor piece gets colored. Once all you armor is painted you get auto ejected. Enjoy and have fun.


Description:


Installation:
Read the included ReadMe.TXT with the download. It will explain all. Some editing of the PlayerMobile is required.



Ive been looking for one of these but one prob when i run it i get a 'Teamtype' could not be found error.... fyi sorry i dont know how to post errors yet (imma newb)
 

Meth

Wanderer
Edit Playermobile

You have to edit your playermobile.cs with the teamtypes as he add'ed in his Readme.txt I just cant add it without a bunch of errors coming up I think I am either add'ing it in the wrong spot or I have to serilize and deserilize but I dont know how :(
 

SV-randy

Wanderer
Meth said:
You have to edit your playermobile.cs with the teamtypes as he add'ed in his Readme.txt I just cant add it without a bunch of errors coming up I think I am either add'ing it in the wrong spot or I have to serilize and deserilize but I dont know how :(


Yea you have to deserilize and serilize but thats soo foreign to me its not even funny. :(
 

sunfishdog

Wanderer
Meth said:
You have to edit your playermobile.cs with the teamtypes as he add'ed in his Readme.txt I just cant add it without a bunch of errors coming up I think I am either add'ing it in the wrong spot or I have to serilize and deserilize but I dont know how :(

Same here.....can someone maybe explain how to do this??
 

Crack177

Wanderer
This is almost one of the easiest things to do, since it is in ever script almost.
PHP:
		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 try looking here. It has exactly what you need. Before you ask always look. Most of the time there is something on it.
How to Serialize and Deserialize
 

SV-randy

Wanderer
Crack177 said:
This is almost one of the easiest things to do, since it is in ever script almost.
PHP:
		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 try looking here. It has exactly what you need. Before you ask always look. Most of the time there is something on it.
How to Serialize and Deserialize


Thanx for the help and see thats the problem the same thing im having now... I #1 knew what to search for but #2 when i found it i didnt know what to do with it what you just wrote reminds me of when i first started learning french so i say to you je ne compre pas? Whats that mean hehe and how do i incorporate it into making the paintball work?
 

Clarke76

Wanderer
serialize/deserialize

To be honest, you really dont even have to serialize/serialize this. And now thinking about it, might be better if you dont. Instead add an eventsink for onlogin which will set everything to null and teamtype to none. Then do a check for any paintball armor and weapons and eject them to a safe area. This will prevent people from logging off and waiting till the fighting is almost done and loggin back in.

I've updated the game to include this. Just re-download and install. You will still need to add stuff to you PM but serialization is no longer needed. There is one extra thing added the PM that wasnt before. Its in the read me. I also fix it so there is no str/dex requirment and weight is 1stone. Just remember player is ejected once they logout. Logout takes 5mins unless in an instant logout area.
 

surgut

Wanderer
I have such error:

Eroor: scripts\custom\paintballgame.cs: CS0246: (line 32,colum 13) The type or namespace name 'TeamType' could not be found (are you missing a using directive or an assembly reference?)

i cant understand what is wrong...
 

Clarke76

Wanderer
surgut said:
I have such error:

Eroor: scripts\custom\paintballgame.cs: CS0246: (line 32,colum 13) The type or namespace name 'TeamType' could not be found (are you missing a using directive or an assembly reference?)

i cant understand what is wrong...

You arnt adding the required info to the PlayerMobile. Read the README.txt it tell you what to add. But lots of people for some reason arnt getting the idea. So your player mobile should look something like this. Note: this is only a section of it.
Code:
using System;
using System.Collections;
using Server;
using Server.Misc;
using Server.Items;
using Server.Gumps;
using Server.Multis;
using Server.Engines.Help;
using Server.ContextMenus;
using Server.Network;
using Server.Spells;
using Server.Spells.Fifth;
using Server.Spells.Seventh;
using Server.Targeting;

namespace Server.Mobiles
{
	[Flags]
	public enum PlayerFlag // First 16 bits are reserved for default-distro use, start custom flags at 0x00010000
	{
		None				= 0x00000000,
		Glassblowing		= 0x00000001,
		Masonry				= 0x00000002,
		SandMining			= 0x00000004,
		StoneMining			= 0x00000008,
		ToggleMiningStone	= 0x00000010,
		KarmaLocked			= 0x00000020,
		AutoRenewInsurance	= 0x00000040,
		UseOwnFilter		= 0x00000080,
		PublicMyRunUO		= 0x00000100,
		PagingSquelched		= 0x00000200
	}

	public enum NpcGuild
	{
		None,
		MagesGuild,
		WarriorsGuild,
		ThievesGuild,
		RangersGuild,
		HealersGuild,
		MinersGuild,
		MerchantsGuild,
		TinkersGuild,
		TailorsGuild,
		FishermensGuild,
		BardsGuild,
		BlacksmithsGuild
	}
	public enum TeamType
	{
		None, One, Two, Three, Four
	}

	public class PlayerMobile : Mobile
	{
		private class CountAndTimeStamp
		{
			private int m_Count;
			private DateTime m_Stamp;

			public CountAndTimeStamp()
			{
			}

			public DateTime TimeStamp { get{ return m_Stamp; } }
			public int Count 
			{ 
				get { return m_Count; } 
				set	{ m_Count = value; m_Stamp = DateTime.Now; } 
			}
		}

		private DesignContext m_DesignContext;

		private NpcGuild m_NpcGuild;
		private DateTime m_NpcGuildJoinTime;
		private TimeSpan m_NpcGuildGameTime;
		private PlayerFlag m_Flags;
		private int m_StepsTaken;
		private TeamType m_Team = TeamType.None;
		private int m_PaintHits = 0;
		private PaintBallGame game;

		public PaintBallGame PaintBall{ get{ return game;} set{ game = value;}}
		[CommandProperty(AccessLevel.Counselor)]
		public int PaintBallHits
		{
			get{return m_PaintHits;}
			set{m_PaintHits = value;}
		}

		[CommandProperty( AccessLevel.GameMaster ) ]
		public TeamType Team
		{
			get { return m_Team; }
			set { m_Team = value; }
		}
		public int GetPaintPoints(){ return m_PaintHits; }
		public void AddPaintHit(){ m_PaintHits++; }

		public int StepsTaken
		{
			get{ return m_StepsTaken; }
			set{ m_StepsTaken = value; }
		}
 

SV-randy

Wanderer
Yea i think all of us outside of scripting are confused ull prob have to post the whole playermobile.cs bc i seem to be putting the team type etc in the wrong spots =/ sorry for being dumb
 

Clarke76

Wanderer
SV-randy said:
Yea i think all of us outside of scripting are confused ull prob have to post the whole playermobile.cs bc i seem to be putting the team type etc in the wrong spots =/ sorry for being dumb


I'm not posting the entire PM. What I have posted there is all you need. That IS the PM and what you need in it up to a certain section. Just copy and paste up to StepsTaken. If you can't figure that out, I cant help you out anymore :/
 

SV-randy

Wanderer
Clarke76 said:
I'm not posting the entire PM. What I have posted there is all you need. That IS the PM and what you need in it up to a certain section. Just copy and paste up to StepsTaken. If you can't figure that out, I cant help you out anymore :/


Sorry about being obnoxious i got it to work the people on my shard were very anxious to play. But however now my problem is getting the game going. I get the stone into the shard i the create the stone i dbl click it it says game had started so.. i do it again and go to props this time and set it to active(?) but then it says stone locations not set. I set team dest exit dest and twoteam what did i do wrong. Btw i appriciate this script it adds high playability to shards.
 

SV-randy

Wanderer
SV-randy said:
Sorry about being obnoxious i got it to work the people on my shard were very anxious to play. But however now my problem is getting the game going. I get the stone into the shard i the create the stone i dbl click it it says game had started so.. i do it again and go to props this time and set it to active(?) but then it says stone locations not set. I set team dest exit dest and twoteam what did i do wrong. Btw i appriciate this script it adds high playability to shards.


EDIT: sorry about being so moronic i got it but the green team has all its armor but one piece colored what file holds that so i can fix it?
 
B

badboy

Guest
thanks for re-submitting this wonderfull script Clark76, Great work. Nice update also. i still use nox's point system on my shard, would it be possible to re-submit your point stone and challenge game (points) please? thanks in advance.
 

SV-randy

Wanderer
badboy said:
thanks for re-submitting this wonderfull script Clark76, Great work. Nice update also. i still use nox's point system on my shard, would it be possible to re-submit your point stone and challenge game (points) please? thanks in advance.


Have you tried it out? Did you get the same problem with the green team aka team 3 they seem to have only one piece of armor not already "painted"
 

Clarke76

Wanderer
badboy said:
thanks for re-submitting this wonderfull script Clark76, Great work. Nice update also. i still use nox's point system on my shard, would it be possible to re-submit your point stone and challenge game (points) please? thanks in advance.

Yeah, I need to go threw them and clean em up a bit. Wanna fix some bugs I found also. But I will sub. these in a couple days.
 
Top