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!

Poisonous swamps

orpheus

Sorceror
Wow, great work on this as always. I love the things you create.
took me awhile but I finally added the boots to the crafting menu. :D
 

Alis

Wanderer
*looks around for usefull materials*

Alari wow hehe why dont you create another thing like a addon on the playermobile.cs when you step on a grass your intellligence regenarates faster or step on a lava you get a fire effect.Why dont you use the spell effect sistem and the sickness system all together bring up a new system :) i beileve as before you could do such thing :)

*giggles*
 

Alari

Wanderer
I updated the code with the Z check for poisoning for all three types of swamp now: Land, Static, and Added. (My own types for keeping track, nothing official.) End result: Players walking in structures in Papua no longer get poisoned.



Current Status of script:


Staff members will be poisoned. There is commented out code to not poison staff members. Remove the comment marks and adjust the staff levels. Or have staff wear swamp boots. :>

Dead players are not poisoned.

Mounted players do not have their mounts poisoned. The rider can still be poisoned though, unless they're wearing swamp boots. (I plan to change that to riders getting poisoned regardless of wearing swamp boots while mounted, but not poisoning mounts.)

Creatures in the swamp do not get poisoned. Sorry. This script is for players only. Way too many creatures would have to be made poison immune otherwise.

Currently this makes ALL swamps poisonous. Probably even ones made up of home tiles. Keep this in mind.

Code posted and file attached are synced. Both include all the latest code.

Please report any new slowdowns this script may cause. So far I haven't found any in my testing, but it has been rather limited.

Player height (Z) now matters, if they are over a land, static, or added swamp, they will not be poisoned. Both posted code and attached file updated.



And thank you to everyone. ^.^
 

Greystar

Wanderer
Alari said:
Glad to hear it. =) Let me know how it goes, especially if you notice any slowdowns in movement while players are on.


So far I havnt noticed anything except alot of corpses of players in large swamps, heh thats what happens when you make the boots craftable but hard to make (did that on purpose) also they are dropped in treasure but are a rare find. Didnt see a point on adding this affect ingame then have players be able to ignore it right away.
 

orpheus

Sorceror
Greystar said:
So far I havnt noticed anything except alot of corpses of players in large swamps, heh thats what happens when you make the boots craftable but hard to make (did that on purpose) also they are dropped in treasure but are a rare find. Didnt see a point on adding this affect ingame then have players be able to ignore it right away.

Yeah I made mine hard to craft as well. when the server goes live I'm not even going to warn them. haha.
 

Vhaldir

Sorceror
Code:
Exception: 
 System.NullReferenceException: Object reference not set to an instance of an object. 
    at Server.Mobiles.PlayerMobile.SwampCheck(PlayerMobile from) 
    at Server.Mobiles.PlayerMobile.Move(Direction d) 
    at Server.Network.PacketHandlers.MovementReq(NetState state, PacketReader pvSrc) 
    at Server.Network.MessagePump.HandleReceive(NetState ns) 
    at Server.Network.MessagePump.Slice() 
    at Server.Core.Main(String[] args)
 

Greystar

Wanderer
Vhaldir said:
Code:
Exception: 
 System.NullReferenceException: Object reference not set to an instance of an object. 
    at Server.Mobiles.PlayerMobile.SwampCheck(PlayerMobile from) 
    at Server.Mobiles.PlayerMobile.Move(Direction d) 
    at Server.Network.PacketHandlers.MovementReq(NetState state, PacketReader pvSrc) 
    at Server.Network.MessagePump.HandleReceive(NetState ns) 
    at Server.Network.MessagePump.Slice() 
    at Server.Core.Main(String[] args)

I've been running this since it was first posted with no errors, maybe I just never had the opportunity to come up, with that said you are going to want to reproduce that while in debug mode to get the needed information to find the problem.
 

Vhaldir

Sorceror
I just added a check to the swampcheck reference to see if the playermobile was null.. seemed to fix it..
Here's what I modified:

In PlayerMobile.cs
under public override bool Move( Direction d ) I replaced
Code:
				SwampCheck( this );   // for poisonous swamps

with
Code:
			if ( this != null )
			{
				SwampCheck( this );   // for poisonous swamps
			}
 

Alari

Wanderer
:confused:;


... Under what condition would 'this == null'?


I'll make the change of course, just confused as heck. :>




Updated code in post, in attached file, and on my script archive site.
 

Vhaldir

Sorceror
*EDIT*

Nope.. still causing crashes..

Code:
Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
   at Server.Mobiles.PlayerMobile.SwampCheck(PlayerMobile from)
   at Server.Mobiles.PlayerMobile.Move(Direction d)
   at Server.Network.PacketHandlers.MovementReq(NetState state, PacketReader pvSrc)
   at Server.Network.MessagePump.HandleReceive(NetState ns)
   at Server.Network.MessagePump.Slice()
   at Server.Core.Main(String[] args)
 

Sathallrin

Sorceror
I have been using this script for awhile now and it seems to work great.
I did remove the code that detects for added swamps as I don't have any added ones. I figured why waste the cpu power checking for added swamps if there would never be any.

Thanks for the great script.
 

Greystar

Wanderer
Alari, after i read through that code several times I still kant find a way it can be null. I've been running this code since you wrote it and updated it and I've never had a crash because of this. But it may just be me...
 

Alari

Wanderer
Well, I'm sure somebody wouldn't report a crash if it wasn't happening. I'd be calling them a liar by saying it's not happening. ^.^;

Unfortunately I have no idea at what point the value would become null, or what conditions would cause that. Running in debug mode is the only way I know of to really track that down.


Vhaldir, if you could run your server in debug mode, that would help greatly. To run in debug mode, make a shortcut to your runuo.exe/server.exe, (name it 'RunUO debug mode') then right click on the shortcut and choose properties, and add " -debug" at the end of the 'target' line. It should look something like this:

Target: E:\Games\RunUO\RunUO-1.0.0\Server.exe -debug

If your path has spaces in it then the command name will be wrapped in quotes. Put the -debug on the outside of the quotes, with a space between the end quote and the dash.

Like this: "E:\Games\RunUO\RunUO-1.0.0\Server.exe" -debug


The only other thing I can think of is that if you got the code directly from the post, try downloading the attached file instead and modify your playermobile based off that. (Or use the included PlayerMobile if you haven't modified your PlayerMobile.cs in any other way.)


Edit: I added several extra null checks to possible problem points, please update your code. See attached file or the code in the quote box in the first post of this thread for updates.
 

wulf monat

Sorceror
i tried this in 2.0

it seems it wouldnt work for me in run uo 2.0 there was a part in playermonile edit that isnt the same in 2.0 as it was in 1.0 i tried two days ago, maybe i missed something ill try it again later tonight and posty what troubles i have i guess
 
Top