|
||
|
|||||||
| Custom Script Releases This forum is where you can release your custom scripts for other users to use. Please note: By releasing your scripts here you are submitting them to the public and as such agree to make them public domain. The RunUO Team has made its software GPL for you to use and enjoy you should do the same for anything based off of RunUO. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#79 (permalink) |
|
Forum Expert
Join Date: Nov 2005
Location: San Diego, CA
Posts: 1,824
|
<i>is there any way to make this apply to NPC's too? or do they run under a LOS system as it is??</i>
You want the NPC's to have limited visibility? Or you want the players to not see NPC's? For the latter, the system is already in place, and I recall can be configured. I do recall toying around with NPC-to-PC LOS. This isn't as bad as it sounds, because generally any NPC lossing a PC represents a PC that will have to LOS the NPC. With the cacheing mechanism it's kind of a wash. I have been totally swamped at work, but my memory tells me that there might actually be a config option in the Xml file... C// |
|
|
|
|
|
#80 (permalink) |
|
Forum Novice
Join Date: Jul 2005
Location: Finland! <3<3
Age: 17
Posts: 116
|
When i try to compile i get:
Code:
Error 1 Operator '!' cannot be applied to operand of type 'void' D:\Mobile.cs 3749 14 Server Error 2 Cannot implicitly convert type 'System.Collections.Generic.IEnumerable<Server.Gumps.Gump>' to 'System.Collections.Generic.List<Server.Gumps.Gump>'. An explicit conversion exists (are you missing a cast?) D:\Mobile.cs 6512 24 Server Error 3 'System.Collections.Generic.IEnumerable<Server.Gumps.Gump>' does not contain a definition for 'Remove' D:\Mobile.cs 6551 24 Server Error 4 Cannot implicitly convert type 'System.Collections.Generic.IEnumerable<Server.Gumps.Gump>' to 'System.Collections.Generic.List<Server.Gumps.Gump>'. An explicit conversion exists (are you missing a cast?) D:\Mobile.cs 6579 24 Server Error 5 'System.Collections.Generic.IEnumerable<Server.Gumps.Gump>' does not contain a definition for 'Remove' D:\Mobile.cs 6592 16 Server Error 6 Cannot implicitly convert type 'System.Collections.Generic.IEnumerable<Server.Gumps.Gump>' to 'System.Collections.Generic.List<Server.Gumps.Gump>'. An explicit conversion exists (are you missing a cast?) D:\Mobile.cs 6621 24 Server
__________________
All i can do is this. Last edited by D-Eagle; 02-20-2007 at 07:18 AM. |
|
|
|
|
|
#81 (permalink) |
|
Forum Expert
Join Date: Nov 2005
Location: San Diego, CA
Posts: 1,824
|
D:\Mobile.cs is definitely not the right place for Mobile.cs
This is a core mod. It's tricky. You need to have the original source code for the runuo executable. Part of the source replaces a couple of key runuo classes, part of it is unique. C// |
|
|
|
|
|
#82 (permalink) |
|
Forum Newbie
Join Date: Aug 2006
Age: 23
Posts: 44
|
I have the SVN version of the core source.
I made the core project file with that one project program. When i tryed to compile, it whined that D:\mobile.cs and some other scripts doesn't exist, so i moved those scripts to my D:\ root. |
|
|
|
|
|
#83 (permalink) |
|
Forum Expert
Join Date: Nov 2005
Location: San Diego, CA
Posts: 1,824
|
What is the "it" that whined?
You must follow the instructions given. Mobile.cs cannot go in D:, it must go in the core source directory. It's been a while, so it's not clear to me that it is compatible with the most current version of svn. Possibly not. At a minimum this works against the release version of source code. The required edits are all prominently marked. C// |
|
|
|
|
|
#85 (permalink) |
|
Forum Expert
Join Date: Nov 2005
Location: San Diego, CA
Posts: 1,824
|
When I get back into it, I'll touch 'er up. May be a while yet. We're rehearsing for orals on that big proposal I was talking about. Lots of overtime and what not. Plus, I've been playing Medieval II: Total War.
![]() C// |
|
|
|
|
|
#86 (permalink) |
|
Forum Novice
Join Date: Dec 2005
Posts: 206
|
I have a q.
Can this be set up in such a way that it can be activated only for a region and only during a certain event? I guess it can, if it is a function as I think.. I could change it to something like Code:
public bool InTrueLOS(Mobile x, Mobile y)
{
if( x.Region is EventRegion && ((EventRegion)x.Region).EventRunning )
//courageous code....
return InLOS( x, y );
}
![]() <3
__________________
11010101 me. |
|
|
|
|
|
#87 (permalink) |
|
Forum Expert
Join Date: Nov 2005
Location: San Diego, CA
Posts: 1,824
|
It surely could, but it was danged hard figuring out all the correct insertion points, and when even one of them is off, the system malfunctions in terrible ways. One player being able to see one, and not vice versa, is a major system meltdown. I believe the system can have LOS turned on and off dynamically, by the way. While this is global, how big is your server anyway?
C// |
|
|
|
|
|
#88 (permalink) |
|
Forum Expert
|
About 60 onlines average.. (I'm the nico, old acct) why?
btw,.. Code:
for( int j = 0; j < m_SpiralPattern.Length; j++)
{
int xOffset = m_SpiralPattern[j][0];
int yOffset = m_SpiralPattern[j][1];
int x = locX + xOffset;
int y = locY + yOffset;
//------------------------------------------------------------------
// the spiral pattern could make us walk off the edge of the
// map; break out of that here:
//------------------------------------------------------------------
if( x < 0 || x > m_map.Width || y < 0 || y > m_map.Height )
goto cutpoint;
//------------------------------------------------------------------
// Here we optimize by skipping the pulling up of tiles in the
// event we are in a shadow; it turns out that in certain diagonal
// 'L' cases (corners), this doesn't work perfectly, hence the check
// for matching abs. x/y offsets ... we don't cut point those.
//------------------------------------------------------------------
if (
!v.IsVisible( beholder, x, y )
&&
Math.Abs( xOffset - yOffset ) <= 1
)
goto cutpoint;
//------------------------------------------------------------------
// Now process statics:
//------------------------------------------------------------------
Tile[] staticTiles = m_map.Tiles.GetStaticTiles( x, y, true );
foreach( Tile staticTile in staticTiles )
{
if( TileBlocksVis( staticTile, eyelevel, x, y, beholder ) )
{
v.ProcessObstructionAt( beholder, x, y );
goto cutpoint; // further obstructions irrelevant
}
}
//------------------------------------------------------------------
// Now process land:
//------------------------------------------------------------------
Tile landTile = m_map.Tiles.GetLandTile( x, y );
if( LandBlocksVis( landTile, x, y, eyelevel+5, beholder ) )
{
v.ProcessObstructionAt( beholder, x, y );
goto cutpoint; // further obstructions irrelevant
}
//------------------------------------------------------------------
// Now process "invalid" tiles (the black areas in dungeons):
//------------------------------------------------------------------
if( IsVizBlockingInvalidLand( landTile, staticTiles, x, y ) )
{
v.ProcessObstructionAt( beholder, x, y );
goto cutpoint; // further obstructions irrelevant
}
//------------------------------------------------------------------
// Items left deliberately out here (that's a follow up stage)
//------------------------------------------------------------------
//------------------------------------------------------------------
cutpoint:; // sorry about the evil goto; please leave this alone for now
// think of it this way; this is like a destionation for "continue",
// where code can be if needed.
//------------------------------------------------------------------
Last edited by Kenko; 02-23-2007 at 09:58 AM. |
|
|
|
|
|
#89 (permalink) |
|
Forum Expert
Join Date: Nov 2005
Location: San Diego, CA
Posts: 1,824
|
why not use else if and elses instead of a goto!?!
Don't believe everything your professor tells you. ![]() You might wish to read the original work that started it all, "Go To Statement Considered Harmful," by Edsger W. Dijkstra: Go To Statement Considered Harmful You'll note in the original work not all cases of goto were recommended to be avoided, in spite of your professor's abridged retelling of Dijkstra's words; in particular, the "abortion" case (also known as "fall through") is still, today, considered a clean (and clear, to the reader) use of goto. C// |
|
|
|
|
|
#90 (permalink) | |
|
Forum Newbie
Join Date: Aug 2006
Age: 23
Posts: 44
|
Quote:
The core compiles fine without the LOS changes, and i use the latest SVN version. Is there any way someone could make it work with the latest SVN? |
|
|
|
|
|
|
#91 (permalink) |
|
Forum Expert
Join Date: Nov 2005
Location: San Diego, CA
Posts: 1,824
|
The correct way to do this has always been to look into the two replacement files and find the well marked edits and move them over the most recent stuff in svn. You may wish to try winmerge. It's pretty good.
(you'll notice that all the LOS changes are very well marked in the files). |
|
|
|
|
|
#95 (permalink) |
|
Forum Novice
Join Date: Jun 2003
Location: hudson valley ny
Age: 38
Posts: 442
|
Just a crazy little question...
Does anyone know if this will work on 1.0? Im sure it could probably be made to work with it, but Im just curious if anyone has attempted it and what results they had... This is something I would really love to add to my server, but I know there are a great deal of differences between the 1.0 and 2.0 (insert svn or rc# here), which is the reason why I havent upgraded to 2.0. I have way too many mods to even consider moving to 2.0... I dont have any reservations about modding the core files, I just wouldnt want to spend months of rewriting code and researching things that work in one version but not another... Thanks Sciron
__________________
I dont hate all people...just stupid people...it just turns out most people are stupid! Trying hard to fight the urge to come back to UO!... Too late... I'm back! |
|
|
|
|
|
#96 (permalink) |
|
Forum Expert
Join Date: Nov 2005
Location: San Diego, CA
Posts: 1,824
|
Does anyone know if this will work on 1.0?
It won't even compile on 1.0. It makes use of language features from later version of C#; its use of these features isn't easily substituted. To change it, and have the same level of efficiency, I would have to generate CLR instruction codes directly (like a compiler). It's the anonymous delegates that are the main problem. C// |
|
|
|
|
|
#97 (permalink) |
|
Forum Novice
Join Date: Jun 2003
Location: hudson valley ny
Age: 38
Posts: 442
|
*sigh*
such is the story of my life ![]() Well... I guess on the positive side of things... it does tend go give me more of a reason to attempt to convert the shard to 2.0... not gonna happen any time in the near future... but still an added reason to move up ![]()
__________________
I dont hate all people...just stupid people...it just turns out most people are stupid! Trying hard to fight the urge to come back to UO!... Too late... I'm back! |
|
|
|
|
|
#98 (permalink) | |
|
Forum Expert
Join Date: Nov 2005
Location: San Diego, CA
Posts: 1,824
|
Quote:
C// |
|
|
|
|
|
|
#99 (permalink) |
|
Lurker
Join Date: Mar 2006
Posts: 2
|
Is there a way I could isolate certain mobs to be uneffected by TrueLOS?
I'd like to enable it for mobs but I think certain predatory monsters ought to not be fooled as easily as ducking behind a corner, where as most arnt really equipped to sniff out a player. Or if not, could you recomend an edit to the BaseAI to make them pursue the last known location of their focus mob? |
|
|
|
|
|
#100 (permalink) | |
|
Forum Expert
Join Date: Nov 2005
Location: San Diego, CA
Posts: 1,824
|
Quote:
C// |
|
|
|
|