This is awesome man thank you!

A great framework to start on. So what ones are disabled right now due to no event sinks?

It looks like Discovery is one of them.
[doublepost=1474738119][/doublepost]Okay so a bug.

Kill 5 dogs restart and BOOM achievement is gone.

After this point can no longer gain that achievement. Tried with both the Achievement memory stone added and removed.
[doublepost=1474738373][/doublepost]Nevermind.

Add stone first,

Restart,

then play around with it.
 
yeah far as I know it saves the tasks but I cant figure out the null crash with the discovery one .

The discovery one works and all. but if a player logs out in any region the shard crashes with a null.
 
I get error: im using runuo2.2



KUSTOM/Achievement System/Gumps/AchievementGump.cs:
CS0241: Line 13: Default parameter specifiers are not permitted

This is the method causing the error:

Code:
public AchievementGump(Dictionary<int, AchieveData> achieves, int total,int category = 1) : base(25, 25)


Any clue? thanks
 
With all the event sinks and stuff too, it has been years since I looked at RunUO. I am sure it can be modified to work but will most likely have to be done by those who use RunUO still.
 
Any scripts can be adapted to work with ServUO. I haven't had time to look at this yet to figure out the null issue, but my guess is never letting it result in a null value is a step in the right direction.

@sahisahi I don't know exactly what is causing your error, but if I have time to look at this system (or anyone else for that matter), I'm sure it can be fixed.
 
It is a very nice drag and drop system but it needs a little TLC. The gump closes at random ect.
 
The error just comes from the old version of net framework that is set in runuo 2.2, so the issue is "int category =1". So remove the =1 and I guess you will need to adjust the script further since it may not actually set the category in some places
 
It is a very nice drag and drop system but it needs a little TLC. The gump closes at random ect.
Ha! Yeah, I've run into situations like that with a lot of the old scripts in my archives!

If someone doesn't beat me to it, I'll get around to updating this in the future ;)
 
Would be awesome! Ill work on adding more quests too. A drag and drop achievement system would be awesome.
 
The error just comes from the old version of net framework that is set in runuo 2.2, so the issue is "int category =1". So remove the =1 and I guess you will need to adjust the script further since it may not actually set the category in some places


I did what you said, now im getting 3 errors:


Errors:
+ KUSTOM/Achievement System/AchieveTypes/DiscoveryAchievement.cs:
CS0246: Line 33: The type or namespace name 'OnEnterRegionEventArgs' could n
ot be found (are you missing a using directive or an assembly reference?)
+ KUSTOM/Achievement System/AchieveTypes/HarvestAchievement.cs:
CS0246: Line 17: The type or namespace name 'ResourceHarvestSuccessEventArgs
' could not be found (are you missing a using directive or an assembly reference
?)
+ KUSTOM/Achievement System/AchieveTypes/ItemCraftedAchievement.cs:
CS0246: Line 18: The type or namespace name 'CraftSuccessEventArgs' could no
t be found (are you missing a using directive or an assembly reference?)
 
runuo doesn't have them eventsinks. if you look at where the eventsinks are in the core and add them to you runuo core then the system should work but make sure you do them the way the event sinks are set up/

Well I'm glad people our willing to jump in and expand on these I think its a nice little drag and drop system that doesn't require veta nex or any other scripts.

if you call make new event sinks please share I was going to work on these my self but I have other projects that I think is more importin then a achievement system that makes uo like any other game., but hell if I find a fix or a bug ill try my bets to help out.
 
runuo doesn't have them eventsinks. if you look at where the eventsinks are in the core and add them to you runuo core then the system should work but make sure you do them the way the event sinks are set up/

Well I'm glad people our willing to jump in and expand on these I think its a nice little drag and drop system that doesn't require veta nex or any other scripts.

if you call make new event sinks please share I was going to work on these my self but I have other projects that I think is more importin then a achievement system that makes uo like any other game., but hell if I find a fix or a bug ill try my bets to help out.

Im not good at scripting, i wish i could fix it for runuo
 
I stand corrected. I was unaware this setup would require Core modifications (edits to Server files). My original Core was damaged years ago, so I can recompile mine, which means I could never install a system like this.

So, I guess my question is now:
Is it possible to make "core" edits without recompiling the core, i.e. could a system like this be installed by adding the EventSink in for each achievement, right in the Achievement Type script?
 
It does not need core mods if using newest SVN of ServUO. It is strictly drag and drop.
 
The Script that is in question belongs to darklotus.
Here is a peace of the conversation we had :)

Also You want to delete the skills and and item crafted achievments he told me that something runuo has that servuo don't . Got to do with event sink.

darklotus said...
"Entire system is mostly just a proof of concept, since i saw so many people looking for a system like this and no one was sharing, so i figured a base to start from would help.
Im happy to accept fixes and additions on github from anyone for the system. Hopefully have time one day to flesh it out a bit more and add some more documentation."
 
the only event sink we are missing is the skill ones we have the craft event sink already. also thanks for finding who made these syste that helps as I remember downloading it but wasn't sure who did it.
[doublepost=1475100363][/doublepost]also note I checked runuo GitHub they do not have skill event sink.
 
Here is the crash for the Discovery one

Code:
RunUO Version 0.5, Build 6092.27866
Operating System: Microsoft Windows NT 6.2.9200.0
.NET Framework: 4.0.30319.42000
Time: 9/27/2016 12:16:09 AM
Mobiles: 43486
Items: 229230
Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
   at Scripts.Systems.Achievements.DiscoveryAchievement.EventSink_OnEnterRegion(OnEnterRegionEventArgs e)
   at Server.OnEnterRegionEventHandler.Invoke(OnEnterRegionEventArgs e)
   at Server.EventSink.InvokeOnEnterRegion(OnEnterRegionEventArgs e)
   at Server.Region.OnRegionChange(Mobile m, Region oldRegion, Region newRegion)
   at Server.Mobile.UpdateRegion()
   at Server.Mobile.SetLocation(Point3D newLocation, Boolean isTeleport)
   at Server.Mobiles.PlayerMobile.SetLocation(Point3D loc, Boolean isTeleport)
   at Server.Mobile.Move(Direction d)
   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)


Could we also get a link to the GitHub repository this came from? I would push updates. I already added about 50 more Achievements as well as made sub categories for Crafting and Resource Gathering.
 
The error just comes from the old version of net framework that is set in runuo 2.2, so the issue is "int category =1". So remove the =1 and I guess you will need to adjust the script further since it may not actually set the category in some places
The errors you see will be because im using C#6 language features not due to old .net featureslol.
You need to build Script.CS.dll in visual studio to use C#6 stuff or else go thru and remove any C#6 language stuff like property default values and such.


Here is the crash for the Discovery one
Could we also get a link to the GitHub repository this came from? I would push updates. I already added about 50 more Achievements as well as made sub categories for Crafting and Resource Gathering.
If you set a break point you will find servUO is calling OnEnterRegionEventHandler with a null region, just add a check for that should solve your crash.



The achievement saving system also uses a modified player mobile by default and you need to change the #define to swap it to saving data on an item.

It's had basic testing on runuo 2.0 and a newish servUO, but that was a few months ago.

I made it public as an example for how an achievement system could be done, with just some sample discovery types, you could add any type you would by creating a new class extending BaseAchievment.

I would rather you just direct people to the github than host a download as it would promote more people contributing bug fixes etc back to it. Happy to accept any pull requests etc.

If theres any code that isnt self descriptive please let me know and ill add some comments etc.
 
The achievement saving system also uses a modified player mobile by default and you need to change the #define to swap it to saving data on an item.
Hey DL, do you have the modified playermobile, as it is not included, even on GitHub?
 
you just uncomment line #1 in AchievmentSystem.cs to store info on an item instead but if you do want to use your own playerMobile you need the below.

Code:
internal Dictionary<int, AchieveData> Achievements = new Dictionary<int, AchieveData>();
public int AchievementPointsTotal { get; set; }

Serialize Method
Code:
            writer.Write(AchievementPointsTotal);
            writer.Write(Achievements.Count);
            foreach (var kv in Achievements)
            {
                writer.Write(kv.Key);
                kv.Value.Serialize(writer);
            }

Deserialize Method
Code:
            AchievementPointsTotal = reader.ReadInt();
            int count = reader.ReadInt();
            if(count > 0)
            {
                for(int i = 0; i < count;i++)
                {
                    Achievements.Add(reader.ReadInt(), new AchieveData(reader));
                }
            }
 
it was mainly designed and tested on runuo 2.0 which is why i didnt use XML Saving.

Not all achievement types will work without adding the missing event-sinks though, so either copy how they are implemented in servuo and implement them in your runuo or remove those achievement types.
 
I would rather you just direct people to the github than host a download as it would promote more people contributing bug fixes etc back to it. Happy to accept any pull requests etc.

If theres any code that isnt self descriptive please let me know and ill add some comments etc.

@Frosttiger - Please remove resource download and place a link to his Github as request by repo owner.
 
I can do that thanks for every one helping out like I said I just downloaded it off a site wasnte sure who the owner was. reason didn't take credit but figured people been asking.

download removed
 
I can do that thanks for every one helping out like I said I just downloaded it off a site wasnte sure who the owner was. reason didn't take credit but figured people been asking.

download removed

Sorry if I sounded bad, I totally appreciate you bringing it to the community! I just wanted to make sure we respect his wishes.
 
The github has been updated, should build with no issues now on servuo.

There is a bug in the code to display sub categories though which ill get fixed next time im free.
 
  • Like
Reactions: Dan
where exactly do you make these changes to playermobile? i have 36 different case of serialization and theres no how to or moded playermobile
 
where exactly do you make these changes to playermobile? i have 36 different case of serialization and theres no how to or moded playermobile
Only one of those 36 cases are invoked, you want to modify the one that is used, or bump the version and add a new case to handle the added information. It's the same as adding any new value to be serialized on an existing class.

To be honest this code was published just as an idea of how i saw an achievement system being implemented, It's pretty useless if your not comfortable with C#.

@Canar, I dont think anyone can help you if you dont explain your problem. It's like me calling a mechanic and saying my car doesnt work. He cant help if he doesnt have some details.

The error you get could be helpful...
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back