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!

A_Li_N's Paintball

irishdog

Sorceror
also got this error when a game ended.
Code:
Server Crash Report
===================

RunUO Version 1.0.0, Build 36918
Operating System: Microsoft Windows NT 5.1.2600.0
.NET Framework: 1.1.4322.573
Time: 8/7/2005 10:32:08 AM
Mobiles: 1245
Items: 58199
Clients:
- Count: 11
+ 68.118.4.226: (account = Trae141988) (mobile = 0xEE 'Zyrax')
+ 83.71.101.242: (account = a) (mobile = 0x7F 'Admin irishdog')
+ 172.193.63.91: (account = iskavomit) (mobile = 0xE3 'Iskavomit')
+ 24.132.232.37: (account = fireblade) (mobile = 0x27E 'paladin of evil')
+ 216.45.139.187: (account = camel) (mobile = 0xB00 'Avenger')
+ 84.10.59.166: (account = pirate) (mobile = 0x8E 'Pirate')
+ 68.85.84.186: (account = goblin768) (mobile = 0x57E 'Devil')
+ 81.213.65.93: (account = baltazar) (mobile = 0x432 'Baltazar')
+ 84.237.173.14: (account = Rasulens) (mobile = 0xD4A 'Rasulens')
+ 69.132.200.28: (account = Shitz) (mobile = 0x3E8 'tommy')
+ 4.252.193.39: (account = killa) (mobile = 0x2A 'Tayo')

Exception:
System.MissingMethodException: No parameterless constructor defined for this object.
   at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at Server.Games.PaintBall.PBGameItem.GivePrizes(Mobile pm)
   at Server.Games.PaintBall.PBGameItem.EndGame()
   at Server.Games.PaintBall.PBTimer.OnTick()
   at Server.Timer.Slice()
   at Server.Core.Main(String[] args)
 

A_Li_N

Knight
Alis said:
what about during the game the players log off and he logs on he doesnt get hited by other players.. this is a bug
I'll take a look at it when I get back home :) Not a bug, just an overlooked feature.


irishdog said:
Crashed when you try move someone who enters the game and the game hasnt started yet.
Code:
System.NullReferenceException: Object reference not set to an instance of an object.
   at Server.Games.PaintBall.PBGameItem.OnLocationChange(Point3D oldLoc)
   at Server.Item.MoveToWorld(Point3D location, Map map)
   at Server.Targets.MoveTarget.OnTarget(Mobile from, Object o)
   at Server.Targeting.Target.Invoke(Mobile from, Object targeted)
   at Server.Network.PacketHandlers.TargetResponse(NetState state, PacketReader pvSrc)
   at Server.Network.MessagePump.HandleReceive(NetState ns)
   at Server.Network.MessagePump.Slice()
   at Server.Core.Main(String[] args)
Looks like you tried moving the actual Game Item...I'll take a look at this when I get home.


irishdog said:
also got this error when a game ended.
Code:
System.MissingMethodException: No parameterless constructor defined for this object.
This looks to be that you tried giving a bank check to the winners...I believe I stated that this could not be done. If this is not the case, you probably tried giving something else that requires a parameter to be created...(amount, name, etc)
 

A_Li_N

Knight
Tannis said:
I downloaded this the other day, made it crash and was able to reproduce it, but I think it's more our shards problem then the script's problem. We added a token check to the prizes list, clicked start game, someone joined it, and we clicked start again. When it tried to (I assume) add the token check to the winning players pack, it crashed. We clicked start 2 times because we didn't know how to use it yet. I think we got it figured out by now. This is a great script and I especially love the skill chip. I've been wanting something like that for sooo long for events, and the whole time this system was here under my nose :)
This is also probably the same problem as the bank check...if I feel like it and I have time, I'll see what I can do about th problem of the parameter-less creation of things.
 

Tannis

Knight
Noo, it's ok. I didn't realize that you had said checks wouldn't work. I didn't read the thread all the way through hehe. I do know that if you have more than 1 PBGameItem in the world it will crash the shard. I had one in my pack and logged on my shard as they were in the middle of playing Paintball, and it crashed. So I tried again to see if it was me, and it was :D That's no biggie though since you just need to make sure there's only one in the world.
 

googlebite

Wanderer
Is This Script Finished Or Somthing Because Im Geting Errors?

RunUO - [www.runuo.com] Version 1.0.0, Build 36918
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
- Error: Scripts\Misc\Paintball 2\PaintBallEquipment.cs: CS0101: (line 61, colu
mn 15) The namespace 'Server.Games.PaintBall' already contains a definition for
'PaintBall'
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.


_______________________________________________________________________________________


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


namespace Server.Games.PaintBall
{
	public class PaintBallArmor : BaseArmor
	{
		public override int BasePhysicalResistance{ get{ return 0; } }
		public override int BaseFireResistance{ get{ return 0; } }
		public override int BaseColdResistance{ get{ return 0; } }
		public override int BasePoisonResistance{ get{ return 0; } }
		public override int BaseEnergyResistance{ get{ return 0; } }
		public override int InitMinHits{ get{ return 3; } }
		public override int InitMaxHits{ get{ return 3; } }
		public override int AosStrReq{ get{ return 0; } }
		public override int OldStrReq{ get{ return 0; } }
		public override int OldDexBonus{ get{ return 0; } }
		public override int ArmorBase{ get{ return 0; } }
		public override ArmorMaterialType MaterialType{ get{ return ArmorMaterialType.Plate; } }
		
		public PaintBallArmor( int hue, int itemid, Layer layer ) : base( itemid )
		{
			Name = "Paintball Armor";
			Hue = hue;
			Layer = layer;
			Movable = false;
			Weight = 1;
			DexRequirement = 0;
			StrRequirement = 0;
			IntRequirement = 0;
		}

		public override int OnHit( BaseWeapon weapon, int damageTaken )
		{
			if( weapon is PaintBallWeapon )
				HitPoints -= 1;
			if( HitPoints == 0 )
				Delete();
			return 0;
		}

		public PaintBallArmor( Serial serial ) : base( serial )
		{
		}
		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( (int) 0 ); // version
		}
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
		}
	}


	public class PaintBall : Item
	{
		[Constructable]
		public PaintBall( int hue ) : this( hue, 1 )
		{
		}

		[Constructable]
		public PaintBall( int hue, int amount ) : base( 3962 )
		{
			Name = "Paintballs";
			Hue = hue;
			Stackable = true;
			Weight = .1;
			Amount = amount;
			Movable = false;
		}

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

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( (int) 0 ); // version
		}
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
		}
	}


	public class PaintBallWeapon : BaseRanged
	{
		public override int EffectID{ get{ return 3962; } }
		public override Type AmmoType{ get{ return typeof( PaintBall ); } }
		public override Item Ammo{ get{ return new PaintBall( this.Hue ); } }
		public override int AosStrengthReq{ get{ return 0; } }
		public override int AosMinDamage{ get{ return 0; } }
		public override int AosMaxDamage{ get{ return 0; } }
		public override int AosSpeed{ get{ return 15; } }
		public override int OldStrengthReq{ get{ return 0; } }
		public override int OldMinDamage{ get{ return 0; } }
		public override int OldMaxDamage{ get{ return 0; } }
		public override int OldSpeed{ get{ return 20; } }
		public override int DefMaxRange{ get{ return 10; } }
		public override WeaponAnimation DefAnimation{ get{ return WeaponAnimation.ShootBow; } }

		public PaintBallGameItem m_PBGI;

		public PaintBallWeapon( int hue, PaintBallGameItem pbgi ) : base( 5042 )
		{
			Name = "A Paintball Gun";
			Hue = hue;
			Weight = 1;
			Movable = false;
			DexRequirement = 0;
			StrRequirement = 0;
			IntRequirement = 0;
			Layer = Layer.TwoHanded;

			m_PBGI = pbgi;
		}

		public override TimeSpan OnSwing( Mobile attacker, Mobile defender )
		{
			if ( DateTime.Now > (attacker.LastMoveTime + TimeSpan.FromSeconds( 1.0 )) )
			{
				if( OnFired( attacker, defender ) )
					if( CheckHit( attacker, defender ) )
						OnHit( attacker, defender );
			}
			return GetDelay( attacker );
		}

		public override bool OnFired( Mobile attacker, Mobile defender )
		{
			if( !m_PBGI.Active )
			{
				attacker.SendMessage( "The game has not started yet!" );
				return false;
			}

			if( defender.ChestArmor != null && defender.ChestArmor is PaintBallArmor )
			{
				if( defender.ChestArmor.Hue == Hue )
				{
					attacker.SendMessage( "Do not attack your own team!" );
					return false;
				}
			}

			Container pack = attacker.Backpack;

			if( attacker.Player && (pack == null || !pack.ConsumeTotal( AmmoType, 1 ) ) )
				return false;

			attacker.MovingEffect( defender, EffectID, 18, 1, false, false, Hue, 3 );
			return true;
		}

		public override void OnHit( Mobile attacker, Mobile defender )
		{
			PlaySwingAnimation( attacker );
			PlayHurtAnimation( defender );
			attacker.PlaySound( GetHitAttackSound( attacker, defender ) );
			defender.PlaySound( GetHitDefendSound( attacker, defender ) );

			int damage = AbsorbDamage( attacker, defender, 0 );
		}

		public override void OnMiss( Mobile attacker, Mobile defender )
		{
		}

		public override int AbsorbDamage( Mobile attacker, Mobile defender, int damage )
		{
			PaintBallArmor armor;

			if( defender.NeckArmor != null )
				armor = defender.NeckArmor as PaintBallArmor;
			else if( defender.HandArmor != null )
				armor = defender.HandArmor as PaintBallArmor;
			else if( defender.ArmsArmor != null )
				armor = defender.ArmsArmor as PaintBallArmor;
			else if( defender.HeadArmor != null )
				armor = defender.HeadArmor as PaintBallArmor;
			else if( defender.LegsArmor != null )
				armor = defender.LegsArmor as PaintBallArmor;
			else if( defender.ChestArmor != null )
				armor = defender.ChestArmor as PaintBallArmor;
			else
			{
				//--End Of Game-------------------------------------------
				//defender.Location = m_PBGI.ExitDest;
				attacker.SendMessage( "You have just removed that player from the game!" );
				m_PBGI.Delete();
				BankBox bank = attacker.BankBox;
				//bank.DropItem( new Token() );
				bank.DropItem( new BankCheck( 1000 ) );
				//attacker.SendMessage( "A token has been placed in your bankbox, congradulations!" );
				attacker.SendMessage( "A bank check has been placed in your bankbox, congradulations!" );
				return 0;

			}
			damage = armor.OnHit( this, damage );
			return 0;
		}

		/*public void EndOfGame()
		{
			foreach( PlayerMobile pm in Players )
			{
				PlayerMobile player = pm as PlayerMobile;

				pm.SendMessage( "The game is over, removing all items" );
				pm.Location = ExitDest;
				pm.Map = MapDest;
				pm.Hidden = true;
				pm.Warmode = false;
				pm.Team = TeamType.None;
				m_Active = false;
				ArrayList toDelete = new ArrayList();
				foreach( Item item in pm.Items )
					if( item is PaintBallArmor || item is PaintBallWeapon || item is PaintBall )
						toDelete.Add( item );

				foreach( Item item in toDelete )
					item.Delete();

			}
			Players.Clear();

			foreach( PlayerStorage ps in StoredPlayerStats )
				ps.Restore();
			StoredPlayerStats.Clear();

			base.OnAfterDelete();
		}*/

		public PaintBallWeapon( Serial serial ) : base( serial )
		{
		}
		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( (int) 0 ); // version
			writer.Write( m_PBGI );
		}
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
			switch( version )
			{
				case 0:
				{
					m_PBGI = reader.ReadItem() as PaintBallGameItem;
					break;
				}
			}
		}
	}
}
 

A_Li_N

Knight
googlebite said:
RunUO - [www.runuo.com] Version 1.0.0, Build 36918
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
- Error: Scripts\Misc\Paintball 2\PaintBallEquipment.cs: CS0101: (line 61, colu
mn 15) The namespace 'Server.Games.PaintBall' already contains a definition for
'PaintBall'
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
That error means that you already have a PaintBall script somewhere in your server.
 
Great Script!!!

Hey Id just like to say this is a really impressive script. I just did a test run on my backup shard and it ran beautifully. I wish I was as talented as you A_Li_N :eek:)

I did have one question though. I didnt know how many people per team it took to get the game started, so I started making account after account to try and hit that limit ( thinking the game started after each team reached a certian amount of players ) Well when I hit 13 open clients ( 6 on each team and 1 Admin ) my PC started to bog down and I started thinking maybe this wasnt my problem.

Then, like 90 percent of peoples problems, I realized I was overlooking the start button. But I realized none of the accounts that have player access level could start the game, only an admin. Is there something Im missing or is that the way it is?

The reason I ask is cause I wanted this system to kinda be self sufficiant. Something to keep players occupied while no staff were available for events and what not. Well if a staff member has to be there in order to start the match, it kinda defeats the purpose I was wanting it for.

Does this have a feature to autostart after each team has reached a certain ammount of players. or if not could you give me kind of a nudge in the right direction on how to implament this myself. I havent actually had a chance to crack open the script's and thumb through them due to classes and work, but once I get a few moments Ill check and see if I can find the answer myself. Just figured Id ask this Q to see if there was an easy fix instead of the long and drawn out way Im sure Id try and use *smiles*

Anyways thanks again, one of the better scripts on these forums, always fun to see someone come out with a totally original idea, and execute it perfectly *smiles*

Father time

Dont piss me off...
Im running out of places to hide the bodies...
 

A_Li_N

Knight
First off...advertising your shard is a no-no unless you subscribed :)

Second, the system only starts when the admin starts it...To change this feature...best place to start would be the OnDoubleClick method in PBGameItem.cs and go from there. I don't know how much work would be needed to make it how you want it, but it's possible :)
 
Very good, thanks for your time.

Sorry, wasnt meaning to advertise, wont happen again :eek:P And Thanks, Ill get crackin and let ya know what I come up with, either way, very nice script. I appriciate your time, take care and godbless

Father Time

**************************************
Dont piss me off...
Im running out of places to hide the bodies...
**************************************
 

nekron_14

Sorceror
Hey me and a friend just tried out ur script.... its good but we both agree it takes WAYYYYY too long for a person to die.... we are both avid paintballers and its too unrealistic.... i like the script not complainin but how i can i make it so people die fast? (im not a good scripter at all)
 

A_Li_N

Knight
nekron_14 said:
Hey me and a friend just tried out ur script.... its good but we both agree it takes WAYYYYY too long for a person to die.... we are both avid paintballers and its too unrealistic.... i like the script not complainin but how i can i make it so people die fast? (im not a good scripter at all)
*Digs through his posted scripts*
:) Give me a couple minutes and I'll see what I can come up with.
 

A_Li_N

Knight
PBEquipment.cs
Lines 25 and 26.

Code:
		public override int InitMinHits{ get{ return 3; } }
		public override int InitMaxHits{ get{ return 3; } }
These are the 'hitpoints' of the pieces of armor...each piece has 3 hit points. Each player gets a helmet, gorget, chest, arms, legs and gloves. 6X3 = 18 hits to be 'killed'. Easiest way to reduce this is to put those two numbers to 1 or 2. If that's still too much, you'll have to take out armor pieces.
 

Corbo6969

Wanderer
It would be a nice update if you made the min and max hits customizable in game. Like [add paintballstone (minhits) (maxhits).
 

A_Li_N

Knight
I'll keep that in mind...working on the new AS System right now and don't want to interrupt that (it's taken me long enough already!) :D
 
WOW this looks fun i Put it in today and cant wait to test this .. i love painball too and i am sure once my shard gets going strong the members will love this that is for sure..

thanks for the Script :) good job :)
 

s1m0n1e

Wanderer
I love this script, only part i didnt like is the black backpack left in players banks after they used the chip, any help on making it delete itself when the players have taken out their stuff?
 

Viky

Wanderer
Today, my shard crash. I am using newest version 1.1.1 without any modification. Here is crashlog:

Server Crash Report
===================

RunUO Version 1.0.0, Build 36918
Operating System: Microsoft Windows NT 5.0.2195.0
.NET Framework: 1.1.4322.2032
Time: 15.11.2005 21:05:40
Mobiles: 33466
Items: 345330
Clients:
- Count: 16
...

Exception:
System.NullReferenceException: Odkaz na objekt není nastaven na instanci objektu.
at Server.Games.PaintBall.PBScoreGump.AddPlayers()
at Server.Games.PaintBall.PBScoreGump..ctor(PBGameItem pbgi)
at Server.Games.PaintBall.PBScoreBoard.OnDoubleClick(Mobile from)
at Server.Mobile.Use(Item item)
at Server.Network.PacketHandlers.UseReq(NetState state, PacketReader pvSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns)
at Server.Network.MessagePump.Slice()
 
Top