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!

Challenge Game Revised 1.0

Clarke76

Wanderer
Challenge Game Revised [v1.4]

Summary:
[UPDATED to Version 1.4 (June 6, 2004)]

[Version 1.4]
Screw up in the RC0 playermobile. Had code in it that didn't belong there and would not compile. Don't need to redownload unless you got that error.
[Version 1.3]
This is a brand new Challenge Game then the previous one I had released on the old boards. The code is cleaner and there are far less bugs. In addition new features have been added and some removed. Everything, including the PlayerMobile, is in the zip file. Make sure to read the README.txt file. Enjoy

Description:
1v1 and 2v2 Challenge Game.

Installation:
-README.txt file included with steps on how to install.
-Remember to [prop the stones you add and set all the required info.
-The stones can be anywhere you want them. All are controled threw an arraylist that loads during system startup and is edited when any stone is removed or added. I Personally use a jailcell that way I can always check the status of them.

Version 1.3
[NEW]
-Opponent is no longer gray when the challenge ends.
-You are no longer red for a split second after getting teleported out of game.
-Bug fixed where if you were blue you would still get teleported to Buks Den after a crash or logout more than 5min.
-Bug fixed where if you logout for under 5mins or got disconnect the fight timer would not start back up.
-InternalTimer and Fight Timer moved to Challenge Stone. For some dumb reason I was creating a Fight Timer on each player. It's now 1 timer per stone.
-Bug fixed where every 5mins under 30min fight it would spam 30, 25,20 ectect for the entire minute.
-Added option to change length of dual per stone. just [Prop it. It's set in minutes.
-Fixed Internal timer so it now Stops once it hits zero and dosnt continue counting.
-Fixed FightTimer so you would not remain IsInChallenge == true; if a tied occured.
-Fixed PlayerMobile for RC0. I forgot to add in where if you are in a challenge you get KeepItemsOnDeath.

I think I fixed other small bugs also, but i don't remember.

Version 1.2
-Found bug that crashed server when mounted. It was due to Ethereal Mounts and is now fixed. Download new version and reinstall. Enjoy

Version 1.1

Other bug fixes:
-problem where the challenge ring was not saving Kills,fame,ect when server crash occured. I've move the ring out of the timer and is now its own item. This seems to have fixed the problem.

-In challengestone.cs and top of file. There are two logout positions set. One for over 5 murders and one for under. For under 5 murders it is set to Brit and for over its now set for Buc Den instead of also Brit. This is only used when server crashes. Any other time the locations are where the orginal challenge command was used.

-After server crash, the challenge ring was not removed! This has been fixed.

-Added into game that anyone being challenged has to have full health. This is so the game is not abused and people use it as a means of an excape.

-Forgot to return base for keepitemsondeath, so make you you update that in you PlayerMobile! Take a look at the code below [IN the new README.txt].

-Fixed error where stone would always say Not in Use.
 

Attachments

  • ChallengeGame1.4.zip.zip
    37 KB · Views: 1,752

kill_dragon5

Wanderer
Awesome Clarke u really enjoy posting game scripts dont you;) But who cares they still own! And I wanna give you credit for cleaning up all that messy code. But thanx for another great game script!
 

Clarke76

Wanderer
hehe, sure do. Most of the scripts I release will probably be old ones I've done. Just cleaned up and in better form, code wise. I will be releasing my Hero/Evil system, SP style, in the near future, so be on the look out. I just need to go threw it and add in some extras and fix some known bugs. I'm also kidda waiting till RC 1 is released since there is major script editing going on.
 

SPanky

Wanderer
How exactly does this script work. Does it teleport the players somewhere to where they can fight away from other people and then teleport them back? I think I've seen the older version of this script and I loved it. Whenever you challenged someone, it would teleport the 1/2/3/4 of you to a rooftop in Britain, where a guy sat on a throne and counted down and said "fight" or something when it was time to begin. What I'm asking is: is this script pre-set or do I have to set where I want them to fight?
 

Clarke76

Wanderer
SPanky said:
How exactly does this script work. Does it teleport the players somewhere to where they can fight away from other people and then teleport them back? I think I've seen the older version of this script and I loved it. Whenever you challenged someone, it would teleport the 1/2/3/4 of you to a rooftop in Britain, where a guy sat on a throne and counted down and said "fight" or something when it was time to begin. What I'm asking is: is this script pre-set or do I have to set where I want them to fight?


You have to point the stone to the location you want them to fight. [props the stone and fill in the required info. After that your set to go.
 

Clarke76

Wanderer
Important FYI

*Instructions edited with this:*

-EDIT-
In challengestone.cs and top of file. There are two logout positions set. One for over 5 murders and one for under. You may want to edit these locations to your liking. I can't even remember where they are set. This code resets the stones and all players that were in a game after a server crash.
 
S

Seven

Guest
This has to be me :(
Code:
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
 - Error: Scripts\Custom\ChallengeGame\FinalGump.cs: CS0101: (line 15, column 15
) The namespace 'Server.Gumps' already contains a definition for 'FinalGump'
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.
 

Clarke76

Wanderer
Seven said:
This has to be me :(
Code:
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
 - Error: Scripts\Custom\ChallengeGame\FinalGump.cs: CS0101: (line 15, column 15
) The namespace 'Server.Gumps' already contains a definition for 'FinalGump'
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.
Seven:

you have another gump named FinalGump. Switch one of the two to a different name and update the code that uses that to the new name.
 

SPanky

Wanderer
Challenge Ring

I found out about a Challenge Ring or something, but I can't figure out how the h*ll to add it. Can somebody tell me the exact commands to add a 1v1 and 2v2 challenge ring?
 

Clarke76

Wanderer
SPanky said:
I found out about a Challenge Ring or something, but I can't figure out how the h*ll to add it. Can somebody tell me the exact commands to add a 1v1 and 2v2 challenge ring?

No need to worry about the challenge ring. It is automatically added when a challenge begins. This ring does certain stuff, like save short term murders, murders, fame, karma ect. The saved props are then transfered back to the mobile when the ring is deleted which is also automatically done by the script.

To get the game working, just add a ChallengeStone. [prop the stone, set it as a 1v1 or 2v2. Set all the other info, Map, Locations ect. It should automatically be active and your set. Now the players can use the challenge command and have some fun.

If you continue to have problems let me know.
 
S

Seven

Guest
OK anyone know the exact thing i put in my seralize/deseralize in playermobile.cs ?
I just need some help with this because whenever i do it before it throughs an exception with my playerbase then wipes them all :(

I think i'm doing it right..but not sure if I'm doing somthing wrong.
 
S

Seven

Guest
in that order so for example :
isinchal will be 17
canbechal will be 18
m_TempMount will be 19 ?

Sorry not so good at searlizing/deserializing the playermobile.cs don't want to screw up this time and loose my playerbase
 

Clarke76

Wanderer
Seven said:
in that order so for example :
isinchal will be 17
canbechal will be 18
m_TempMount will be 19 ?

Sorry not so good at searlizing/deserializing the playermobile.cs don't want to screw up this time and loose my playerbase

Ok, try to explain this and not confuse you. In my playermobile, which is the default for Beta36. In order to add in the challenge game, I needed to switch it to version 15, up one from the orginal 14, in the serialize area. Right after the version, I added in my variables. Looks something like this.
Code:
base.Serialize( writer );
			
			writer.Write( (int) 15 ); // new version

			writer.Write( m_TempMount as BaseMount );
			writer.Write( (bool) isinchal );
			writer.Write( (bool) canbechal );

Thats all I had to do for my serializing. Now to deserialize it, You have to create a case for the version number, and deserialize it in the same exact order as the serialize, and then jump it to the next case. So it looks something like this.
Code:
public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();

			switch ( version )
			{
				case 15:
				{
					m_TempMount = (BaseMount) reader.ReadMobile();
					isinchal = reader.ReadBool();
					canbechal = reader.ReadBool();
					goto case 14;
				}
				case 14:

Hopefully you understand the concept a little better now. Let me know if you continue to have problems.
 

Clarke76

Wanderer
infra001 said:
Here's an idea, add betting of gold on the challenges. That would make this a true challenge script :p

I probably will when I get the chance, right now I don't feel like messing with it and re-doing the gumps, cause I absolutely hate doing gumps! Maybe in the near future tho. :)
 
S

Seven

Guest
Clark is the server suppose to crash when someone challenges someone on a mount and they accept?
 
Top