I was browsing the con Wiki and had a thought pop into my head. (amazing )
Example:
findnearactor PIGCOP 2048 TEMP
ifvarn TEMP -1
{
getactor[TEMP].x MX
getactor[TEMP].y MY
getactor[THISACTOR].x x
getactor[THISACTOR].y y
subvarvar MX x
subvarvar MY y
getangle ANGVAR MX MY
setactor[THISACTOR].ang ANGVAR
}
Would it be feasible to somehow add the body of that code to eduke32 itself so that all the coder has to enter inside the actor code is "findnearactor PIGCOP 2048" ? There may be many more examples but I haven't thought this thru very far.
Page 1 of 1
making con coding easier
#1 Posted 06 May 2020 - 09:35 AM
#2 Posted 06 May 2020 - 01:20 PM
Typically you DON'T want to turn to face a sprite just because you confirmed it was within a certain distance. In a real project, you could have defined states that contain the script needed to face an actor and do various other things, so you wouldn't be presented with code like that above when browsing through an actor. The purpose of having an example like that in the wiki is to show how to use the various commands. To be honest there are too many primitives in the language already, and a lot of them are kept around for backwards compatibility with old projects.
What you actually want, Mark, is a library of different states (functions) that perform common tasks. Those of us who have been scripting in CON for a long time each have our own libraries in effect (because we copy and past general purpose code from one project to another), but no one has tried to make an official library that I know of.
What you actually want, Mark, is a library of different states (functions) that perform common tasks. Those of us who have been scripting in CON for a long time each have our own libraries in effect (because we copy and past general purpose code from one project to another), but no one has tried to make an official library that I know of.
#3 Posted 06 May 2020 - 02:19 PM
I've had the idea in my head for some time of making a CON-focussed development environment - standard libraries could be a part of that... As well as better warnings and compile errors while typing and such.
Would probably be a cool project but I dunno if the audience is large enough (plus I don't really know enough about CON coding myself to make it airtight)
Would probably be a cool project but I dunno if the audience is large enough (plus I don't really know enough about CON coding myself to make it airtight)
#4 Posted 06 May 2020 - 02:32 PM
Yep, I see your point Dan. A collection of states sounds useful. Maybe thats what I should try when I decide to get off my butt and do something with all those snippets of code I have gathered over the years.
This post has been edited by Mark: 06 May 2020 - 02:37 PM
#5 Posted 06 May 2020 - 08:24 PM
Mark, on 06 May 2020 - 09:35 AM, said:
Would it be feasible to somehow add the body of that code to eduke32 itself so that all the coder has to enter inside the actor code is "findnearactor PIGCOP 2048" ?
That's possible.
But there's no point, since it would only limit your options.
#6 Posted 07 May 2020 - 04:00 AM
I mentioned I didn't think it thru. I see now why it isn't a great idea.
#7 Posted 07 May 2020 - 01:54 PM
I wonder if the idea couldn't be adapted to make it sort of a way for someone to get their feet wet with CON scripts. Sure, the result may be more limiting, but for entry-level changes there might be some worth until a person is comfortable enough to move on to the more advanced and less restrictive full script.
#8 Posted 07 May 2020 - 02:28 PM
Ninety-Six, on 07 May 2020 - 01:54 PM, said:
I wonder if the idea couldn't be adapted to make it sort of a way for someone to get their feet wet with CON scripts. Sure, the result may be more limiting, but for entry-level changes there might be some worth until a person is comfortable enough to move on to the more advanced and less restrictive full script.
That already exists, and I call it "CON classic" AKA CON script from Duke 1.3D back in '96. All those commands still work in EDuke32. For people who want to get started and don't have any programming experience, playing around with the original GAME.CON and looking at this old guide is still a good method.
#10 Posted 08 May 2020 - 12:53 PM
Dan is right. If you can't do classic level coding, you won't have a snowball's chance in Hell with the EDuke32 level of coding.
Share this topic:
Page 1 of 1