Duke4.net Forums: [Tutorials] Simple CON Editing - Duke4.net Forums

Jump to content

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

[Tutorials] Simple CON Editing

User is offline   Danukem 

  • Duke Plus Developer

#31

First step is identifying which tile numbers the captive babes are (probably the same as in the vanilla game and probably already labeled with some code so they can make sounds like "kill me" and take damage etc.) Then you find those in GAME.CON and add the needed code. The code is gonna be pretty simple and there will be similar examples already in GAME.CON but essentially its something like: ifp pfacing ifpdistl 1024 ifp palive ifhitspace ifcansee { INSERT CODE THAT INITIATES RESCUE HERE }
0

User is offline   retr0_r4t 

#32

View PostDanukem, on 03 July 2025 - 11:38 AM, said:

First step is identifying which tile numbers the captive babes are (probably the same as in the vanilla game and probably already labeled with some code so they can make sounds like "kill me" and take damage etc.) Then you find those in GAME.CON and add the needed code. The code is gonna be pretty simple and there will be similar examples already in GAME.CON but essentially its something like: ifp pfacing ifpdistl 1024 ifp palive ifhitspace ifcansee { INSERT CODE THAT INITIATES RESCUE HERE }


Forgot I had posted in here too - Hendricks from the eduke32 discord gave me a solution, so now when interacting with captive babes, the teleport sound and visual plays, the babes disappear and I added the line from Manhattan Project "I'm all yours, Duke." - "Sorry honey, I've got some ass kickin to do first." (I had to edit them into a single .ogg since they're separate in the Manhattan Project game files) - I just named it killme.ogg to take the place of the sound the developers already had in place.

Ideally I would like each rescued babe to have a random chance of saying one of three lines, but no luck on that so far.

This post has been edited by retr0_r4t: 04 July 2025 - 08:23 AM

0

User is offline   Danukem 

  • Duke Plus Developer

#33

Keep the sound files separate and add them as new sounds just like the other sounds in USER.CON (also give them new numbers in DEFS.CON). To play a random sound you can use ifrnd 84 soundonce SOUND else ifrnd 128 soundonce SOUND2 else soundonce SOUND3 (that would be for 3 possible sounds). For >3 possible sounds I typically pick them by randomizing a var and then picking one with a switch statement
0

User is offline   retr0_r4t 

#34

View PostDanukem, on 04 July 2025 - 11:12 AM, said:

Keep the sound files separate and add them as new sounds just like the other sounds in USER.CON (also give them new numbers in DEFS.CON). To play a random sound you can use ifrnd 84 soundonce SOUND else ifrnd 128 soundonce SOUND2 else soundonce SOUND3 (that would be for 3 possible sounds). For >3 possible sounds I typically pick them by randomizing a var and then picking one with a switch statement


So I did a bit of testing and troubleshooting with the help of the eduke32 discord. The general consensus is that there might be some weird hard-coded things going on.

No matter what I put in the code for GAME.CON, interacting with the babe will only play killme.ogg (to clarify I've been editing the official .con file in the World Tour steam directory). The following blocks of code both play killme.ogg:

{
state randgetweapsnds
spawn TRANSPORTERSTAR
sound TELEPORTER
killit
}
ends

---------------------------

{
soundonce RESCUE2
spawn TRANSPORTERSTAR
sound TELEPORTER
killit
}
ends
---------------------------

I gave up and settled on using
{
state randgetweapsnds
spawn TRANSPORTERSTAR
sound TELEPORTER
killit
}

with an edited killme.ogg that has 1.5 sec of silence at the start to not talk over Duke's random get-weapon line. So now when interacting with a babe, I get a random Duke weapon voiceline, teleport animation and sound, babe disappears and I hear the rescue lines from Manhattan Project. I might make another attempt at adding lines when I regain the will to try.

This post has been edited by retr0_r4t: 05 July 2025 - 05:15 AM

0

User is offline   retr0_r4t 

#35

So, turns out I had to delete old save files for World Tour to properly execute the new code in GAME.CON - the code I have below now successfully plays one of 3 .ogg files I made when rescuing babes (Full credit to Hendricks on discord for the working code and Danukem on the forums for ifrnd values):

state killme
ifinwater nullop
else
ifp pfacing
ifpdistl 1280
ifhitspace
{
state randgetweapsnds
ifrnd 84
soundonce KILLME
else
ifrnd 128
soundonce RESCUE2
else
soundonce RESCUE3
spawn TRANSPORTERSTAR
sound TELEPORTER
killit
}
ends


This post has been edited by retr0_r4t: 05 July 2025 - 11:57 AM

0

User is offline   Danukem 

  • Duke Plus Developer

#36

See this is one of the reasons I bowed out -- there are big differences in how the game works between world tour on steam and modern EDuke32. In EDuke32 -- for the last several years at least -- if you load a saved game with new code, the new code will be applied to it (for the most part). In the old days, the code the save was created with was part of the saved game. Your assumption that the new code would automatically be applied was false, but commonsensical enough that you didn't even consider that could be an issue.
0

Share this topic:


  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks not owned by Voidpoint, LLC are the sole property of their respective owners. Play Ion Fury! ;) © Voidpoint, LLC

Enter your sign in name and password


Sign in options