Ravenwolfe

Moderator
Ravenwolfe submitted a new resource:

Invasion System - town invasion

This is a control system for scheduling town invasions. I wrote a simple version of this for a shard I'm helping on. I have since made improvements to it and the owner has consented for me to release it since there are no invasion systems currently released. Also need to give a big thanks to @Voxpire who helped me with the Persistance!

Use the command [invasionsystem and you will get the following gump:
View attachment 9478
In that gump, you can select the town,...

Read more about this resource...
 
I'm trying to make this work for Runuo 2.5. I get line 108 and 125 persistence doesn't exist in this context errors. I've tried a lot to fix them but at a dead end. Any ideas?
 
RunUO does not have Persistence included in the server.

You will need to add the following file to Server/Persistence and then you need to recompile the core. You should be able to add this without any impact to other systems.

I thought @Voxpire had added it to RunUO but it doesn't look like it has been added.
 

Attachments

  • Persistence.cs
    2.3 KB · Views: 55
love it!

What about map selection?

As stated, the map can be set for each town in the scripts but the gump doesnt specify the map, so you basically are hardcoding the locations in the script.

I'll look at expanding the functionality in the next version.
 
Haven't had a chance to actually look through the system; but do you happen to already know an easy way to make certain items drop only on invasion spawn?
 
looks like this is the best place?

Code:
private void AddMonster(Type type)
        {
            object monster = Activator.CreateInstance(type);

            if (monster != null && monster is Mobile)
            {
                Point3D location = FindSpawnLocation();

                if (location == Point3D.Zero)
                {
                    return;
                }

                Mobile from = (Mobile)monster;

                from.OnBeforeSpawn(location, SpawnMap);
                from.MoveToWorld(location, SpawnMap);
                from.OnAfterSpawn();

                if (from is BaseCreature)
                {
                    ((BaseCreature)from).Tamable = false;
                }

                _Spawned.Add(from);
            }
        }
 
would it be possible to run this script on the old runuo 1.0 ?
it really looks cool!

Probably, but it would be tricky since RunUO 1.0 compiles older c# and the system uses Linq. I've got many things on my plate before i would look at that, including improvements to this system. A major goal is better spawning so creatures dont end up in unreachable spots.
 
I've used this system a few times on my shard and love it.

Two suggestions:
1) Have an option to set the time of the invasion to something more simple like "In X Minutes". Or when it's displaying the time in the gump, have it automatically add about 5 minutes on.

2) If you wanted to get fancy, you could have a setting in the script for the user to enter their actual time zone so that when it does display the date/time in the gump it's translated from UTC

3) Are you color blind or do you secretly love neon pink? lol because the text for entering the date/time is neon pink / magenta / something a little hard to read.
 
Can do. I have an update to post that uses spawn spots instead of random spawns anyway. That solves some issues with bad spawn spots.

The pink was actually a request by the shard I originally wrote it for, but I’ll change it in the update.
 
I really hate to be "that guy", but how about a little credit to the one who wrote the system to begin with? I can appreciate people taking my ideas and making them even better (that's what this whole community is about), but c'mon man...I worked hard on that like four years ago, at least a little shout out would be appreciated.
 
I’m actually shocked you would say that. I’ve got a bunch of stuff that you worked on which is incredible work that if I was “that guy” I could have released and people would kill to have (your achievement system comes to mind). But I’ve always had great respect for you and you asked me to keep it private, so I did.

The only part of this system that even resembles your code is the spawning method, which I used as a reference to create this. Perhaps I should have said I used that as a reference but then I would need to give credit to 7+ books, codeacademy, stack overflow, my parents for giving birth to me, etc.

@Voxpire helped with me the Persistence as I mentioned. You did write a system long before me, which I have and used portions as reference but to claim that this is your system is complete crap and I’ll be glad to post your system for anyone to compare if you want me to prove it.

I can show you tons of posts where I have complimented your work and have given you credit for helping me on Skype in the past.

This work is mine, it’s the first big project I have completed that I was proud of and your petty accusation just ruined my enjoyment of the accomplishment.

Thanks.
 
@Ravenwolfe Quick question, any idea why on RunUO the gump doest allow me to set a time for invasion? The field is blank and doesn't let me edit it so of course when I click 'Okay' the server crashes and complains that InvasionMainGump.cs:line 115 causes an error.
Code:
string time = info.GetTextEntry(5).Text;
                DateTime timeToStart;
invasion.png
 
Nothing off the top of my head, that field should have the current time in there and you should be able to edit it. I’ve tested with newer RunUO and it was fine (you have to add Persistence as mentioned in above posts). Are you using an older RunUO, like 2.3?
 
Nothing off the top of my head, that field should have the current time in there and you should be able to edit it. I’ve tested with newer RunUO and it was fine (you have to add Persistence as mentioned in above posts). Are you using an older RunUO, like 2.3?
Yes I am using 2.2 lol
 
It probably has something to do with the change in the way timing is done in newer RunUO and ServUO. You can probably modify the script to not use UTC and likely fix the issue. I’m in Vegas until Saturday but I can look when I get home if you don’t have it solved by then.

I also did some improvements a while back to the times and spawns that I can send you. I never posted the updates because Voxpire released his system and it basically kicked mine in the nuts, lol.
 
It probably has something to do with the change in the way timing is done in newer RunUO and ServUO. You can probably modify the script to not use UTC and likely fix the issue. I’m in Vegas until Saturday but I can look when I get home if you don’t have it solved by then.

I also did some improvements a while back to the times and spawns that I can send you. I never posted the updates because Voxpire released his system and it basically kicked mine in the nuts, lol.
LOL ok well I tried to change Utc.Now to just Now in the scripts to see if that helped this morning. But I'll look deeper when I get home from work.
 
Yeah, not gonna be quite that simple. There are some date/time conversions in there that will need to be modified.
 
Yeah, not gonna be quite that simple. There are some date/time conversions in there that will need to be modified.

Ok I got it working! Thanks for the direction today. I probably did this the the most wrong way possible but it seems to be working now.

After I changed all the DateTime.UtcNow to DateTime.Now,(because my server core doesn't use it by default), I went inside InvasionMainGump.cs and I changed line 53 from:

Code:
AddTextEntry(514, 119, 168, 20, 23, 5, DateTime.UtcNow.ToString(), 22);

to this

Code:
AddTextEntry(514, 119, 168, 20, 23, 5, DateTime.Now.ToString());

I tested this out and set an undead invasion for Ocllo and it went off without a problem. The guards were disabled and all the dead things spawned. Most importantly the time was generated in the textbox and was editable. LOL

invasion2.png
 
Last edited:
Why isn't Brit an option for the city invasion?
You can add it if you like. I added Britain to mine. in invasionsystem.cs add
Code:
                    case InvasionTowns.Britain:
                    {
                        Top = new Point3D(1429, 1539, 30);
                        Bottom = new Point3D(1626, 1768, 60);
                        MinSpawnZ = 1;
                        MaxSpawnZ = 60;
                        SpawnMap = Map.Felucca;
                        TownInvaded = "Britain";
                        break;
                    }
then make sure you register the new town entry in invasion settings.cs
Code:
    public enum InvasionTowns
    {
        Britain,
        BuccaneersDen,
        Cove,
        Delucia,
        Jhelom,
        Minoc,
        Moonglow,
        Nujel,
        Ocllo,
        Papua,
        SkaraBrae,
        Vesper,
        Yew
    }
 
Last edited:
No problem. Just keep in mind that in Britain there are many unreachable areas that monsters may spawn in like passageways. This may cause a problem during an invasion that a GM would have to address.
[doublepost=1538912677][/doublepost]@Ravenwolfe does your updated system have any kind of progress notification during an invasion?
 
I have not, but that should be easy to add. I've sent you the updated one if you don't mind testing it a bit.

If you say its working good, I'll release it here. In the meantime, I'll figure out a way to do a progress bar. I know I could do a nice one with supergumps but I'm trying not to make the system dependent on VitaNex.
 
I tried setting this up on my Shard but am having 0 luck. No errors though. When setting an invasion, nothing happens. I tried setting this up for 30 minutes in the future. Also, when calling the [ListInvasions, nothing happens either. Since I am getting no errors, I have no idea where to even start looking for issues. Anyone have any thoughts?

I am using the lasted version of ServUO from a couple of days ago.
 
Back