project #1: help this game

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
needmoreplayers
Posts: 67
Joined: November 17th, 2023, 7:33 pm

project #1: help this game

Post by needmoreplayers »

who: for coders that play this game, and also has a full understanding of the problems that many players have with the game

goal: fixing one of the biggest problem with this game

how: there are many many different ways to do it, have no idea which is the easiest code way of doing it since dont know code




first wesnoth project, going to do this until its completed

this is the 'dagger blood' code: viewtopic.php?p=685309#p685309

assuming this is all lua code

goal: goal is to edit this code and make it into an addon so it'd would work on any campaigns/maps wesnoth has

assuming this should be kinda simple and not too hard since the code seems kinda short



step 1 - copying the code into a software

i put this code into an app specific to code stuff. app colors the code/text

this is what ive been able to gather about what the colors mean so far:

-- light blue = keywords
-- dark blue = seems to be ?? keywords

--gold = more keyword stuff
-- purple = seems be to be needed logic types of keywords

--red = editable shiit, text # stuff, think coder geeks call this stuff 'strings' or something so weird
--green comemnts sht, this sit is green wooh


first problem
first and biggest problem is i cant tell which of the text are A) code keywords and which are them are B) 'editable normal english text, that you can change and it wont affect how the code works and what the code is doing



step 2 - understanding which are code keywords and which text are not code

for example wesnoth.effects.wc2_unitmarker (gold color) does not show as a code keyword, so i cant tell if this is code or not

wesnoth.require shows up on

ref: https://wiki.wesnoth.org/LuaAPI/wesnoth

but what is this page exactly, is this:

- showing all lua code that works anywhere lua works in?
- showing all lua code that specifically only works in wesnoth?
- wml?
- or none of these


step 3 - understanding more

another example is img_is_special_overlays

this doesn't show up anywhere so i cant tell if its a code keyword
or if its editable english text that you can change and it wont affect how the code works and what the code is doing


step 4 -

this link says to use lua code in wesnoth you need use [lua]

ref: https://wiki.wesnoth.org/LuaAPI

but nowhere in the dagger blood code is there any [lua]

so am confuse what in the code is making this code work if it doesnt have [lua]

ie "For information on how to tell the engine about your Lua code, see LuaWML."


step 5

goal is to fully or near fully understand the dagger blood code, why it works, and what makes it work
then later can adjust things



extra bonus goal
with the code, besides making it work as an addon for any campaign/maps, the main small thing is going to change the 'dagger' to (likely) a star or something

finding or making an image for the star should be pretty easy compare to the code stuff
Last edited by needmoreplayers on December 30th, 2023, 5:55 pm, edited 5 times in total.
gnombat
Posts: 710
Joined: June 10th, 2010, 8:49 pm

Re: dagger blood: first wesnoth project

Post by gnombat »

needmoreplayers wrote: December 18th, 2023, 10:39 am first wesnoth project, going to do this until its completed
This seems like an awfully complicated project for a beginner.
needmoreplayers wrote: December 18th, 2023, 10:39 am goal: goal is to edit this code and make it into an addon so it'd would work on any campaigns/maps wesnoth has

assuming this should be kinda simple and not too hard since the code seems kinda short
The length of the code is not really a good way of estimating the complexity of it.

There are campaigns which have thousands of lines of code, yet most of it is just straightforward dialogue and story text, so it may still be fairly simple overall.

On the other hand, there are pieces of code which may be only a few lines long but have complex logic and require a thorough understanding of the internals of Wesnoth - which is what this project looks like...
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: dagger blood: first wesnoth project

Post by gfgtdf »

I agree thats its not n easy code, especially for someone that has little experience with programming, Ill still try to answer your questions

needmoreplayers wrote: December 18th, 2023, 10:39 am
i put this code into an app specific to code stuff. app colors the code/text
The color are different on each editor, so we cannot tell you how your particular editor colors the syntxa
needmoreplayers wrote: December 18th, 2023, 10:39 am first and biggest problem is i cant tell which of the text are A) code keywords and which are them are B) 'editable normal english text, that you can change and it
I dont't know that "normal english text" means, but nasicialyl everythign in that file is code and effects what teh code is doing, even if they are not lua keywords
needmoreplayers wrote: December 18th, 2023, 10:39 am wesnoth.require shows up on

ref: https://wiki.wesnoth.org/LuaAPI/wesnoth

but what is this page exactly, is this:

- showing all lua code that works anywhere lua works in?
- showing all lua code that specifically only works in wesnoth?
- wml?
- or none of these
that'S explained in https://wiki.wesnoth.org/LuaAPI/
needmoreplayers wrote: December 18th, 2023, 10:39 am

this link says to use lua code in wesnoth you need use [lua]

The [lua] block is in https://github.com/wesnoth/wesnoth/blob ... #L146-L148
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
needmoreplayers
Posts: 67
Joined: November 17th, 2023, 7:33 pm

?

Post by needmoreplayers »

this project

this is an open source project/game

so assuming there has to be many or at least more than 1 person that understand fully this code?

and not only the person or persons of the past that made this code/and game feature - that only works within 1 map currently



the whole point of open source is so others can build on top of and make things better

is code really that complicated to understand? there are indies (of single people) that make amazing games within the span of 24 hours to 2 years

so something that is just 1 small game feature shouldn't be that hard to understand?

but if it is, not sure why whoever made the code/and tech used for the game in the first place had made it so hard to understand the code/tech for a project/game that was meant to be open source ?

the whole point of open source in code, and anything else, is so everyone else can build and change things and make things better



if there are at least more than 1 person that understand fully this code, they would ofc do things to make this game better instead of this feature only working within 1 map only

its confusing that the person or persons that made this code didnt explain anything in the code that was made for a project/game that is open source

how would anyone else in the future make this game better if that person or persons didnt explain anything?

everyone else that actually made things better in this world actually explained things, from the scientists to whoever else including the people that made social progress in different societies

they didnt just leave and not explain anything for everyone else in the future

that wont make sense if anyone did that, imagine if everyone in society and the world did that, those societies would be very unfortunate to exist in



it does not make any sense if there were people skilled in this coding stuff but not using those skills to make things better

that does not make any sense to me

everyone else that actually made things better in this world actually explained things, from the scientists to whoever else including the people that made social progress in different societies

they all wrote books (that i think anyone can understand) about it
gnombat
Posts: 710
Joined: June 10th, 2010, 8:49 pm

Re: ?

Post by gnombat »

needmoreplayers wrote: December 19th, 2023, 1:01 pm is code really that complicated to understand? there are indies (of single people) that make amazing games within the span of 24 hours to 2 years
Those are obviously experienced programmers...
needmoreplayers wrote: December 19th, 2023, 1:01 pm so something that is just 1 small game feature shouldn't be that hard to understand?
Well, you've looked at (some of) the code - do you understand any of it? :lol:

Most people get started developing for Wesnoth by creating a simple single-player campaign - nothing fancy, just a few scenarios of elves fighting in the forest or something similar. Why don't you try developing something like that?
User avatar
Ravana
Forum Moderator
Posts: 3031
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: dagger blood: first wesnoth project

Post by Ravana »

The fact that someone understands it does not mean that the person is interested to do it for you.
User avatar
dipseydoodle
Posts: 879
Joined: September 16th, 2008, 10:26 pm

Re: dagger blood: first wesnoth project

Post by dipseydoodle »

needmoreplayers wrote: December 18th, 2023, 10:39 am this is the 'dagger blood' code: viewtopic.php?p=685309#p685309

assuming this is all lua code
You are correct, this appears to be Lua code. What it apparently does is creates an overlay for a unit depending on some sort of weapons special or ability presented in the unit (I just skimmed over the code, so I’m probably wrong).

The CX and CY are coordinates—variables/references whatever you want to call them in your case; the “require” implies something is required to exist (a state of a variable or otherwise).

What’s not clear is what you are trying to do. Feel free to PM me directly and I can try to give you pointers, or let me know what you want to do here, and I can try to help you figure it out.
needmoreplayers
Posts: 67
Joined: November 17th, 2023, 7:33 pm

?

Post by needmoreplayers »

sent a msg, can talk on forum too, thanks



still haven't been able to figure this out

guess coding is very extremely hard

guess it wasn't simple or easy after all

making a helpful feature into an addon cant be that hard..... but guess was wrong



but how is it that there's no coders of this wesnoth game who had added gameplay features (that makes the game better for players) in the last month or last year that knows about this code?

didn't know there were other gameplay addons and gameplay features being added into this game in the last month, etc that would cause people to not know about this one, didn't know it was that hard


but why should someone else that didn't make this code or very familiar with it help me with this project of this small thing of making this game better

it hasn't been added to the game yet (even as an addon) so guess nobody knows about this old code, but why is it that there no coders of this game that knows about this code

why is it that someone else that doesn't know about this code needs to help me instead of any coders that already knows about this code?

that's a sad state of things.......................

it's like there's a hospital (or other) problem, but the doctor (or lifeguard) don't know, and someone else has to help me instead of those people that were suppose to helpful



o well guess will just have to keep on this figuring this code out to make this game better...

guess coders do not keep a list of updates

so dont know when this update to that map was added: viewtopic.php?t=39651

i hope whenever i learn coding i dont become like many of them out there in the world, and can be around inspiring people for the whole of my life
User avatar
Heindal
Posts: 1361
Joined: August 11th, 2011, 9:25 pm
Location: Germany, Karlsruhe
Contact:

Re: dagger blood: first wesnoth project

Post by Heindal »

I made campaigns in 24 hours, which are entire games (sloppy games, but who cares) and never touched lua so far, because it is complicated and requires internal knowledge of the wesnoth core. You can not expect the core development team to know about every add-on out there (which are several hundred for this version and several thousand when taking in regard all previous versions).

Wesnoth is great, because it allows you to fool around with your add-on within some limits given by the game. So a lot of people code freely, without the knowledge of the core development and made their own features. I assume most of them haven't even played one of my campaigns, which is absolutely ok. The core development team is working in their free time to run this game and don't need to know about every add-on out there.

Even with wml only, you can code awesome games, I even provided step by step tutorials how to build a scenario/campaign, and I'm not the only one who did this. I started with Trapped and a single scenario, which of cause run into errors when I first started it. Then I figured out, how to solve this by reading and inspecting other add-on.

I'd say: you started with the most complex add-on here. Of course you will not understand this in several minutes. Even so you are an lua expert, you will have some problems figuring out, what the author wanted and why he did things he did to achieve his goal.

Final words: "Improvement" is highly subjective. What you think is an improvement, might be a downgrade for many other players / users. Allowing people / users to change and extend the game in the way you like by coding an add-on is a good compromise.
The future belongs to those, who believe in the beauty of their dreams.
Developer of: Trapped, Five Fates, Strange Legacy, Epical, UR Epic Era
Dungeonmasters of Wesnoth, Wild Peasants vs Devouring Corpses, Dwarf Dwarfson Dwarvenminer
Post Reply