Resource icon

Advanced Camping & Outpost System 2020-06-16

No permission to download

Massapequa

Citizen
Apr 28, 2020
15
12
3
New York
Massapequa submitted a new resource:

Advanced Camping & Outpost System - Making the camping skill more fun to use

Camping has always been an under utilized skill in UO and I wanted to make it a little more useful and fun to use. To do this, I've added items and perks to building campfires as well as introduced Outposts that can be placed around the world for skilled campers to find and upgrade for the benefit of themselves and other players.

1) Camper's map: These are items that will allow campers to Mark the location of Outposts and campsites, to be returned to later.

2) Upgraded campfire: At 70...
Read more about this resource...
 

Espcevan

Gold Donator
Apr 21, 2015
68
31
18
32
www.UOAccess.com
Shard Name
UOAccess
Was there an edit to kindling that needed done to bring up the outpost?
Im a little lost on how this is supposed to get "started"

When I threw this into my server i had to fix a couple errors...
C#:
ServUO - [https://www.servuo.com] Version 0.5, Build 7478.41612
 + _Custom/Systems/Advanced Camping/Campfire.cs:
    CS1002: Line 47: ; expected
    CS1519: Line 47: Invalid token ';' in class, struct, or interface member declaration
    CS1002: Line 250: ; expected
    CS1519: Line 250: Invalid token ';' in class, struct, or interface member declaration
    CS1002: Line 251: ; expected
    CS1519: Line 251: Invalid token ';' in class, struct, or interface member declaration
    CS1002: Line 252: ; expected
    CS1519: Line 252: Invalid token ';' in class, struct, or interface member declaration
    CS1002: Line 253: ; expected
    CS1519: Line 253: Invalid token '&&' in class, struct, or interface member declaration
    CS1519: Line 253: Invalid token '!=' in class, struct, or interface member declaration
    CS1519: Line 253: Invalid token '&&' in class, struct, or interface member declaration
    CS1519: Line 253: Invalid token '==' in class, struct, or interface member declaration
    CS1519: Line 253: Invalid token '&&' in class, struct, or interface member declaration
    CS1519: Line 253: Invalid token '(' in class, struct, or interface member declaration
    CS1519: Line 253: Invalid token ',' in class, struct, or interface member declaration
    CS1519: Line 253: Invalid token ')' in class, struct, or interface member declaration
 + _Custom/Systems/Advanced Camping/OutpostBedroll.cs:
    CS1002: Line 38: ; expected
    CS1519: Line 38: Invalid token ';' in class, struct, or interface member declaration
    CS1002: Line 153: ; expected
    CS1519: Line 153: Invalid token ';' in class, struct, or interface member declaration
    CS1002: Line 154: ; expected
    CS1519: Line 154: Invalid token ';' in class, struct, or interface member declaration
    CS1002: Line 155: ; expected
    CS1519: Line 155: Invalid token ';' in class, struct, or interface member declaration
    CS1002: Line 156: ; expected
    CS1519: Line 156: Invalid token '&&' in class, struct, or interface member declaration
    CS1519: Line 156: Invalid token '==' in class, struct, or interface member declaration
    CS1519: Line 156: Invalid token '&&' in class, struct, or interface member declaration
    CS1519: Line 156: Invalid token '(' in class, struct, or interface member declaration
    CS1519: Line 156: Invalid token ',' in class, struct, or interface member declaration
    CS1519: Line 156: Invalid token ')' in class, struct, or interface member declaration
 + _Custom/Systems/Advanced Camping/OutpostCamp.cs:
    CS1002: Line 31: ; expected
    CS1519: Line 31: Invalid token '(' in class, struct, or interface member declaration
 + _Custom/Systems/Advanced Camping/SmallTent.cs:
    CS1002: Line 5: ; expected

I got all of the errors fixed, not sure what version of ServUO this is supposed to be for but mine threw these errors because of the lines with
C#:
        public PlayerMobile Player => m_Player;
i fixed by changing them to this format below
C#:
        public PlayerMobile Player
        {
            get
            {
                return this.m_Player;
            }
        }
the one problem i did have with this was with the Valid
C#:
        public bool Valid => !Fire.Deleted && Fire.Status != CampfireStatus.Off && Player.Map == Fire.Map && Player.InRange(Fire, Campfire.SecureRange);
i fixed it by doing this in campfire.cs....
C#:
        private bool m_Valid;

        public CampfireEntry(PlayerMobile player, Campfire fire)
        {
            m_Player = player;
            m_Fire = fire;
            m_Start = DateTime.UtcNow;
            m_Safe = false;

            if (!Fire.Deleted && Fire.Status != CampfireStatus.Off && Player.Map == Fire.Map && Player.InRange(Fire, Campfire.SecureRange))
                m_Valid = true;
            else
                m_Valid = false;

        }

        public bool Valid //=> !Fire.Deleted && Fire.Status != CampfireStatus.Off && Player.Map == Fire.Map && Player.InRange(Fire, Campfire.SecureRange);
        {
            get
            {
                return this.m_Valid;
            }
        }
i really dont think its working the way it should.... not sure how your code format works so im at a loss
This format stumps me and my ServUO.Exe Compile:
        public PlayerMobile Player => m_Player;
 
Last edited:

Massapequa

Citizen
Apr 28, 2020
15
12
3
New York
Was there an edit to kindling that needed done to bring up the outpost?
Im a little lost on how this is supposed to get "started"
Actually no item is required to start an outpost.
You just gotta add the "OutpostCamp" item in the game and players with enough Camping skill can double click on the fire pit to start it up. :)
 

Massapequa

Citizen
Apr 28, 2020
15
12
3
New York
Was there an edit to kindling that needed done to bring up the outpost?
Im a little lost on how this is supposed to get "started"

When I threw this into my server i had to fix a couple errors...
C#:
ServUO - [https://www.servuo.com] Version 0.5, Build 7478.41612
+ _Custom/Systems/Advanced Camping/Campfire.cs:
    CS1002: Line 47: ; expected
    CS1519: Line 47: Invalid token ';' in class, struct, or interface member declaration
    CS1002: Line 250: ; expected
    CS1519: Line 250: Invalid token ';' in class, struct, or interface member declaration
    CS1002: Line 251: ; expected
    CS1519: Line 251: Invalid token ';' in class, struct, or interface member declaration
    CS1002: Line 252: ; expected
    CS1519: Line 252: Invalid token ';' in class, struct, or interface member declaration
    CS1002: Line 253: ; expected
    CS1519: Line 253: Invalid token '&&' in class, struct, or interface member declaration
    CS1519: Line 253: Invalid token '!=' in class, struct, or interface member declaration
    CS1519: Line 253: Invalid token '&&' in class, struct, or interface member declaration
    CS1519: Line 253: Invalid token '==' in class, struct, or interface member declaration
    CS1519: Line 253: Invalid token '&&' in class, struct, or interface member declaration
    CS1519: Line 253: Invalid token '(' in class, struct, or interface member declaration
    CS1519: Line 253: Invalid token ',' in class, struct, or interface member declaration
    CS1519: Line 253: Invalid token ')' in class, struct, or interface member declaration
+ _Custom/Systems/Advanced Camping/OutpostBedroll.cs:
    CS1002: Line 38: ; expected
    CS1519: Line 38: Invalid token ';' in class, struct, or interface member declaration
    CS1002: Line 153: ; expected
    CS1519: Line 153: Invalid token ';' in class, struct, or interface member declaration
    CS1002: Line 154: ; expected
    CS1519: Line 154: Invalid token ';' in class, struct, or interface member declaration
    CS1002: Line 155: ; expected
    CS1519: Line 155: Invalid token ';' in class, struct, or interface member declaration
    CS1002: Line 156: ; expected
    CS1519: Line 156: Invalid token '&&' in class, struct, or interface member declaration
    CS1519: Line 156: Invalid token '==' in class, struct, or interface member declaration
    CS1519: Line 156: Invalid token '&&' in class, struct, or interface member declaration
    CS1519: Line 156: Invalid token '(' in class, struct, or interface member declaration
    CS1519: Line 156: Invalid token ',' in class, struct, or interface member declaration
    CS1519: Line 156: Invalid token ')' in class, struct, or interface member declaration
+ _Custom/Systems/Advanced Camping/OutpostCamp.cs:
    CS1002: Line 31: ; expected
    CS1519: Line 31: Invalid token '(' in class, struct, or interface member declaration
+ _Custom/Systems/Advanced Camping/SmallTent.cs:
    CS1002: Line 5: ; expected

I got all of the errors fixed, not sure what version of ServUO this is supposed to be for but mine threw these errors because of the lines with
C#:
        public PlayerMobile Player => m_Player;
i fixed by changing them to this format below
C#:
        public PlayerMobile Player
        {
            get
            {
                return this.m_Player;
            }
        }
the one problem i did have with this was with the Valid
C#:
        public bool Valid => !Fire.Deleted && Fire.Status != CampfireStatus.Off && Player.Map == Fire.Map && Player.InRange(Fire, Campfire.SecureRange);
i fixed it by doing this in campfire.cs....
C#:
        private bool m_Valid;

        public CampfireEntry(PlayerMobile player, Campfire fire)
        {
            m_Player = player;
            m_Fire = fire;
            m_Start = DateTime.UtcNow;
            m_Safe = false;

            if (!Fire.Deleted && Fire.Status != CampfireStatus.Off && Player.Map == Fire.Map && Player.InRange(Fire, Campfire.SecureRange))
                m_Valid = true;
            else
                m_Valid = false;

        }

        public bool Valid //=> !Fire.Deleted && Fire.Status != CampfireStatus.Off && Player.Map == Fire.Map && Player.InRange(Fire, Campfire.SecureRange);
        {
            get
            {
                return this.m_Valid;
            }
        }
i really dont think its working the way it should.... not sure how your code format works so im at a loss
This format stumps me and my ServUO.Exe Compile:
        public PlayerMobile Player => m_Player;

Wow, yeah, this is a lot to work with. I'm gonna try to work out what's going on here. It's weird because your code shows:
ServUO - [https://www.servuo.com] Version 0.5, Build 7478.41612
and I'm running the same version. It's odd that so many errors popped up off the bat.

As for the example you gave:
public PlayerMobile Player => m_Player;

This is just how I pass the private value 'm_Player' into the public variable Player.

That expression '=>' wasn't something I had actually encountered until I downloaded my version of ServUO.

Did you get it all to compile, or are just getting hit with more errors?
 

Espcevan

Gold Donator
Apr 21, 2015
68
31
18
32
www.UOAccess.com
Shard Name
UOAccess
I got it all to compile, but I don't think what i did with the m_Valid is right.

When I add the OutpostCamp it puts down an unused tile I can't delete and then the fire pops up.
 

Massapequa

Citizen
Apr 28, 2020
15
12
3
New York
So, The unused tile is supposed to be there actually. I know it's counter intuitive, but it's not visible to players and is just supposed to be the base from which the other stuff spawns... However, you should be able to delete the unused tile. The point in the invisible unused tile "is" the camp, and the other items are created around it. deleting the unused tile should delete the whole camp.
Now that I type it out, it sounds strange and I probably should have clarified the functionality in the main post.
Post automatically merged:

Hope that cleared things up with the unused tile lol.
As far as your changes to Valid, it looks good to me. It's just supposed to be true if the campfire is not deleted, not extinguished and the player is in range, which is exactly what you did.
 
Last edited:

Espcevan

Gold Donator
Apr 21, 2015
68
31
18
32
www.UOAccess.com
Shard Name
UOAccess
So, The unused tile is supposed to be there actually. I know it's counter intuitive, but it's not visible to players and is just supposed to be the base from which the other stuff spawns... However, you should be able to delete the unused tile. The point in the invisible unused tile "is" the camp, and the other items are created around it. deleting the unused tile should delete the whole camp.
Now that I type it out, it sounds strange and I probably should have clarified the functionality in the main post.
Post automatically merged:

Hope that cleared things up with the unused tile lol.
As far as your changes to Valid, it looks good to me. It's just supposed to be true if the campfire is not deleted, not extinguished and the player is in range, which is exactly what you did.
Yes it did make sense why, but I still cant delete the unused tile. doesnt allow me to delete it and if I [props it, it only shows the ground tile.

Would it be possible to do something like the XML spawner and have the camp be a hidden item that spawns the stuff?

Also:
I downloaded the latest ServUO Git and this compiles fine from the start with no edits needed. For some reason my version of the Server files doesnt allow it to recognize that format of code​
Post automatically merged:

[area remove where basemulti
was able to remove it
Post automatically merged:

Also ALSO...
IF you put it on an XMLSpawner that works too
 
Last edited:

Massapequa

Citizen
Apr 28, 2020
15
12
3
New York
Yes it did make sense why, but I still cant delete the unused tile. doesnt allow me to delete it and if I [props it, it only shows the ground tile.

Would it be possible to do something like the XML spawner and have the camp be a hidden item that spawns the stuff?

Also:
I downloaded the latest ServUO Git and this compiles fine from the start with no edits needed. For some reason my version of the Server files doesnt allow it to recognize that format of code​
Post automatically merged:

[area remove where basemulti
was able to remove it
Post automatically merged:

Also ALSO...
IF you put it on an XMLSpawner that works too

That's really strange that it won't let you target the tile...
But yeah, putting on a spawner is a definitely good option. That way you can just delete it all from there.

Sorry about the delayed response and I'm stoked you were able to get that all figured out.
Is everything working okay now?
 

PyrO

Moderator
Jan 27, 2015
1,315
170
63
Your changes to Valid are ... not valid :D

all you would have to do is

C#:
public bool Valid
{
    get
    {
        return !Fire.Deleted && Fire.Status != CampfireStatus.Off && Player.Map == Fire.Map && Player.InRange(Fire, Campfire.SecureRange);
    }
}
And well it doesnt really matter what ServUO version it is since that comes from a higher / newer C# Version

---

To clarify why it is not valid what you did:

You defined a variable in CampfireEntry and then only set it on creation (in the Constructor)
therefor the value wasnt reflecting the actual state.
 
  • Like
Reactions: Massapequa

Espcevan

Gold Donator
Apr 21, 2015
68
31
18
32
www.UOAccess.com
Shard Name
UOAccess
That's really strange that it won't let you target the tile...
But yeah, putting on a spawner is a definitely good option. That way you can just delete it all from there.

Sorry about the delayed response and I'm stoked you were able to get that all figured out.
Is everything working okay now?
Yeah everything's okay now and working.

Your changes to Valid are ... not valid :D

all you would have to do is

C#:
public bool Valid
{
    get
    {
        return !Fire.Deleted && Fire.Status != CampfireStatus.Off && Player.Map == Fire.Map && Player.InRange(Fire, Campfire.SecureRange);
    }
}
And well it doesnt really matter what ServUO version it is since that comes from a higher / newer C# Version

---

To clarify why it is not valid what you did:

You defined a variable in CampfireEntry and then only set it on creation (in the Constructor)
therefor the value wasnt reflecting the actual state.
Thank you, that works :D
 

Nytewyrm

Citizen
Jun 3, 2014
27
0
1
37
Mesa, Arizona
Shard Name
warzone
I didnt see anywhere in here, but would it be possbile to add to the campfire, such as AnvilForge or any other Items, could you explain how to add stuff to the camp fire this would be perfect for Tradeskillers or miners moving around the world but need to smelt Items I love this idea and concept and this would be amazing to add to. I am not a super good coder but if you could explain how to add to it especially the gump part that would be great!
 

Massapequa

Citizen
Apr 28, 2020
15
12
3
New York
I didnt see anywhere in here, but would it be possbile to add to the campfire, such as AnvilForge or any other Items, could you explain how to add stuff to the camp fire this would be perfect for Tradeskillers or miners moving around the world but need to smelt Items I love this idea and concept and this would be amazing to add to. I am not a super good coder but if you could explain how to add to it especially the gump part that would be great!
Yeah, this is a cool idea. If you wanted to add an anvil and forge to the camp you'd have to edit the OutpostCamp.cs file and probably the OutpostGump.cs file as well.
Since Anvil and Forge are already in the game with all the functionality you'd need, you wouldn't need to make custom items.

The OutpostCamp.cs addition would look something like this:

Code:
    public Item m_Forge;
    public Item m_Anvil;


    public void AddAnvilAndForge()
    {
        Forge forge = new Forge();
        m_Forge = forge;
        AddItem(fire, -4, 7, 0);

        Anvil anvil = new Anvil();
        m_Anvil = anvil;
        AddItem(fire, -3, 7, 0);
    }
in the Reset() Method put:

Code:
            if(target is Anvil)
            {
            m_Anvil = target;
            m_Anvil.Delete();
            m_Anvil = null;
            }
            if(target is Forge)
            {
            m_Forge = target;
            m_Forge.Delete();
            m_Forge = null;
            }
in the CheckDecay() Method:

Code:
        if(m_Anvil != null)
        {
            m_Anvil.Delete();
            m_Anvil = null;
        }
        if(m_Anvil != null)
        {
            m_Anvil.Delete();
            m_Anvil = null;
        }
Then you'd probably want to add the AddAnvilAndForge method to another button on OutpostGump.cs

When I get more time, I can probably put something together and make sure it works alright.
Thanks for the input, I appreciate it!
 

LordFenris

Knight
Jul 21, 2014
549
22
18
43
@Massapequa

With the new server build engine mechanism (compilator), we encountered numerous problems with custom files - which had not occurred before. I mean the current state # 4835 - compared to the version before the compiler mechanics changes.
Warning are reported in the area of Your Camping/Outpost system. I am attaching the full log from the compilation attempt (with part of Your system log).

Compile ServUO for Windows

Press any key to continue . . .

C:\ServerUO\UOMGGameTEST>dotnet build -c Release
Microsoft (R) Build Engine version 16.7.0-preview-20360-03+188921e2f for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

Determining projects to restore...
Restored C:\ServerUO\UOMGGameTEST\Ultima\Ultima.csproj (in 167 ms).
Restored C:\ServerUO\UOMGGameTEST\Server\Server.csproj (in 167 ms).
Restored C:\ServerUO\UOMGGameTEST\Scripts\Scripts.csproj (in 167 ms).
Ultima -> C:\ServerUO\UOMGGameTEST\Ultima\bin\Release\Ultima.dll
Server ->

Custom\Camping Items\Gumps\OutpostGump.cs(14,19): warning CS0414: The field 'OutpostGump.HasTent' is assigned but its value is never used [C:\ServerUO\UOMGGameTEST\Scripts\Scripts.csproj]

Time Elapsed 00:00:10.10

Press any key to continue . . .
 

sheivan

Citizen
Jul 17, 2019
19
1
3
Errors:
+ Items/Functional/Campfire.cs:
CS0101: Line 15: The namespace 'Server.Items' already contains a definition for 'Campfire'
CS0101: Line 182: The namespace 'Server.Items' already contains a definition for 'CampfireEntry'
CS0101: Line 8: The namespace 'Server.Items' already contains a definition for 'CampfireStatus'
CS0111: Line 22: Type 'Campfire' already defines a member called '.ctor' with the same parameter types
CS0111: Line 34: Type 'Campfire' already defines a member called '.ctor' with the same parameter types
CS0111: Line 87: Type 'Campfire' already defines a member called 'GetEntry' with the same parameter types
CS0111: Line 92: Type 'Campfire' already defines a member called 'RemoveEntry' with the same parameter types
CS0111: Line 98: Type 'Campfire' already defines a member called 'OnAfterDelete' with the same parameter types
CS0111: Line 106: Type 'Campfire' already defines a member called 'Serialize' with the same parameter types
CS0111: Line 113: Type 'Campfire' already defines a member called 'Deserialize' with the same parameter types
CS0111: Line 122: Type 'Campfire' already defines a member called 'OnTick' with the same parameter types
CS0111: Line 170: Type 'Campfire' already defines a member called 'ClearEntries' with the same parameter types
CS0111: Line 188: Type 'CampfireEntry' already defines a member called '.ctor' with the same parameter types
Scripts: One or more scripts failed to compile or no script files were found.


Does this mean I have to edit or remove servuos original ''Campfire'' if it exists?
Ty

Also, I didnt get to try it yet so I was wondering, does the campsite wipes after a certain time or does the player always own it?