GDCC: An Alternative ACS Compiler [0.15.0]

Any utility that assists in the creation of mods, assets, etc, go here.
Forum rules
The Projects forums are ONLY for YOUR PROJECTS! If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.

Re: GDCC: An Alternative ACS Compiler

Postby Nash » Mon Sep 26, 2016 9:28 am

Sooooo sorry man but REOPEN still isn't working. Tried gdcc_v0.11.0-8-ge19bcaa_win64.7z

I just extract all of the contents into my gdcc directory and overwrite everything. Is there anything else I might be doing wrong?


EDIT: KILL scripts don't work too, BTW.

Also throwing this here just in case: I'm a gdcc-acc user. Always have been.
User avatar
Nash
Twitter/Facebook/Youtube: nashmuhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Twitch ID: nashmuhandes
Github ID: nashmuhandes

Re: GDCC: An Alternative ACS Compiler

Postby Nero » Mon Sep 26, 2016 3:22 pm

Hey, I'm having a problem with, it seems, sprintf. Take a look at the example functions for usage, maybe I'm doing something wrong there?

Spoiler: "Limited string length version"

Spoiler: "Dynamic string length version - which I'm switching to"


This function, and it's sisters, tries to put a string and a number together. The string gives the number meaning. The final product might be "Player 0 TID is: 42", with the string being "Player 0 TID is: ", and the number being 42. Both values get sent to the function to be concatenated, but the number has to be converted to a string as well. Tested in VS2015, both functions work fine and I have complete strings, but not with GDCC. It's as if the converted number string isn't being concatenated. The reason I think the problem is with sprintf is that I also have a function that concatenates two strings and it's working fine. The difference between the functions is the sprintf usage.

Spoiler: "String concatenating function"


Am I doing something wrong or is there an issue with sprintf?
User avatar
Nero
Royal Boredom....Why can't I do this in Windows?
 
Joined: 06 Sep 2006
Location: Middle of Nowheresville Il.

Re: GDCC: An Alternative ACS Compiler

Postby DavidPH » Mon Sep 26, 2016 3:43 pm

Nash: Forgot to add them to the list of ACS keywords, so the parser ignored them for script types. It should actually really be working now.

Also, when updating, you should delete the old version first, as I do sometimes remove files from the distribution.

Nero: And on the same subject of code with insufficient testing, I forgot to flush the special stream used for sprintf in the latest stdio rewrite. That also seems to be working correctly now.
User avatar
DavidPH
Crazy Compiler Man
 
Joined: 28 Aug 2009

Re: GDCC: An Alternative ACS Compiler

Postby Nero » Mon Sep 26, 2016 4:25 pm

Can confirm updates fixed my issues! Thank you!
User avatar
Nero
Royal Boredom....Why can't I do this in Windows?
 
Joined: 06 Sep 2006
Location: Middle of Nowheresville Il.

Re: GDCC: An Alternative ACS Compiler

Postby Nero » Fri Sep 30, 2016 4:14 pm

Quick question: I currently use the following code for HudMessages, which works fine for just plain messages. What is the syntax for combining types and where do the extra arguments go?

Code: Select allExpand view
ACS_BeginHudMessage ();
__nprintf ("A");
ACS_MoreHudMessage ();
ACS_OptHudMessage (HUDMSG_PLAIN, tid, ZERO, x_pos, y_pos, ZROF);
ACS_EndHudMessage ();


Something like this snippet didn't seem to work:
Code: Select allExpand view
ACS_BeginHudMessage ();
__nprintf ("A");
ACS_MoreHudMessage ();
ACS_OptHudMessage (HUDMSG_PLAIN | HUDMSG_ALPHA, tid, ZERO, x_pos, y_pos, ZROF, 0.5);
ACS_EndHudMessage ();
User avatar
Nero
Royal Boredom....Why can't I do this in Windows?
 
Joined: 06 Sep 2006
Location: Middle of Nowheresville Il.

Re: GDCC: An Alternative ACS Compiler

Postby DavidPH » Sun Oct 02, 2016 8:14 am

The extra arguments go in the ACS_EndHudMessage call. Just make sure they have the right type, since they are passed as variadic arguments.

On a side note, you may want to replace the __nprintf there with ACS_PrintChar('A'), to avoid all the extra time in nprintf.
User avatar
DavidPH
Crazy Compiler Man
 
Joined: 28 Aug 2009

Re: GDCC: An Alternative ACS Compiler

Postby Nero » Mon Oct 03, 2016 9:46 pm

It took a couple tries but I got it now. I do output stings too, so the __nprintf is sometimes necessary, but since I'm fixing my HudMessage use I'm separating my code into an image function and a string function. Either way, thanks for the tip, I'm all for efficiency tweaks.

I'm stuck on one thing though: color strings. From my understanding of the wiki if I specify a message type with HUDMSG_COLORSTRING, the color arg accepts a string instead of an int. GDCC doesn't like strings in an int arg, obviously, so what do I do there?
User avatar
Nero
Royal Boredom....Why can't I do this in Windows?
 
Joined: 06 Sep 2006
Location: Middle of Nowheresville Il.

Re: GDCC: An Alternative ACS Compiler

Postby DavidPH » Tue Oct 04, 2016 5:09 pm

There's OptHudMessageS for that, or you can just cast it to an int, depending on the circumstances.
User avatar
DavidPH
Crazy Compiler Man
 
Joined: 28 Aug 2009

Re: GDCC: An Alternative ACS Compiler

Postby Marrub » Fri Oct 07, 2016 1:57 pm

I've created a wiki for GDCC since there's a lot of things that need explaining commonly.
I am not very good at administering mediawiki software, so any suggestions are welcome.
User avatar
Marrub
Xevv Va Rkvyr
 
 
 
Joined: 26 Feb 2013
Discord: Marrub#5455
Twitch ID: marrubdaskuleion
Github ID: marrub--
Operating System: Other Linux 64-bit
Graphics Processor: ATI/AMD with Vulkan Support

Re: GDCC: An Alternative ACS Compiler

Postby Nash » Thu Oct 20, 2016 1:52 am

Not sure if this is a GDCC problem or not... I'll check with here first.

Code: Select allExpand view

function void DebugText_Game
(void)
{
    str gameStateNames[5] =
    {
        "GS_None",
        "GS_EnterLevel",
        "GS_NoPlay",
        "GS_Play",
        "GS_ExitLevel"
    };

    str text;

    PrintDebugString(StrParam(
    s:"GameInstanceCount = ", d:gameInstance.gameInstanceCount, s:"\n",
    s:"gameState = ", s:gameStateNames[gameInstance.gameState], s:"\n",
    s:"MainTimeInstance = ", d:MainTimeInstance, s:"\n",
    s:text
    
));
}


"text" will appear to print junk (the level's name for example). Changing it to

Code: Select allExpand view

str text 
= "";


Will not print junk. Don't know what recent change caused unassigned strings to print junk... I am okay with this change if it has to be this way but I just want to know what's causing this (GDCC or ZDoom, and intentional or not)
User avatar
Nash
Twitter/Facebook/Youtube: nashmuhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Twitch ID: nashmuhandes
Github ID: nashmuhandes

Re: GDCC: An Alternative ACS Compiler

Postby DavidPH » Thu Oct 20, 2016 6:48 am

Should be zero-initialized by the engine just like under acc, but I don't know what printing string index 0 does under ZDoom currently.

EDIT: Or, well, it's obvious what it will do: Print the first string from the table of the map's BEHAVIOR (or the first loaded module if the map has no BEHAVIOR). So there you have it.
User avatar
DavidPH
Crazy Compiler Man
 
Joined: 28 Aug 2009

Re: GDCC: An Alternative ACS Compiler

Postby Nash » Thu Oct 20, 2016 7:15 am

It didn't do this until very recently though... must be something that changed in ZDoom, then. Since I don't have the energy to track it down and make isolated examples, I'll just play it safe and initialize my temporary strings with "" and hopefully the string garbage collector is doing its job... :S
User avatar
Nash
Twitter/Facebook/Youtube: nashmuhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Twitch ID: nashmuhandes
Github ID: nashmuhandes

Re: GDCC: An Alternative ACS Compiler

Postby Nero » Thu Oct 20, 2016 1:52 pm

Hey David, while debugging my code in VS I found something that VS calls an error that GDCC is allowing:

Code: Select allExpand view
// example.h

// So I create an object
typedef struct objectA objectA;
struct objectA
{
     int objAx,
          objAy;
     char objStr[objStrSize];
};

// Now I declare an object and a pointer
objectA NULL_objA, *NULL_objAptr;


Code: Select allExpand view
// example.c

// So now in a function I do something like this:
void foo ()
{
     NULL_objAptr = initalizeObjA();     // so the function returns a pointer to the object it created
     NULL_objA = *NULL_objAptr;         // and here's the problem, I just set the global object to the dereferenced pointer!
}


My code doesn't overload the "equal" operator, not sure if that's even doable here, so I'm not sure if this is a bug in GDCC or just a case of "don't do that!" Just a heads up :)

*edited so it's one problem, not multiple, my other issues were my own.
User avatar
Nero
Royal Boredom....Why can't I do this in Windows?
 
Joined: 06 Sep 2006
Location: Middle of Nowheresville Il.

Re: GDCC: An Alternative ACS Compiler

Postby DavidPH » Thu Oct 20, 2016 2:05 pm

Looks perfectly legal to me. Structures are assignable in C in that way. It copies the contents of the right operand into the left operand.
User avatar
DavidPH
Crazy Compiler Man
 
Joined: 28 Aug 2009

Re: GDCC: An Alternative ACS Compiler

Postby Nero » Thu Oct 20, 2016 2:23 pm

Ah, ok, that's something I didn't know. Maybe I'm forgetting my C++ but I thought you couldn't do that without overloading the operand; which is what made me think that should be illegal in C as well. I guess I should check my solution settings if VS is balking on a C project, just specifying a .c filetype isn't enough for it.
User avatar
Nero
Royal Boredom....Why can't I do this in Windows?
 
Joined: 06 Sep 2006
Location: Middle of Nowheresville Il.

PreviousNext

Return to Editors / Asset Manipulation

Who is online

Users browsing this forum: ESTIERCOL and 0 guests