
EDuke32 Scripting "CON coding help"
#2333 Posted 30 September 2018 - 03:18 PM
CON does have a huge number of commands which often do complex things. Want some money sprites to spawn and float realistically to the ground? Easy: use the money command. Want to make an earthquake? Easy: use the quake command. And so on. Those sorts of commands are like a vending machine -- you just press the right button and the thing you want comes out, already packaged for you. But in addition to the vending machine, CON also has a kitchen fully stocked with raw ingredients where you can make pretty much anything you want.
I think some people get caught up on the convenience of the vending machine and never learn how to cook. If you are making a mod that has non-trivial coded features, you should learn how to cook.
#2334 Posted 30 September 2018 - 04:30 PM
Trooper Dan, on 30 September 2018 - 03:18 PM, said:
Programming can be a very scary thing for some people. I've seen professional designers get scared, looking at scripting systems like Lua, but work just fine in a visual script language such as UE4 Blueprint. CON coding can be intimidating for people that want to do design work.
Is there a library somewhere with a bunch of general use CON script functions, that anyone can just grab and include in there projects? I've seen people put some fantastic things together, when they have something just above "raw ingredients".
This post has been edited by icecoldduke: 30 September 2018 - 04:34 PM
#2335 Posted 30 September 2018 - 05:20 PM
icecoldduke, on 30 September 2018 - 04:30 PM, said:
No, there should be a library like that, but there isn't. So each of us who has done a lot of scripting has essentially built our own library. One complication is that CON does not allow local variables. So, if my function uses a variable named "TEMPVAR", then it won't compile in your project unless you have a variable of that same name. I could include the variable declaration with my provided function, but then your project will have that global variable in it, just because you use my function. Worse, you might already have a variable of that name but with different flags, so it will actually conflict and not work the same. Another issue we used to have is that you couldn't append new event code. So, if I wanted to share something cool to do in EVENT_GAME, the user would have to know how to integrate it with any existing EVENT_GAME code they may have.
Given the obstacles and how few people are using the scripting language at any given time, it just never seemed worth it to try to make a public library.
#2336 Posted 30 September 2018 - 07:08 PM

#2337 Posted 30 September 2018 - 07:31 PM
Mark, on 30 September 2018 - 07:08 PM, said:

Man that would be awesome - I've been trying to get my head around CON coding these last few weeks and I'm finding the learning curve VERY steep!
#2338 Posted 30 September 2018 - 07:42 PM
conoklast, on 30 September 2018 - 07:31 PM, said:
i wouldn't even try to figure out con aside from changing sounds & episodes/maps. Some of the effects people pull off are pretty amazing.
Gotta be dedicated to learn it.
The major downside to me seems like eduke32 updates are always inadvertently breaking things. Pretty good deterrent for someone with a lack of patience.
This post has been edited by Forge: 30 September 2018 - 07:48 PM
#2339 Posted 30 September 2018 - 07:48 PM
#2340 Posted 30 September 2018 - 07:52 PM
nvm, I did not know this existed
http://wiki.eduke32.com/wiki/Scripting
people should read this & the references first, & show the code they tried to use - before they ask questions
I can kinda see Dan's point now. Asking "how do I...", instead of, "I did...but I didn't get the results I wanted" are two different things.
Almost reminds me of those people that used to randomly show up and declare some massive project and wanting everyone to join - to do all the work for them so they can sit back and see their vision come to life with zero effort on their part.
This post has been edited by Forge: 30 September 2018 - 08:02 PM
#2341 Posted 30 September 2018 - 07:55 PM
This post has been edited by Mark: 30 September 2018 - 07:56 PM
#2342 Posted 30 September 2018 - 09:37 PM
#2343 Posted 01 October 2018 - 12:38 AM
Mblackwell, on 30 September 2018 - 09:37 PM, said:
Yes, and that's very useful.
Note that I was careful to use the past tense in my post and said we "used to" not be able to append events.
#2344 Posted 01 October 2018 - 06:12 AM
Forge, on 30 September 2018 - 07:42 PM, said:
Gotta be dedicated to learn it.
The major downside to me seems like eduke32 updates are always inadvertently breaking things. Pretty good deterrent for someone with a lack of patience.
I have no intention of writing custom scripts, I just want to be able to understand chunks of other people's code so that I can adapt it for my own TC... but yes even to get an elementary understanding is testing my dedication
#2345 Posted 01 October 2018 - 06:38 AM
Mark, on 30 September 2018 - 07:55 PM, said:
Con coders like to flaunt their knowledge, not write tutorials.

exhibit 1A:
Trooper Dan, on 30 September 2018 - 03:08 PM, said:
Sure. But do you know how to field-dress a deer?
This post has been edited by Forge: 01 October 2018 - 06:40 AM
#2346 Posted 01 October 2018 - 07:35 AM
Trooper Dan, on 30 September 2018 - 03:18 PM, said:
CON does have a huge number of commands which often do complex things. Want some money sprites to spawn and float realistically to the ground? Easy: use the money command. Want to make an earthquake? Easy: use the quake command. And so on. Those sorts of commands are like a vending machine -- you just press the right button and the thing you want comes out, already packaged for you. But in addition to the vending machine, CON also has a kitchen fully stocked with raw ingredients where you can make pretty much anything you want.
I think some people get caught up on the convenience of the vending machine and never learn how to cook. If you are making a mod that has non-trivial coded features, you should learn how to cook.
That's true, but the wikia is not as exhaustive as it could have been. For comparison, when creating Cosmetic Doom I barely asked the community any questions regarding coding, since the zDoom wikia is packed with all the information one could need. Yes, I am constantly looking at mods and their code if they have features that interest me, but that alone can only get one so far.
conoklast, on 01 October 2018 - 06:12 AM, said:
This x 100.
This post has been edited by December Man: 01 October 2018 - 07:39 AM
#2347 Posted 01 October 2018 - 10:15 AM
#2349 Posted 01 October 2018 - 11:20 AM
#2350 Posted 01 October 2018 - 12:32 PM
Trooper Dan, on 01 October 2018 - 10:15 AM, said:
Thank you very much.
Mblackwell, on 01 October 2018 - 10:56 AM, said:
Yes, but the fact that you had to learn it the hard way does not mean that everyone else should. Expanding the wiki could potentially expand the community as well and the mod quantity / quality.
#2351 Posted 01 October 2018 - 12:48 PM
December Man, on 01 October 2018 - 12:32 PM, said:
Yes, but....
People should also take it upon themselves to try things out and be willing to experiment and learn the hard way, instead of being spoon-fed the answers and not really learning anything except how to ask someone to do it for them.
give a person a fish vs. teaching them to fish, blah-blah-blah......
try first, ask second
This post has been edited by Forge: 01 October 2018 - 12:49 PM
#2352 Posted 01 October 2018 - 12:50 PM
Here's the main page of the scripting wiki:
https://wiki.eduke32.../wiki/Scripting
It starts by linking to some old guides which cover the basics of the scripting language from the 1996 version (which is still applicable to the enhanced version). It then talks about important enhancements and how to use them, including game variables, game structures, game events, and formatting. At the top there are links to documentation on the various commands, events and structures within the game.
Everything I listed above could be improved. But, for those of us who are already familiar with the system, it's not obvious what the biggest deficiencies are. If people want to chime in about what most needs improvement, that would be helpful.
#2353 Posted 01 October 2018 - 01:18 PM
#2354 Posted 01 October 2018 - 01:43 PM
December Man, on 01 October 2018 - 12:32 PM, said:
The hard way? The FAQs cover things that were available at the time in a good amount of detail and with clear explanations. I mostly just went "can I?" and then searched to see if a command or set of commands existed that would let me do that in some way. And often I did NOT code things in bespoke ways (based on Duke3D's vanilla CON files for example) when I thought of easier ways of doing the same thing based on the available commands. Saying that scripting is easy would be lying, but only because of the variety of functions now available and the kinds of things you can do. But the basic stuff is very simple. And when you are starting out you should stick to the basics.
#2355 Posted 01 October 2018 - 02:22 PM
Trooper Dan, on 01 October 2018 - 12:50 PM, said:
Here's the main page of the scripting wiki:
https://wiki.eduke32.../wiki/Scripting
It starts by linking to some old guides which cover the basics of the scripting language from the 1996 version (which is still applicable to the enhanced version). It then talks about important enhancements and how to use them, including game variables, game structures, game events, and formatting. At the top there are links to documentation on the various commands, events and structures within the game.
Everything I listed above could be improved. But, for those of us who are already familiar with the system, it's not obvious what the biggest deficiencies are. If people want to chime in about what most needs improvement, that would be helpful.
I think what the wiki really needs are examples of using functions, events etc. within code. In zDoom wikia there are action functions:
https://zdoom.org/wi...ction_functions
Notice that each one has an example of how to use it within the code, even if they seem redundant at times. There are a few exceptions with no examples, but these have this note added:
Quote
Furthermore, many new functions e.g. events have no pages added. Notice how many hyperlinks are red here:
https://wiki.eduke32...wiki/Event_list
I guess I can assume which some of them do, but having clear verified info about it would save a lot of time.
This post has been edited by December Man: 01 October 2018 - 02:23 PM
#2356 Posted 01 October 2018 - 02:31 PM
Hendricks266, on 01 October 2018 - 01:18 PM, said:
That implies that all con documentation and references are shit, and all of the knowledgeable people would rather horde their little gems just so they could tell new people they don't have time to help.
I have a hard time believing that about my favorite Duke community members.
This post has been edited by Forge: 01 October 2018 - 02:32 PM
#2357 Posted 01 October 2018 - 02:39 PM
#2358 Posted 01 October 2018 - 02:49 PM
Hendricks266, on 01 October 2018 - 01:18 PM, said:
This is getting off the topic of documentation, but I think it would be reasonable to end EDuke32 development and shift everything over to a port with a new name. What I mean is, make sure that EDuke32 is in a good place, fix known bugs, and then just leave it. Start a new project called "EDuke Pro" (not really because that name sucks) and use the opportunity to prune all of the deprecated or just bad commands, and make things work better in general with worrying about old mods. The old mods would still work with "EDuke32" as intended, and those of us who care could port our old mods to "Eduke Pro" or whatever it's called without too much trouble.
I know it must be hard to stay motivated to work on EDuke32 if you feel that you can't make it what it should be because of maintaining compatibility with old projects.
#2359 Posted 01 October 2018 - 02:55 PM
I suppose like 95% of noobs I want to go straight to "create a custom weapon". If I'm going to test my sanity learning something very foreign to me I want to at least be motivated to do it.
However, I realise that I'm turning several pages at once, and that I'll just have to persist with the pain learning lots of seemingly pointless and trivial things until I actually make something cool.
#2360 Posted 01 October 2018 - 03:04 PM
This is a good example of what I was up against early in my con code learning. There are many just like this.
The command seems very simple. Fill in a number for a sector and a sector tag. But where do I get those numbers from? It can't be as easy as taking the sector number shown in Mapster because those numbers are dynamic and can change. That leads me to believe there are more con commands that need to be included to get those 2 numbers to enter and to make use of the command. If so, the wiki should explain it right there and provide a small example.
This post has been edited by Mark: 01 October 2018 - 03:06 PM
#2361 Posted 01 October 2018 - 03:05 PM
Trooper Dan, on 01 October 2018 - 02:49 PM, said:
my vote is for eDuke64