My episode for Duke Nukem Legacy Edition mod "My plan for an entire episode with big maps."
#31 Posted 15 May 2024 - 03:29 AM
"Fancy autocomplete" is exactly right. I use GPT all the time for work, but I'd never trust it to do something I didn't basically already have the answer to or know how to do. It's not a magic machine with all the answers. It's not a truth-telling device. It's not anything more than fancy autocomplete.
Sure, you can steal scripts from other mods and I'm sure things will "work" in the most literal sense. A lot of what you have described is not "the most basic things". Adding new switches isn't easy, adding new keycard colors isn't easy. ChatGPT won't have the first clue how to accomplish these things because they require deep understanding, not just of specific CON commands, but language syntax and how to interface with the engine.
Sure, you can steal scripts from other mods and I'm sure things will "work" in the most literal sense. A lot of what you have described is not "the most basic things". Adding new switches isn't easy, adding new keycard colors isn't easy. ChatGPT won't have the first clue how to accomplish these things because they require deep understanding, not just of specific CON commands, but language syntax and how to interface with the engine.
#32 Posted 16 May 2024 - 08:17 AM
I maganed to make some basic coding for simple effects, such as when shoot or interact with a sprite to make it change it's texture and for it to make a sound. For more basic things I'm looking for codes in GAMES.CON. For more complex things, I'll have to look for codes of other mods. Right now I made 2 new actors. The first is a small tornado. It's not killable and when you go next to it, it hurts you. It's a start. The second actor is a babe, similar to of those of Shadow Warrior. I'm trying to replicate the behavior of them in Duke Nukem. I already made some progress, using MYENEMY example in GAME.CON. It doesn't move in the map and stay stopped, like Duke Nukem babes. It's killable, make sound and when I press it, it shoots me. The only problem is that when it changes the texture, it keeps stuck in an attacking animation and don't return back to the first texture, before the interaction. At least I made one functional actor and the other is still buggy.
This post has been edited by eniojr: 16 May 2024 - 08:17 AM
#33 Posted 16 May 2024 - 12:14 PM
Reaper_Man, on 15 May 2024 - 03:29 AM, said:
"Fancy autocomplete" is exactly right. I use GPT all the time for work, but I'd never trust it to do something I didn't basically already have the answer to or know how to do. It's not a magic machine with all the answers. It's not a truth-telling device. It's not anything more than fancy autocomplete.
Sure, you can steal scripts from other mods and I'm sure things will "work" in the most literal sense. A lot of what you have described is not "the most basic things". Adding new switches isn't easy, adding new keycard colors isn't easy. ChatGPT won't have the first clue how to accomplish these things because they require deep understanding, not just of specific CON commands, but language syntax and how to interface with the engine.
Sure, you can steal scripts from other mods and I'm sure things will "work" in the most literal sense. A lot of what you have described is not "the most basic things". Adding new switches isn't easy, adding new keycard colors isn't easy. ChatGPT won't have the first clue how to accomplish these things because they require deep understanding, not just of specific CON commands, but language syntax and how to interface with the engine.
I was going to ask it to write a modern day multi-player feature for EDuke32 but I didn't want to put anyone's nose out of joint, so instead I asked ChatGPT:
Me: can you write an eduke32 con script for me?
ChatGPT
Of course! I can help you with that. What specifically would you like the EDuke32 CON script to do?
Me: I would like to add a new keycard that is green
ChatGPT
Certainly! Below is a simple EDuke32 CON script that adds a new green keycard to your game:
#include "eduke32_con_defs.con"
// Define the new keycard
definekeycard GREENKEYCARD 1000 "Green Keycard" 1000 0
// Define the function to check if the player has the keycard
int check_green_keycard(void)
{
if (checkinventory(GREENKEYCARD, 1) == 1)
return 1; // Player has the green keycard
else
return 0; // Player doesn't have the green keycard
}
// Define the function to give the green keycard to the player
void give_green_keycard(void)
{
giveinventory(GREENKEYCARD, 1);
}
// Define the function to take the green keycard from the player
void take_green_keycard(void)
{
takeinventory(GREENKEYCARD, 1);
}
// Define the function to print a message when the player tries to open a door without the green keycard
void green_keycard_required_message(void)
{
if (!check_green_keycard())
printmessage("You need the green keycard to open this door.");
}
// Define the function to open a door with the green keycard
void open_door_with_green_keycard(int tag)
{
if (check_green_keycard())
operdoor(tag);
else
green_keycard_required_message();
}
// Define the function to initialize the green keycard
void initialize_green_keycard(void)
{
giveinventory(GREENKEYCARD, 0); // Give the player 0 green keycards at the start of the game
}
// Hook the initialize function to the game's startup
void CON_GameStartup(void)
{
initialize_green_keycard();
}
This post has been edited by Paul B: 16 May 2024 - 12:18 PM
#34 Posted 16 May 2024 - 02:35 PM
And how well did that compile for you? Any errors?
This post has been edited by Reaper_Man: 16 May 2024 - 02:36 PM
#35 Posted 16 May 2024 - 07:35 PM
Hey, somewhat I managed to make a new accesscard with green, grey and brown colors. However, it's not the same card tile number, it's a custom tile number I made for both card and switch. But I can only get the cards. The icons doesn't appear in the screen yet and the new switch I made for the new cards still don't work. I got the code from Nuclear Showndown mod. At least I can get the cards. It's not yet complete, but at least it appears to be some progress! Here's the code I managed to at least get the cards:
There are other mods that do that, by creating new access cards by creating new tile numbers instead of using the tile number 60 (ACCESSCARD). In my case, I use tile number 15175. The same with new switches, by creating new tile numbers (textures), instead of using the same tile number the game use for dipswitches.
The maximum tile number for Alien Armaggeddon is 21266 (HUGE!). This mod have many new dipswitches. I couldn't resist, so I saw the codes for that mod, but it seems it has custom scripts that I don't understand, so I couldn't add new dipswitches using those codes. It seems the problem is that I have to make custom scripts for that to work, instead of only using simple codes, but for now it's too complex for me. So for now I'm not focusing on that now. Or about the new access card sprites.
Legacy mod has maximum tile number of 5887 and some reserved, by a total of 6143 texture slots. With the new textures I added for my custom maps, it's a total of 15177. But with the very interesting textures of Alien Armaggeddon, it might double, maybe reaching the limit of 30441 slots supported by the game. But I won't overwrite the original textures nor the Legacy mod textures, because they will only be there for my custom maps, with custom coding too. But as I said, in a way that won't interfere with the mod, because it's an addon, not a new mod!
Here's the code for the tornado actor. Not a great thing, but it's a start:
gamevar ACCESSKEY2 0 1 gamevar TEMP 0 2 gamevar TEMP2 0 2 gamevar TEMP3 0 2 gamevar TEMP4 0 2 gamevar HITAGSAVED 0 2 gamevar LOTAGSAVED 0 2 gamevar CKEYCARDTILE 0 0 gamevar CKEYCARDPAL 0 0 gamevar CUSTOMKEYCARDPOS 0 0 eventloadactor ACCESSCARD2 setactor[THISACTOR].xrepeat 28 setactor[THISACTOR].yrepeat 28 enda useractor notenemy ACCESSCARD2 ifp pshrunk nullop else ifp palive ifpdistl RETRIEVEDISTANCE ifcount 6 ifcanseetarget { ifspritepal 12 { ifvarand ACCESSKEY2 1 { break } else addvar ACCESSKEY2 1 } else ifspritepal 11 { ifvarand ACCESSKEY2 2 { break } else addvar ACCESSKEY2 2 } else ifspritepal 15 { ifvarand ACCESSKEY2 4 { break } else addvar ACCESSKEY2 4 } globalsound DUKE_GET quote 43 palfrom 16 0 32 killit } enda action LOCKED 0 action UNLOCKING 0 action UNLOCKED 1 eventloadactor ACCESSSWITCH3 { espawn 2471 getactor[THISACTOR].pal TEMP setactor[RETURN].pal TEMP getactor[THISACTOR].hitag HITAGSAVED getactor[THISACTOR].lotag LOTAGSAVED setactor[THISACTOR].hitag 0 setactor[THISACTOR].lotag 0 } enda state checkcounterpart2 setvar TEMP 0 whilevarn TEMP 16384 { getactor[TEMP].statnum TEMP4 ifvarn TEMP4 1024 { getactor[TEMP].picnum TEMP2 ifvare TEMP2 ACCESSSWITCH3 { getactorvar[TEMP].LOTAGSAVED TEMP3 ifvarvare LOTAGSAVED TEMP3 { setactor[TEMP].picnum 15176 } } } addvar TEMP 1 } ends state CUSTOMACCESSSWITCH ifaction 0 { action LOCKED } ifpdistl 1024 ifhitspace ifaction LOCKED { ifspritepal 12 { ifvarand ACCESSKEY2 1 { setvar CKEYCARDTILE 2568 setvar CKEYCARDPAL 12 setvar CUSTOMKEYCARDPOS 21 action UNLOCKING } else { quote 1002 } } else ifspritepal 11 { ifvarand ACCESSKEY2 2 { setvar CKEYCARDTILE 2568 setvar CKEYCARDPAL 11 setvar CUSTOMKEYCARDPOS 21 action UNLOCKING } else { quote 1003 } } ifspritepal 15 { ifvarand ACCESSKEY2 4 { setvar CKEYCARDTILE 2568 setvar CKEYCARDPAL 15 setvar CUSTOMKEYCARDPOS 21 action UNLOCKING } else { quote 1004 } } } ifaction UNLOCKING { ifvare CUSTOMKEYCARDPOS 9 { state checkcounterpart2 ifvare HITAGSAVED 0 { sound SWITCH_ON } else { soundvar HITAGSAVED } operateactivators LOTAGSAVED THISACTOR operaterespawns LOTAGSAVED operatemasterswitches LOTAGSAVED action UNLOCKED ifspritepal 12 subvar ACCESSKEY2 1 else ifspritepal 11 subvar ACCESSKEY2 2 else ifspritepal 15 subvar ACCESSKEY2 4 } } ends useractor notenemy ACCESSSWITCH3 state CUSTOMACCESSSWITCH enda state MAPBEACON setactor[THISACTOR].shade -127 getplayer[THISACTOR].ang TEMP3 setactor[THISACTOR].ang TEMP3 getuserdef[THISACTOR].overhead_on TEMP ifvare TEMP 2 { cstat 32 getplayer[THISACTOR].zoom TEMP2 subvar TEMP2 2048 mulvar TEMP2 -1 divvar TEMP2 20 ifvarl TEMP2 2 setvar TEMP2 2 ifvarg TEMP2 256 setvar TEMP2 256 setactor[THISACTOR].xrepeat TEMP2 setactor[THISACTOR].yrepeat TEMP2 } else { cstat 32768 } ends eventloadactor ACCESSSWITCH2 espawn 2471 getactor[THISACTOR].pal TEMP setactor[RETURN].pal TEMP enda useractor notenemy 2471 state MAPBEACON enda
There are other mods that do that, by creating new access cards by creating new tile numbers instead of using the tile number 60 (ACCESSCARD). In my case, I use tile number 15175. The same with new switches, by creating new tile numbers (textures), instead of using the same tile number the game use for dipswitches.
The maximum tile number for Alien Armaggeddon is 21266 (HUGE!). This mod have many new dipswitches. I couldn't resist, so I saw the codes for that mod, but it seems it has custom scripts that I don't understand, so I couldn't add new dipswitches using those codes. It seems the problem is that I have to make custom scripts for that to work, instead of only using simple codes, but for now it's too complex for me. So for now I'm not focusing on that now. Or about the new access card sprites.
Legacy mod has maximum tile number of 5887 and some reserved, by a total of 6143 texture slots. With the new textures I added for my custom maps, it's a total of 15177. But with the very interesting textures of Alien Armaggeddon, it might double, maybe reaching the limit of 30441 slots supported by the game. But I won't overwrite the original textures nor the Legacy mod textures, because they will only be there for my custom maps, with custom coding too. But as I said, in a way that won't interfere with the mod, because it's an addon, not a new mod!
Here's the code for the tornado actor. Not a great thing, but it's a start:
define RRTORNADO_DAMAGE_TO_PLAYER -10 action RRTORNADO_ANIMATIONS 0 1 1 1 4 move RRTORNADO_SPEEDS 100 ai RRTORNADO_BOUNCE RRTORNADO_ANIMATIONS RRTORNADO_SPEEDS geth randomangle useractor enemystayput RRTORNADO ifai NO { sizeat 48 48 cstator 1 ai RRTORNADO_BOUNCE } ifcount 48 ifrnd 16 ai RRTORNADO_BOUNCE ifpdistl 2048 ifrnd 16 { sound DUKE_GRUNT palfrom 24 24 addphealth RRTORNADO_DAMAGE_TO_PLAYER } enda
#36 Posted 16 May 2024 - 09:27 PM
eniojr, on 16 May 2024 - 07:35 PM, said:
The icons doesn't appear in the screen yet and the new switch I made for the new cards still don't work. I got the code from Nuclear Showndown mod.
I can confidently say that Nuclear Showdown has the rest of what you are looking for. I'm kind of glad that I've never done a mod with this feature, so I can honestly say that I have no idea where in that mod you would find the rest of the code, since I really don't know (I mean aside from the obvious that CUSTOMKEYCARDPOS refers to screen position so you will want to look for that and the other card vars).
I'm not sure why James didn't use the existing got_access struct to add the new cards, but it was a long time ago and there may have been a good reason.
#37 Posted 17 May 2024 - 04:15 AM
Danukem, on 16 May 2024 - 09:27 PM, said:
I'm not sure why James didn't use the existing got_access struct to add the new cards, but it was a long time ago and there may have been a good reason.
I'm pretty sure the issue is that the engine is hardcoded in several ways to check not just the .got_access value, but also the palette of the switch sprite/wall itself, and it ignores anything outside the expected base colors. This is why you can't just addinventory a card with an arbitrary palette. You can manually add the key to the .got_access bitfield, but you'll still run into problems with the key switch as they are very specifically hardcoded to look for the 3 base key colors. Without doing testing myself, I'm not sure how you'd get around this outside of just writing a new custom switch (which is what I'd do tbh).
#38 Posted 18 May 2024 - 06:24 PM
There's something for that I need help. I tried everything but I couldn't make it work. I made a more complex actor, not so complex in fact, because it's just a FEM. This FEM is difrerent, because when you interact with her, she shoots you. Ok, I managed to make her change the texture from an idle texture to an attacking texture. She also shoot at you and hurt you when you talk to her. She also suffer from the effects of freezer and expander weapon. I couldn't make her to shrink with shrinker, so instead of shrink I gave up and made her to just vanish!
Here's the code of the actor:
Here's the texture of the handicapped girl when idle:
Here's the texture of the handicapped girl when attacking:
She is a modified version of that mechanic girl from Shadow Warrior. There are other women too, but first I need to finish that handicapped girl, to make the others work without bugs.
My plan is to add girls that don't like to be flirted with and so they shoot you.
The first problem is that I couldn't make her shrink, even using or editing the shrink codes for the FEM's in GAME.CON. I need help with that.
The second problem is that when I talk to her, she shoots immediately and for a very short period of time. What I want is something more similar to those women of Shadow Warrior. The idea is that when you talk to her, she takes some time to shoot me and the attacking action should last 3 seconds, before she return to her idle position. I think it's something that is missing in the code, but I don't have any clue what. I just reorganized the FEM's codes of GAME.CON in order to work with a custom actor. Don't know if it's something with the action parameters or some code missing.
This is the best I could make for now!
I also included two audios I made for the COCACOLA and COWPIE items that restore health.
COCACOLA audio:
https://voca.ro/1hfYtmHLbleo
COWPIE audio:
https://voca.ro/1aSQj3Anf1nm
When you go to the link, you'll have to press the start button for the audio to play.
Here's a texture showing COCACOLA and COWPIE. In the distance you can see 2 rooms. One with the new breackable items and the other with the new buttons and breackable walls.
I might add new items, but they won't be in the inventory, because that's more difficult for me to do.
To me Duke Nukem is a type of guy that is not afraid of making some noises...
My maps might have some jokes like these.
Here's the code of the actor:
define SWBABE1_NORMAL_STRENGTH 50 define SWBABE1_DAMAGE_TO_PLAYER -5 define SWBABE1_STAND_PICNUM 14052 define SWBABE1_ATTACK_PICNUM 14054 define ATTACK_DELAY 30 define ATTACK_DURATION 90 action FEMSHRUNK action FEMANIMATESLOW 0 2 1 1 100 action SWBABE1_STAND 2 1 1 1 5 action SWBABE1_ATTACK 2 1 1 1 10 ai SWBABE1_ATTACK SWBABE1_STAND useractor notenemy SWBABE1 TOUGH FEMANIMATE SWBABE1_STAND SWBABE1_ATTACK ifai NO { strength SWBABE1_NORMAL_STRENGTH sizeat 18 18 cstator 257 ai SWBABE1_STAND } state tipme { ifp pfacing ifpdistl 1024 { ifhitspace { tip ifrnd 128 ifcansee { soundonce DUKE_TIP1 } else { soundonce DUKE_TIP2 } ifactor SWBABE1 { ai SWBABE1_ATTACK action SWBABE1_ATTACK shoot SHOTSPARK1 addphealth SWBABE1_DAMAGE_TO_PLAYER sound 37 sound 6 resetactioncount } } } ifactor FEM1 money 5 ifaction SWBABE1_ATTACK { ifactioncount 128 { action SWBABE1_STAND ai SWBABE1_STAND resetactioncount } } ifaction FEMFROZEN1 { ifcount THAWTIME { action FEMANIMATE getlastpal } else ifcount FROZENDRIPTIME { ifactioncount 26 { spawn WATERDRIP resetactioncount } } ifhitweapon { ifwasweapon FREEZEBLAST { strength 0 break } lotsofglass 30 sound GLASS_BREAKING respawnhitag ifrnd 84 { spawn BLOODPOOL } add s_babekilled 1 killit } else ifp pfacing ifpdistl FROZENQUICKKICKDIST { pkick } } ifhitweapon { ifdead { ifwasweapon GROWSPARK { cstat 0 move 0 sound ACTOR_GROWING action FEMGROW break } else ifwasweapon FREEZEBLAST { ifaction FEMSHRUNK { break } action FEMFROZEN1 move 0 spritepal 1 strength 0 sound SOMETHINGFROZE break } } ifrnd 128 { sound DUKE_HIT_STRIPPER1 } else { sound DUKE_HIT_STRIPPER2 } respawnhitag state standard_jibs state random_wall_jibs spawn BLOODPOOL money 5 spritepal 6 soundonce LADY_SCREAM debris SCRAP3 18 add s_babekilled 1 killit } ifwasweapon SHRINKSPARK { sound ACTOR_SHRINKING sound SQUISHED add s_babekilled 1 killit } ifwasweapon GROWSPARK { sound ACTOR_SHRINKING sound SQUISHED guts JIBS6 1 } } enda
Here's the texture of the handicapped girl when idle:
Here's the texture of the handicapped girl when attacking:
She is a modified version of that mechanic girl from Shadow Warrior. There are other women too, but first I need to finish that handicapped girl, to make the others work without bugs.
My plan is to add girls that don't like to be flirted with and so they shoot you.
The first problem is that I couldn't make her shrink, even using or editing the shrink codes for the FEM's in GAME.CON. I need help with that.
The second problem is that when I talk to her, she shoots immediately and for a very short period of time. What I want is something more similar to those women of Shadow Warrior. The idea is that when you talk to her, she takes some time to shoot me and the attacking action should last 3 seconds, before she return to her idle position. I think it's something that is missing in the code, but I don't have any clue what. I just reorganized the FEM's codes of GAME.CON in order to work with a custom actor. Don't know if it's something with the action parameters or some code missing.
This is the best I could make for now!
I also included two audios I made for the COCACOLA and COWPIE items that restore health.
COCACOLA audio:
https://voca.ro/1hfYtmHLbleo
COWPIE audio:
https://voca.ro/1aSQj3Anf1nm
When you go to the link, you'll have to press the start button for the audio to play.
Here's a texture showing COCACOLA and COWPIE. In the distance you can see 2 rooms. One with the new breackable items and the other with the new buttons and breackable walls.
I might add new items, but they won't be in the inventory, because that's more difficult for me to do.
To me Duke Nukem is a type of guy that is not afraid of making some noises...
My maps might have some jokes like these.
This post has been edited by eniojr: 18 May 2024 - 06:32 PM
#39 Posted 18 May 2024 - 06:29 PM
The braces that start right after "state tipme" are redundant, since calling that state is not an if condition. Anyway, good job to get that working! I have to assume it is largely adapted from an existing mod, though.
#40 Posted 18 May 2024 - 09:05 PM
I found another problem too... The actor only shoot in the direction of the angle his sprite, not in the direction of the player. It seems the problem is not the mod, but the game code itself, I mean, my lack of knowledge about what is right or wrong in Eduke32 coding rules.
This post has been edited by eniojr: 18 May 2024 - 09:06 PM