Adding in quotes without overwrites
#1 Posted 28 December 2018 - 11:13 AM
Thread title, basically. I want to add in some additional Duke one-liners without replacing existing ones. Setting aside quality mashing for the moment, I simply want to learn the process. I didn't see any dedicated tutorials or breakdowns of the one-liner system. I'm sure they exist somewhere, but they're probably embedded and I don't know where to start searching. I did try reverse-engineering mods I know that pulled that off, but as usual looking at the con code made my brain melt. I grasped the concept of declaring the additional sound files exist (though I don't quite know how; lots of numbers there), but when it came to actually calling on them, I don't know how that works or where that happens.
Also I realize I'm approaching this situation from more of a middle/top-down position as opposed to a bottom-top approach like most tutorials are designed, but what can I say. It's easier for me to learn this way.
This post has been edited by Ninety-Six: 28 December 2018 - 11:14 AM
#2 Posted 28 December 2018 - 12:25 PM
(if you refer to this)
CommbatMacro#0-9
These are the text macros used to send messages with "SHIFT+F1-F10", and yes, it is spelled that way. Here are the defaults:
CommbatMacro#0 = "An inspiration for birth control."
CommbatMacro#1 = "You're gonna die for that!"
CommbatMacro#2 = "It hurts to be you."
CommbatMacro#3 = "Lucky Son of a Bitch."
CommbatMacro#4 = "Hmmm....Payback time."
CommbatMacro#5 = "You bottom dwelling scum sucker."
CommbatMacro#6 = "Damn, you're ugly."
CommbatMacro#7 = "Ha ha ha...Wasted!"
CommbatMacro#8 = "You suck!"
CommbatMacro#9 = "AARRRGHHHHH!!!"
Doesn't say how to add nor change
User.con doesn't have this
Probably is hard coded or builtin the Duke engine messages.
Maybe (not sure) could be a way to add more)
Is mentioned in there telling the key to press to trigger
https://wiki.eduke32...on_file_options
#3 Posted 28 December 2018 - 01:04 PM
This post has been edited by Ninety-Six: 28 December 2018 - 01:05 PM
#5 Posted 28 December 2018 - 01:42 PM
You add extra stuff
(standard stuff )
state jib_sounds
ifrnd SWEARFREQUENCY
{
ifrnd 128
{
ifrnd 128
{
ifrnd 128
{
ifrnd 128
{
ifrnd 128
globalsound JIBBED_ACTOR12
else
globalsound JIBBED_ACTOR1
}
else
{
ifrnd 128
globalsound JIBBED_ACTOR9
else
globalsound JIBBED_ACTOR14
}
}
else
{
ifrnd 128
globalsound SMACKED
else
globalsound JIBBED_ACTOR2
}
}
else
{
ifrnd 128
globalsound MDEVSPEECH
else
globalsound JIBBED_ACTOR5
}
}
else
{
ifrnd 128
{
ifrnd 128
{
ifrnd 128
globalsound JIBBED_ACTOR11
else
globalsound JIBBED_ACTOR13
}
else
{
ifrnd 128
globalsound JIBBED_ACTOR3
else
globalsound JIBBED_ACTOR8
}
}
else
{
ifrnd 128
{
ifrnd 128
globalsound JIBBED_ACTOR6
else
globalsound JIBBED_ACTOR4
}
else
{
ifrnd 128
{
ifrnd 128
globalsound JIBBED_ACTOR10
else
globalsound JIBBED_ACTOR15
}
else
globalsound JIBBED_ACTOR7
}
}
}
}
ends
You add let say
in bold is the extra code added
state jib_sounds
ifrnd SWEARFREQUENCY
{
ifrnd 128
{
ifrnd 128
{
ifrnd 128
{
ifrnd 128
{
ifrnd 128
globalsound JIBBED_ACTOR12
else
globalsound JIBBED_ACTOR1
}
else
{
ifrnd 128
globalsound JIBBED_ACTOR9
else
globalsound JIBBED_ACTOR14
}
}
else
{
ifrnd 128
globalsound SMACKED
else
globalsound JIBBED_ACTOR2
}
}
else
{
ifrnd 128
globalsound MDEVSPEECH
else
globalsound JIBBED_ACTOR5
}
}
else
{
ifrnd 128
{
ifrnd 128
{
ifrnd 128
globalsound JIBBED_ACTOR11
else
globalsound JIBBED_ACTOR13
}
else
{
ifrnd 128
globalsound JIBBED_ACTOR3
else
globalsound JIBBED_ACTOR8
}
}
else
{
ifrnd 128
{
ifrnd 128
globalsound JIBBED_ACTOR6
else
globalsound JIBBED_ACTOR4
}
else
{
ifrnd 128
{
ifrnd 128
globalsound JIBBED_ACTOR10
else
globalsound JIBBED_ACTOR15
}
else
{
ifrnd 128
{
ifrnd 128
globalsound JIBBED_ACTORXX
else
globalsound JIBBED_ACTORXX
}
else
globalsound JIBBED_ACTOR7
}
}
}
}
ends
I think is like that
Is inside a state where all actors you "jib" from radius / exp damage
PS
Make sure theres not too much "{" and or "}"
this was done fast just to show an example
You copy a segment and add higher number and or new sounds without hurting older ones
This post has been edited by Zaxtor: 28 December 2018 - 01:45 PM
#6 Posted 28 December 2018 - 04:28 PM
#7 Posted 28 December 2018 - 06:21 PM
1 on top is standard
2nd is a copy with the added stuff
I copied from the game.con file.
I never really messed with that aside replacing codes on my mod.
the "state jib_sounds" with all the stuff is pretty right on top of the game.con file.
You "control+F" inside the con file and find the "state jib_sounds"
and you will see.
you add the extra and should work without messing up things.
More sounds, means more random it will choose.
Let say you blowup something you have 1 in 15 to play a certain sound example "Let god sort em out".
if your new "state jib_sounds" has 20-25 speech.
1/20 or 1/25 to hear a certain sound "Let god sort em out"
This post has been edited by Zaxtor: 28 December 2018 - 06:22 PM
#8 Posted 28 December 2018 - 07:33 PM
Zaxtor, on 28 December 2018 - 06:21 PM, said:
1 on top is standard
2nd is a copy with the added stuff
I was specifically referring to this:
Quote
{ ifrnd 128 globalsound JIBBED_ACTOR11 else globalsound JIBBED_ACTOR13 }
I don't understand why all these events are grouped in pairs.
#9 Posted 28 December 2018 - 08:26 PM
I know ifrnd is a random thing often associated with ifcount
probably else is there for either choosing 11 or 13.
#10 Posted 28 December 2018 - 09:58 PM
I'm just trying to figure out how this massive if/else statement works so I can seamlessly integrate and not screw it up.
#11 Posted 28 December 2018 - 10:49 PM
But in game it works and when Duke guts monster he says random.
Maybe it gives equal chance to everything and game randomly choose the globalsound
#12 Posted 29 December 2018 - 02:21 AM
#13 Posted 29 December 2018 - 07:06 AM
This post has been edited by Photonic: 29 December 2018 - 07:09 AM
#14 Posted 29 December 2018 - 11:45 AM
Incidentally, just for clarity's sake, what's the function that would mean equal only?
Also, how does swearfrequency factor in? I mean, obviously it does I just don't see where it's called.
Seeing the code like this does help a lot to see how this giant tree works, but I notice there are more brackets than there were at the start. Were there more that were just cut off above swearfrequency?
#15 Posted 29 December 2018 - 12:37 PM
Ninety-Six, on 29 December 2018 - 11:45 AM, said:
opposite, less than or equal to, "ifrnd 0" is 1 per 255.
Ninety-Six, on 29 December 2018 - 11:45 AM, said:
ife = if equal, ifg = if greater than, also stuff like ifvare for variables instead of indexed numbers like SWEARFREQUENCY.
Ninety-Six, on 29 December 2018 - 11:45 AM, said:
First line calls it, the rest of the code after is ignored when ifrnd returns > SWEARFREQUENCY.
Ninety-Six, on 29 December 2018 - 11:45 AM, said:
Count them out from top to bottom { = +1, } = -1, you end up at 0.
#16 Posted 29 December 2018 - 02:02 PM
Photonic, on 29 December 2018 - 12:37 PM, said:
I'm confused.
#17 Posted 03 January 2019 - 11:02 AM
Trooper Dan, on 29 December 2018 - 02:21 AM, said:
Like what I did for my file. This is what Trooper Dan had suggested, but without instruction "switch":
state jib_sounds ifrnd SWEARFREQUENCY { randvar TEMPFIX1 34 ifvare TEMPFIX1 0 globalsound JIBBED_ACTOR1 else ifvare TEMPFIX1 1 globalsound JIBBED_ACTOR2 else ifvare TEMPFIX1 2 globalsound JIBBED_ACTOR3 else ifvare TEMPFIX1 3 globalsound JIBBED_ACTOR4 else ifvare TEMPFIX1 4 globalsound JIBBED_ACTOR5 else ifvare TEMPFIX1 5 globalsound JIBBED_ACTOR6 else ifvare TEMPFIX1 6 globalsound JIBBED_ACTOR7 else ifvare TEMPFIX1 7 globalsound JIBBED_ACTOR8 else ifvare TEMPFIX1 8 globalsound JIBBED_ACTOR9 else ifvare TEMPFIX1 9 globalsound JIBBED_ACTOR10 else ifvare TEMPFIX1 10 globalsound JIBBED_ACTOR11 else ifvare TEMPFIX1 11 globalsound JIBBED_ACTOR12 else ifvare TEMPFIX1 12 globalsound JIBBED_ACTOR13 else ifvare TEMPFIX1 13 globalsound JIBBED_ACTOR14 else ifvare TEMPFIX1 14 globalsound JIBBED_ACTOR15 else ifvare TEMPFIX1 15 globalsound SMACKED else ifvare TEMPFIX1 16 globalsound JIBBED_ACTOR16 else ifvare TEMPFIX1 17 globalsound JIBBED_ACTOR17 else ifvare TEMPFIX1 18 globalsound JIBBED_ACTOR18 else ifvare TEMPFIX1 19 globalsound JIBBED_ACTOR19 else ifvare TEMPFIX1 20 globalsound JIBBED_ACTOR20 else ifvare TEMPFIX1 21 globalsound JIBBED_ACTOR21 else ifvare TEMPFIX1 22 globalsound JIBBED_ACTOR22 else ifvare TEMPFIX1 23 globalsound JIBBED_ACTOR23 else ifvare TEMPFIX1 24 globalsound JIBBED_ACTOR24 else ifvare TEMPFIX1 25 globalsound JIBBED_ACTOR25 else ifvare TEMPFIX1 26 globalsound JIBBED_ACTOR26 else ifvare TEMPFIX1 27 globalsound JIBBED_ACTOR27 else ifvare TEMPFIX1 28 globalsound JIBBED_ACTOR28 else ifvare TEMPFIX1 29 globalsound JIBBED_ACTOR29 else ifvare TEMPFIX1 30 globalsound JIBBED_ACTOR30 else ifvare TEMPFIX1 31 globalsound JIBBED_ACTOR31 else ifvare TEMPFIX1 32 globalsound JIBBED_ACTOR32 else ifvare TEMPFIX1 33 globalsound JIBBED_ACTOR33 else globalsound MDEVSPEECH } ends
"JIBBED_ACTOR" from 16 to 33, are bonus quotes of the PSX and Caribbean version.
This post has been edited by Firefly_Trooper: 03 January 2019 - 11:03 AM