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

A_Li_N

Knight
The only thing I can think of that could cause that error would be this line:
Code:
				team = pm.FindItemOnLayer( Layer.TwoHanded ).Hue;

Try changing it to this: (Replace the entire AddPlayers() method)
Code:
		private void AddPlayers()
		{
			int Team1, Team2, Team3, Team4;
			Team1 = Team2 = Team3 = Team4 = 0;
			int team = -1;

			foreach( PlayerMobile pm in m_PBGI.Players )
			{
				Item item = pm.FindItemOnLayer( Layer.TwoHanded );
				if( item != null )
					team = item.Hue;
				switch( team )
				{
					case 3:
					{
						if( pm.ChestArmor != null && pm.ChestArmor.Hue == team )
							AddLabel( 25, 95+Team1*20, 3, pm.Name );
						else
							AddLabel( 25, 95+Team1*20, 1153, pm.Name );

						Team1 += 1;
						break;
					}
					case 38:
					{
						if( pm.ChestArmor != null && pm.ChestArmor.Hue == team )
							AddLabel( 172, 95+Team2*20, 38, pm.Name );
						else
							AddLabel( 172, 95+Team2*20, 1153, pm.Name );

						Team2 += 1;
						break;
					}
					case 68:
					{
						if( m_PBGI.Teams > 2 )
						{
							if( pm.ChestArmor != null && pm.ChestArmor.Hue == team )
								AddLabel( 318, 95+Team3*20, 68, pm.Name );
							else
								AddLabel( 318, 95+Team3*20, 1153, pm.Name );

							Team3 += 1;
						}
						break;
					}
					case 53:
					{
						if( m_PBGI.Teams > 3 )
						{
							if( pm.ChestArmor != null && pm.ChestArmor.Hue == team )
								AddLabel( 463, 95+Team4*20, 53, pm.Name );
							else
								AddLabel( 463, 95+Team4*20, 1153, pm.Name );

							Team4 += 1;
						}
						break;
					}
					default:				break;
				}
			}

			AddLabel(44, 70, 3, "Team 1 - " + Team1.ToString());
			AddLabel(188, 70, 38, "Team 2 - " + Team2.ToString());
			if( m_PBGI.Teams > 2 )
				AddLabel(334, 70, 68, "Team 3 - " + Team3.ToString());
			if( m_PBGI.Teams > 3 )
				AddLabel(478, 70, 53, "Team 4 - " + Team4.ToString());
		}

Give that a try and see if you crash again. If you are able to reproduce the crash, do so in debug mode to give me a better understanding where the crash occurs.
 

Viky

Wanderer
A_Li_N said:
The only thing I can think of that could cause that error would be this line:
Code:
				team = pm.FindItemOnLayer( Layer.TwoHanded ).Hue;

Try changing it to this: (Replace the entire AddPlayers() method)
Code:
		private void AddPlayers()
		{
			int Team1, Team2, Team3, Team4;
			Team1 = Team2 = Team3 = Team4 = 0;
			int team = -1;

			foreach( PlayerMobile pm in m_PBGI.Players )
			{
				Item item = pm.FindItemOnLayer( Layer.TwoHanded );
				if( item != null )
					team = item.Hue;
				switch( team )
				{
					case 3:
					{
						if( pm.ChestArmor != null && pm.ChestArmor.Hue == team )
							AddLabel( 25, 95+Team1*20, 3, pm.Name );
						else
							AddLabel( 25, 95+Team1*20, 1153, pm.Name );

						Team1 += 1;
						break;
					}
					case 38:
					{
						if( pm.ChestArmor != null && pm.ChestArmor.Hue == team )
							AddLabel( 172, 95+Team2*20, 38, pm.Name );
						else
							AddLabel( 172, 95+Team2*20, 1153, pm.Name );

						Team2 += 1;
						break;
					}
					case 68:
					{
						if( m_PBGI.Teams > 2 )
						{
							if( pm.ChestArmor != null && pm.ChestArmor.Hue == team )
								AddLabel( 318, 95+Team3*20, 68, pm.Name );
							else
								AddLabel( 318, 95+Team3*20, 1153, pm.Name );

							Team3 += 1;
						}
						break;
					}
					case 53:
					{
						if( m_PBGI.Teams > 3 )
						{
							if( pm.ChestArmor != null && pm.ChestArmor.Hue == team )
								AddLabel( 463, 95+Team4*20, 53, pm.Name );
							else
								AddLabel( 463, 95+Team4*20, 1153, pm.Name );

							Team4 += 1;
						}
						break;
					}
					default:				break;
				}
			}

			AddLabel(44, 70, 3, "Team 1 - " + Team1.ToString());
			AddLabel(188, 70, 38, "Team 2 - " + Team2.ToString());
			if( m_PBGI.Teams > 2 )
				AddLabel(334, 70, 68, "Team 3 - " + Team3.ToString());
			if( m_PBGI.Teams > 3 )
				AddLabel(478, 70, 53, "Team 4 - " + Team4.ToString());
		}

Give that a try and see if you crash again. If you are able to reproduce the crash, do so in debug mode to give me a better understanding where the crash occurs.

Thanks, I will try reproduce it again with your patch.

Packer898 said:
Object referance not set to an instance of object.

Do you understand czech language?

arul said:
hehe, first time I saw someone using Czech version of the .Net on these forums. Just wanted to say that :D.

I am posting crashlogs every time when some public script crash :)
 

stu

Wanderer
all of my players end up with gm focus after a game ends and it has to be adjusted manually. Is there a fix for this?
 

Twice

Wanderer
I think instead of moving all the players stuff to their banks, why not just set all the stuff in the parks visible = false? and make it unequip there armor, and set its visible false, and then when the game is over, reequip the armor, and set visible true, and set visible true for all the stuff in their pack, and then script a teleporter that doesnt let players go through if they have a memory chip in their bank [forcing them to click it] and then you can make players end up in a closed room, without a way to get out unless they click thier memory chip. just a suggestion.
 
Twice

I think instead of moving all the players stuff to their banks, why not just set all the stuff in the parks visible = false? and make it unequip there armor, and set its visible false, and then when the game is over, reequip the armor, and set visible true, and set visible true for all the stuff in their pack, and then script a teleporter that doesnt let players go through if they have a memory chip in their bank [forcing them to click it] and then you can make players end up in a closed room, without a way to get out unless they click thier memory chip. just a suggestion.
Making items invisable could make their backpacks too full when event items are added right? Not a good idea. And I have told people this many times...making the chip activate with a gate is a waste of time. What if a person has to logout in the middle of an event and logs back in when the event is over? The teleporter would be missing. I strip all skills and give 5 stat points which forces people into going to the bank and using their chip. It also helps to exit them at brit bank or bucs den depending on their amount of kills.
 

Kheldar

Sorceror
We want to implement this but i need to make it so nonmovable items dont leave players backpack i attepted this but can't seem to get it to work im still leaning but any help would be much appreciated
 

Twice

Wanderer
Lucid Nagual said:
Making items invisable could make their backpacks too full when event items are added right?

How would it do that? You takling about when the prizes are givin out? You could make it so the prize's are added to their banks (much safer for the players) and the players that I know *HATE* having to put their stuff into there backpacks after the paintball event is over.

Lucid Nagual said:
And I have told people this many times...making the chip activate with a gate is a waste of time. What if a person has to logout in the middle of an event and logs back in when the event is over? The teleporter would be missing.

The teleporters wouldn't be missing because who's gonna delete them? I never said I would be removing the teleporters after the event is over, I only said make the teleporters search for a memory chip in the players bank, and then when they still have it in their bank, the teleporter doesnt let them through, and could even move the chip from their bank to their backpack. I'm just suggesting idea's that could improve the paintball script, and I don't see how these idea's are bad. They seem pretty reasonable, and doable, to me.

-2x
 

A_Li_N

Knight
IDK bout most players, but I tended to have a LOT of items in my pack. So making them all invisible and trying to add more event items would not work in my case. That (and other reasons) is why I chose to put the items in the bank.

With the chips...don't worry bout them, since they will be gone when I update this system to ACC. As I believe I've stated in the main thread, this system was really a throw together to have the Paintball without modifying the PlayerMobile like the last one did. I didn't do a LOT of testing or optimizing.

But thanks for your suggestions. They are always welcome. I just might not do them ;)
 
Quote:
Originally Posted by Lucid Nagual
Making items invisable could make their backpacks too full when event items are added right?


How would it do that? You takling about when the prizes are givin out? You could make it so the prize's are added to their banks (much safer for the players) and the players that I know *HATE* having to put their stuff into there backpacks after the paintball event is over.

Quote:
Originally Posted by Lucid Nagual
And I have told people this many times...making the chip activate with a gate is a waste of time. What if a person has to logout in the middle of an event and logs back in when the event is over? The teleporter would be missing.


The teleporters wouldn't be missing because who's gonna delete them? I never said I would be removing the teleporters after the event is over, I only said make the teleporters search for a memory chip in the players bank, and then when they still have it in their bank, the teleporter doesnt let them through, and could even move the chip from their bank to their backpack. I'm just suggesting idea's that could improve the paintball script, and I don't see how these idea's are bad. They seem pretty reasonable, and doable, to me.
My events give event gear. That added gear with the weight of their items can cause issues. It can even cause issues if a players backpack is near full and you add paintballs to the players backpack. Sorry but i still say that is not a smart idea.

As far as the event chip goes.....players may have to logout during an event. I have had to step away from my computer and had no choice but to shut it off in the middle of an event. It happens to all of us at one time or another. All of my events are fully automatic and exit gates deliver them right in front of the bank. I don't see why someone would go through that kind of trouble over a moongate. It isn't hard to double click on a non-movable object in the bankbox. And unlike the backpacks....the bankboxes will take the bagged items and chip even when full. But if your players are truely that lazy then...maybe it would be far better to make a bool like: "bool InEvent" and make it true when starting an event and then false after the event, or upon logout. When the bool turns to false it can do a check for a chip in the bank. That would be a million times better then some lame skill gate. But personally I'd wait for Alien's next release. His Central Memory is an outstanding idea. Can store players info in CM and then retrieve it without a chip (I don't remember if he actually uses one). From the sounds of it your events are highly dependant on staff and very manual. Events like this (Alien's Paintball) and my own are almost completely automated....including handing out prizes. I have one that I haven't released yet that does everything from placing the addons to announcing event instructions and placing the stone. It removes all event items when the event is declared over, without a trace. A few clicks power the whole thing.
 

Pyro-Tech

Knight
i was going to ask if there was a way to keep from removing immovable items from pack (seeing as i use a race system that places invisible stones in packs) but seeing as it will sooner or later be updated to the Completly custom system, will it be handled in that?

either way, thanks
 
Pyro-Tech

i was going to ask if there was a way to keep from removing immovable items from pack (seeing as i use a race system that places invisible stones in packs) but seeing as it will sooner or later be updated to the Completly custom system, will it be handled in that?

either way, thanks
It would be much better to use Central Memory to save your Race info. Then there would be no need for orbs in the backpack.

I've been working on such a system.
 

A_Li_N

Knight
Pyro-Tech said:
i was going to ask if there was a way to keep from removing immovable items from pack (seeing as i use a race system that places invisible stones in packs) but seeing as it will sooner or later be updated to the Completly custom system, will it be handled in that?

either way, thanks
I'll keep that in mind for the update, whenever that comes along :)

For now, here's some quick instructions on how to do that: (Note, I did not test this, nor did I actually put it in to compile...if there are errors/crashes, please PM me and I'll take a look deeper)

PGGameItem.cs Lines 203-226 look like this:
Code:
				else
				{
					Players.Add( from );

					ArrayList ItemsToMove = new ArrayList();
					Backpack itemsPack = new Backpack();
					itemsPack.Hue = 1;
					itemsPack.Name = "Items from PaintBallGame";
					BankBox bankBox = from.BankBox;

					foreach( Item item in from.Items )
						if( item.Layer != Layer.Bank && item.Layer != Layer.Hair && item.Layer != Layer.FacialHair && item.Layer != Layer.Mount && item.Layer != Layer.Backpack )
						ItemsToMove.Add( item );
					foreach( Item item in from.Backpack.Items )
						ItemsToMove.Add( item );

					foreach( Item item in ItemsToMove )
						itemsPack.AddItem( item );

					bankBox.AddItem( itemsPack );

					bankBox.AddItem( new PBPlayerStorage( from ) );

					AddToTeam( from );
				}

Change it to this:
Code:
				else
				{
					Players.Add( from );

					ArrayList ItemsToMove = new ArrayList();
					Backpack itemsPack = new Backpack();
					itemsPack.Hue = 1;
					itemsPack.Name = "Items from PaintBallGame";
					BankBox bankBox = from.BankBox;

					foreach( Item item in from.Items )
						if( item.Layer != Layer.Bank && item.Layer != Layer.Hair && item.Layer != Layer.FacialHair && item.Layer != Layer.Mount && item.Layer != Layer.Backpack )
						ItemsToMove.Add( item );
[color=red]					foreach( Item item in from.Backpack.Items )
					{
						if( !item.Movable || !item.Visible [color=blue]/*|| item is YourTypeOfItemToSkip*/ )[/color]
							continue;
						ItemsToMove.Add( item );
					}[/color]

					foreach( Item item in ItemsToMove )
						itemsPack.AddItem( item );

					bankBox.AddItem( itemsPack );

					bankBox.AddItem( new PBPlayerStorage( from ) );

					AddToTeam( from );
				}
The change is in red. If, for some reason it's not working, or not working how you want, you can probably do what is in blue. I don't know for sure it'll work that way, but it's worth a try.

Let's say you have race stones in the backpack that of type 'RaceOrb', you would do
if( !item.Movable || !item.Visible || item is RaceOrb )


*Addition*
Also, if you want to try the ACC system (including the Central Memory), I would be happy to whip up a module to save the information that your orbs contains. If you're interested, PM me with the orb script (so I know what to put in) and an email and I'll give you a few pointers on how to work things. I'm always in need for testers. Make sure you always create backups before changing something like this.
 

Pyro-Tech

Knight
the post you did doesn't seem to work....it overlooks the stone that i want it to skip

and also, i was giong to PM the script to you as you suggested, but i can't seem to attach things in PM's....and only allowed so many characters so couldn't post it within the script itself:confused:
 

A_Li_N

Knight
Email me the script and any info you wanted to PM with:
anAlien at gmail.com

(you have gtalk or AIM at all?)
 
Top