Forum

> > CS2D > Mods > Core 2D
Forums overviewCS2D overview Mods overviewLog in to reply

English Core 2D

13 replies
To the start Previous 1 Next To the start

old Core 2D

Masea
Super User Off Offline

Quote
Greetings people. Here's a very incomplete mod I've been developing recently. Its structure is mostly done, only the content is missing, so one would bring lots of impressions to the CS2D world with a basic Lua knowledge at the least. This is a pretty editable RPG(ish) mod I commenced making with the inspirations I got when watching some Destiny videos. I admired specifically its UI (also heard it is some award-winning piece) and thought shooter-looter would play a really good role in CS2D. And I believe it's been a good 2 months so far. Oddly enough, I am bored tonight! I don't feel like I will be able to finish it, so here it is; I've arranged the last touches and I am actually publishing it with a hope of someone's desire to finish this by themselves!

Fair enough, as I said earlier, its core code appears to be done and if the content anyhow would be added, it should be pretty much playable.

I first called it Destiny, but once I realized it wasn't going to be a complete mimic, I then renamed it as Core without even thinking about its lore. Yes, with all these possibilities I am going to list down below, this mod could have an actual story behind it.

> Features
∗ Items
Items are indispensable of RPGs, so are my mod's. Equipment slots go like Helmet, Breastplate and three types of weapons. I just didn't want to add Pants nor Boots since they're not visible at top-down so I stayed low key. The three weapon types are similar to Destiny. Basic, Heavy and Power. Basic has unlimited ammo but Heavy and Power have collectable ammo drop from mobs. Personally, I was going to make RPGs, Rocket Launchers and Grenade Launchers a Power weapon, while AWP, Scout and XM1014 would be a Heavy and the rest being Basic. This was how I prepared it in my mind but, of course, you can set them however you want. There are some other items too, like consumables and such.
IMG:https://media.discordapp.net/attachments/275670334676533250/625773563240120322/core_00000.png


∗ UI
Thanks to my UI Framework, it has a really powerful menu system where you observe your quests, items in your inventory, your equipment and the map. Players can open the menu by pressing [G] and close it back with the same button. The menu content doesn't show until a half-second passes after the press. If the player presses the button before the half-second passes, the menu closes and content won't be loaded. This is to avoid the spams that would cause lags and frame spikes. It is just that beautiful. Once the content is loaded, the players can browse the other pages of the menu without another loading sequence.
IMG:https://media.discordapp.net/attachments/275670334676533250/625773568294387712/core_00002.png


I've been working so hard for tooltips in CS2D. Like maybe for more than 2 years. And this is the farthest point I could ever take it. It is not laggy and as dynamic as feasible. It automatically scales accordingly to its text content. And you can set its position with values like "top-right", "bottom-left" as well.

∗ Map
There is an actual map in the game. You can see the locations you discovered, NPCs and your quests. Its control scheme is kinda odd to get used to but is improvable. You may even zoom/unzoom and move the map around.
IMG:https://media.discordapp.net/attachments/275670334676533250/625773565576347665/core_00003.png


∗ NPCs
Players can interact with NPCs with space button. They can give players quests or act like vendors. As impressive as it could get, every each NPC can have unique dialogues along with answer opinions that players can choose among. This is called the Dialogue Tree. But to figure out how this precisely runs, you'll most likely need to mess with the code first. However, once you get every single detail of it, it is a really good way of creating a narrative in a game, I believe.

∗ Locations
There are locations which are visible on the map when discovered. When a location is discovered or entered, the players are informed. There are locations types too: Safe, Neutral, Red and Black. This idea comes from Albion Online, where locations act differently by their types. Safe is basically a safe zone, the mobs won't be able to enter or attack you, just like the other players. Neutral is where the mobs appear, and Red & Black locations are PvP zones along with mobs inside, the last two are the most dangerous ones.

∗ Mobs
Needless to say, there are mobs. Unlike Tibia, they are more realistic now. Roaming is more acceptable and they may have more specifications.

∗ Quests
There are even quests, oh boy this never ends. You can create distinctive quests, all having individual segments to accomplish and rewards to have at the end. Controlling them is quite easy too. And this is how you see them on the map:
IMG:https://media.discordapp.net/attachments/275670334676533250/625773551273902122/core_00004.png


And many other features I have no time to express. I am sorry if this mod lacks (which definitely does), but this thread is being published by the fear of the accident where I would forget this mod's very existence; until then I possibly will be improving this mod though. Perhaps you can use this as a prototype, which unearths what is possible and not in CS2D's modding outlines.

This mod can be a receivable product as a sum of the experience of more than 6 years of coding for CS2D. I have learned a bit from everything through my modding experimentations in CS2D, I surprisingly learnt even more when modding this very mod for the last time.

P.S.: I know I should be retarded to release this without a proper document or something, but I really have no time for that. But I give you a word of an erudition service for editing purposes on the contact you make with me. So, say me hi on Discord, will you?

Thank you, and here's a link to the mod before I forget: Google Drive (1 MB~)
edited 2×, last 29.10.19 05:32:36 pm

old Re: Core 2D

Joni And Friends
User Off Offline

Quote
Please make it simple if you want to upload @ us , so everyone can easily edit it or learn it
∗ Just suggestion

old Re: Core 2D

Pagyra
User Off Offline

Quote
It seems I saw this code in an early form.
Reminds me of something familiar

old Re: Core 2D

Gaios
Reviewer Off Offline

Quote
Not a big fan of the code design. You literaly don't really use Programming paradigms and Design patterns. I would recommend you to leave hooks w/o logic and just use functions inside them. You may read about Clean Code and Lua Performance (don't use
in pairs()
) in general.

addhook("always", "core.hooks.always")
. Are you about to develop singleplayer mod?

You may also use cs2d lua cmd closeplayers and cs2d lua cmd hascloseplayers, because it's much faster.

I recomend you to develop in object-oriented programming and modular programming. You already did messy code in eg. functions.lua which contains logic of the whole mod from every module that you implemented.

old Re: Core 2D

Grand Master
User Off Offline

Quote
I saw this code before also I know where, but whatever I would do same if it was by me. Thanks for uploading it anyway.

old Re: Core 2D

Masea
Super User Off Offline

Quote
@user Joni And Friends: In my opinion, it is as simple as it could get, I am sorry.

@user Pagyra: This code began being made 2 months ago. It shouldn't remind you anything.

@user Gaios: I knew you were going to say something like that. When it comes to arguing with you about codes, it is just getting tough. Nevertheless, thank you for your feedback.

I think I first saw OOP like a year ago. I then tried to make something with it but never managed to get used to that. OOP is an opinion after all, and not everyone has to choose that opinion. Even if it is better.

functions.lua, I know, is quite a mess but that's because I use it as a library. And for god's sake, don't judge me with that file, see the actual thing.

Quote
I would recommend you to leave hooks w/o logic and just use functions inside them.

Lol. I really had been using this method a while ago and you know what? It has no benefit to performance at all rather than it is just a cleaner way. Which I just screwed up for this mod.

Quote
don't use in pairs()
I can't stop using that, it is more understandable for me, even if it has an impact on the performance.

@user Grand Master: What? Can you tell me exactly where you saw this code before? Because I really would like to know that intel. This code has been on my computer for 2 months and never been anywhere else except here.

old Re: Core 2D

G3tWr3ck3d
User Off Offline

Quote
@user Gaios: A couple of these Lua Performance tests are just flat out wrong and not testing what the author thinks they are.
On test 13, the second sample allocates ten million more tables than the first one. The author says something handwavy about "static initializers", but the two samples of code are actually doing two very different things, where one creates creates a bunch of entries pointing at a single table and the other creates a bunch of entries pointing at different tables with the same contents. If the subsequent code ever modifies the tables, the results are very different. Following this optimization advice will introduce bugs.
@user Masea: Most Lua code won't come so close to the performance limits that these modifications will matter. It is much more important to save programmer time than processor time in most cases. So don't follow that, make the code clear so that programmers save time, and don't sweat a few microseconds here or there unless you have a compelling need.

old Re: Core 2D

Masea
Super User Off Offline

Quote
user G3tWr3ck3d has written
@user Masea: Most Lua code won't come so close to the performance limits that these modifications will matter. It is much more important to save programmer time than processor time in most cases. So don't follow that, make the code clear so that programmers save time, and don't sweat a few microseconds here or there unless you have a compelling need.
If you're not trolling, and if I get it right, you try to tell me that I could have coded it clearer. That's definitely true, in fact, everything could be clearer no matter how clear they're. The reason behind the fact I couldn't make it clearer is because I didn't want to seek for perfection and instead just go and do it. Otherwise, I'd be consuming all my time on speculating about how this part of code would be better, which makes no sense for a mod developed for CS2D and if you haven't sufficient time. Perhaps this is a bad approach, it is just that I wanted to create a mod and didn't want to keep it in one of my folders for nothing.
To the start Previous 1 Next To the start
Log in to reply Mods overviewCS2D overviewForums overview