Primitives Tabulated v4-2-2004 Release 2 © RTCM Jeff Armstrong
, RTCM Joris B. Weimar ,
RTCM Jonah Bishop , RTCM Corvin Introduction | primitives tabulate Introduction This document is not intended for beginners, however you may find it useful to occasionally refer to, and learn gradually. Others can dive in. Most of this information is retained originally in the GAME.CON when its shipped with your game. The true fact is you can place all your code in a single GAME.CON(length permitted) Primitives are simply commands or operations (functions) made available to you, the
programmer, by the game engine(You cannot write new primitives). You supply them with
correct Syntax and Arguments to makeup a code that CONtrols and validates functions
in the game. Once you call a primitive, the game performs the routine for you. Most of the
routines are vaguely reminiscent of the C programming language with a virtual
environment. Simple Example of using the "ifrnd" primitive: The "ifrnd" will tell you if a random number between 0 and
256 was less than the number you gave it.
Note: For more information on the ifxxxx primitives, read the details in the tabulate below and also See the RTCM document "con-primitive-declarations"
Here are some of the things you should know before examining the primitive tabulate below:
________CONtrol Line_________ | | | | primitive $ARGUMENT1 #ARGUMENT2 | | |___Parameter List __| ...{ lines of code }............... ..................................... | | |_________Command Lines ____________| | |____________________Routine______________| The portions of the structure above is sectioned off by there placement within a routine, here are some brief descriptions:
Primitives Tabulated
//<one space> This REMark is used to denote comments. Everything after this REMark is ignored by the compiler. A space must follow the REMark, or the compiler will generate an error. Simply jump back in your code and place a space in there.
/* and */ These two REMmarks are used to create comment blocks. Place the /* at the beginning of the area you wish the compiler to ignore, and the */ at the end of the area you wish the compiler to ignore. These type of REMarks are used to create large comments or to ignore an entire section of code.
{ and } These symbols are used to delimited statement blocks, grouping several lines of code into one block. There must be a space after { and before }.
{ } These symbols are used in your line of code. This function means 'do nothing' This is the same as the nullop primitive. There must be at least one space in between.
Section "A"
action NAME #STARTFRAME #NUMFRAMES #NUMANGLES #NUMJUMP #SPEED See the RTCM document "con-primitive-declarations" for more information.
action #NAME Starts the action specified by <name>. This would produce a single static image. See the RTCM document "con-primitive-declarations" for more information.
actor #NAME #STRENGTH $ACTION #SPEED $INSTRUCTIONS1 $INSTRUCTIONS2 { AI_FUNCTION code } { actor code } enda See the RTCM document "con-primitive-declarations" for more information. LameDuke Special: Syntax: actor #NAME #STRENGTH $ACTION #SPEED $INSTRUCTIONS1 $INSTRUCTIONS2 { actor code } enda For the <instructions> parameters see the primitive "move"
addammo #WEAPON #AMOUNT Adds the <amount> of ammunition to the current or closest player's value for the
appropriate <weapon>. Legal values for addammo <weapon> :
addbatteryammo #AMOUNT (only available in Duke3D Lameduke 1-3-95Beta) Adds <amount> of amp ammo to players inventory. 20 amps per item. For what device?
addinventory #ITEM #AMOUNT Adds or Sets <amount> to the current or closest player's value for the appropriate <item>. Legal values for addinventory <item> :
addkills #AMOUNT Adds <amount> to the current or closest player's kill count. Negative values may work.
addkill Adds 1 to the current or closest player's kill count. Negative values don't work.
addlog (only available in WWIIGI) un proven
addlogvar $NAME (only avalable in WWIIGI) Logs current value of this variable <name>
addphealth #AMOUNT Adds the value <amount> to the current or closest player's health. Only the atomic health actor can increase the players health value over the previously set MAXPLAYERHEALTH value. Negative values work aswell.
addrammo #AMOUNT (only available in Duke3D Lameduke 1-3-95Beta) Adds the <amount> of rocket ammunition to the current or closest player's
inventory.
addscore #AMOUNT (only available in Duke3D Lameduke 1-3-95Beta) Adds the value <amount> to the current player actors score. Negative numbers will work.
addstrength #AMOUNT Adds <amount> to the strength (health) of the current actor. Negative values work aswell.
addweapon #WEAPON #STARTAMOUNT Gives the current or closes player the specified <weapon> with an initial amount
of ammunition equal to <startamount>. Legal values for addweapon <weapon>:
addvar #NAME #NUM (only available in WWIIGI) Adds <num> to the variable <name> with the total in <name> The <num> value can use negative numbers to actualy subtract from.
addvarvar #NAME1 #NAME2 (only available in WWIIGI) Adds variable <name2> to variable <name1> with the total in <name1>
ai $NAME #ACTION #SPEED #INSTRUCTIONS This is an "artificial intelligence" routine(set of instructions) that the computer actors will perform during a game. The <name> is the 'defined' ai routine, identified for use later on. The <action> value is the name of the action that the actor will use. The <speed> is the rate of movement the actor will use when a.i. <name> is called, negative values are allowed in this argument. The <instructions> are hardcoded sub-routines, each having unquine behavior. If you want to stack a few instructions, just place each of them on the same line. EX: randomangle dodgebullet fleeenemy The actor seems to see if it will end in a water sector at the end of its executed a.i. routine, if so, then return true. Effectively considering the boundry between the water and the dry sector as a wall. It maybe used to block them from walking into the water and from jumping into the water. The known legal values for <instructions> can be found in The Primitive Declaration Document under ai See the RTCM document "con-primitive-declarations" for more information.
ai $NAME Calls the previously defined ai routine <name> to be the current actors routine. See the RTCM document "con-primitive-declarations" for more information.
Section "B"
betaname un proven
blood #AMOUNT (only available in Duke3D Lameduke 1-3-95Beta) Spews <amount> of blood from the current actor.
break Halts and then exits an execution within an action, actor or state. Hardcoded function, no arguments, nor any required.
break; (available in Redneck Rampage RA) Halts but does not exit? an execution within an action, actor or state? The use of a semi-colon ";" after break such as "break;" does what?
Section "C"
cactor $ACTOR Changes actors, from one to the other <actor>, ignoring the new actors own initialization values and continue useing the current strength, movement, palette, size, action, and AI of the original actor.
clipdist #NUM The <num> parameter can be any value from 0 to 255. When a sprite or actor is blocked via primitive cstat (or in BUILD Editior), a CLIPing DISTance or bubble is formed around a sprite. This bubble isn't really present in the game, its more like a sensor detecting collision of actors or sprites. The <num> value is the distance from the center of the protected sprite to the outer circumference of the bubble. This ultimately determines how close an actor can get to the protected sprite before being blocked or stopped (You can not pass through). The lower the value, the smaller the bubble. A clipdist of 255 equals the distance of the largest grid size in BUILD, which is 1024 basic Build units. The default for <num> is 32. The default is applied if no <num> is supplied by you.
count #NUM Sets the current actors count to <num>. 30 counts is 1 second, 150 counts
is 5 seconds and 10 counts is 1/3 of a second.
cstat #SUM Allows manual setting of the <sum> of the attribute bit(s) of the current actor or sprite., (16 bit, unsigned integer) , a very powerful function. Thus Changing STATus. All previous settings are lost when this function is used , however the Change is temporary. See the primitive cstator below, for legal values for <sum>.
cstator #NUM (only available in Duke3D v1.5, NAM, WWI GI) Same as cstat, but it doesn't reset all the previous settings. It just adds the ones
you specify. Similar to 'or' in several programming languages. Values for cstat and cstator and there flags (16 bit, unsigned integer hardcoded flags)
To use more than one setting, add the values together (264 = solid (256) +
upsidedown (8,) 256 + 8 = 264) cstat 10 // Turn upside-down and make translucent. (10 = 8 + 2) another example:
Section "D"
debris $SCRAPGROUP #AMOUNT This primitive produces pieces of flying debris or particles(actor). The <scrapgroup> parameter is the actor used for the debris/the sprite animation used for the debris. The higher the <amount> value, the more debris. A practical <amount> would be 2.
debug PARAMETER Prints the value of <parameter> to the output buffer. If a standard game is
loaded, with the default output buffer being used(which is?), it will print the value to
the screen in the standard font.(viewable via cheat code: DEBUG) If the output
buffer is altered...
define $NAME #NUM Defines <name> to be value <num>. Basically it allows you to use the
supplied name instead of handling digits all the time. This ultimately organizes your
scripts for easy reference. If for some reason you need to change the value, changing one
is allot easier than replacing many. The CON parser will replace every
occurrence of
<name> with <num> when compiled. Ex:: define MAXPLAYERHEALTH 100 This is called externally only, within the script. See the RTCM Document "con-user-con" for more information.
definelevelname #EPISODE #LEVEL $MAPNAME #LEVELPAR #RECORD $LEVELNAME Is used to define the episode, level number, map file name, level par, record times and level names for each level. This is typically handled in the user.con for organization. This is called externally only, within the script. The numbering scheme when using this primitive is a tab bit confusing, lets figure this out. The level and episode numbers starts off at zero. For the first level. Level 1 is actually #0 in the CON file, thus Level 4 is actually #3 in the CON file. (The practice of starting a range of numbers with zero to equal an unequal number is common practice with programmers, gives you more digits to work with.) Also for good practice, always pad the par and record times with a leading 0 if your using single digits. Level file names cannot exceed 13 characters. Level par cannot exceed 5 characters min:sec (mn:sc) Level titles cannot exceed 32 characters. See the RTCM Document "con-user-con" for more detailed information.
definequote #NUM $QUOTE Binds a string to a number. The string can now be displayed by using the 'quote'
primitive. See the RTCM Document "con-user-con" for more detailed information.
defineskillname #NUM $SKILLNAME (only available in Duke3D v1.5, NAM, WWI GI) Defines <num> to be equal with <skillname>. This is called internally, it allows you to assign your own custom title to each difficulty level in the games selection menu. Legal values for <num> are: 0, 1, 2 and 3(They are the four difficulty levels in the game) <skillname> can be 32 characters in length.
definesound $NAME #FILENAME #PITCH1 #PITCH2 #PRIORITY #TYPE #VOLUME The <name> parameter is the name of the sound you use within your code.
Typically
it resembles the file name. The <filename> is the name of the .voc or the .wav file
the game loads when the sound <name> is called. The <pitch1> and
<pitch2> values are random pitch variations, they can be positive or negative. The
<priority> is the importance of the sound, the game only can play so many sounds at
once, setting the sound priority higher indicates you want the game to play this sound
instead of another sound if to many are already playing. Legal values are 0 to 255. The
<type> is the type of sound in the game, a bit parsed value. The <volume> is
the loudness mix of the sound, ranging from -32,767 to 32,767.(signed integer)
Negative values are louder and positive values are softer.
definevolumename #EPISODENUM $EPISODENAME (only available in Duke3D v1.5, NAM, WWI GI) Defines a custom title for each episode where <episodenum> is the episode number and <episodename> is the name you provide.
destroyit (only available in Redneck Rampage RA) unproven
Section "E"
else This is used in "if-else" statements. This returns true if the last function returned false. EX:
enda END an Actor or userActor function, closing it.
endevent END an EVENT_NAME, closing it.
endofgame #NUM Ends the game after <num> counts down. For an example, a value of 180 would end the game after approximately 6 seconds (30 = 1 second). A value of 52 is normally used to end each episode. This primitive is usually used at the end of each episode to provide enough time to view the boss death scenes and allow adequate time to read level 'scores'.(break time!)
ends ENDs a State function, closing it.
Section "F"
fakebubba (only available in Redneck Rampage RA) un proven
fall Let the current actor fall at an increasing speed until it hits a surface. Value for acceleration is hardcoded. (?GENERICIMPACTDAMAGE may be associated?)
feathers #AMOUNT (only available in Redneck Rampage) This hardcoded actor spawns <amount> of feathers up and outwards.
Section "G"
garybanjo (only available in Redneck Rampage RA) un proven
gamestartup This is the startup function that sets the initial values for the game. It gets all the
hardcoded values passed as parameters. They are the first parameters that are compiled
during launch. These variables can not be changed later in the CONs. There are a number of
parameters not shown here that can be passed, and can be customizable. For WWIIGI This is the actual gamestartup list DEFAULTVISIBILITY
Starup Variables and arguments The parameters below are called externally. // Startup variables define SWEARFREQUENCY 100 // The lower, the less.
gamevar $NAME #NUM FLAGS (only available in WWII GI) Defines and sets the initial value for a variable. Typically used with the enhanced weapon system, but can be used in several other ways. See the RTCM document "con-primitive-declarations" for more information.
getlastpal Sets the palette of the current actor back to the color(#numerical) before the last or previous change.
globalsound $NAME Play a sound that can be heard everywhere in the map. The <name> is the name of the defined sound to play, not the filename. Volume output equals that of a RTS playing back-Very Loud. (?The maximum distance this can be heard is questionable? re-review?)
gravity (only available in PaintBrawl) Un proven primitive
guts #ACTOR #AMOUNT 'Minor Particles,' .This primitive is not limited to just body parts, however that is its original function, to spawn actors from the current actor. The <amount> value determines the amount of 'guts' to make fly(spawn) from current actor. Legal values for <actor> can be found below.
Section "H"
hitradius #RADIUS #STRENGTH1 #STRENGTH2 #STRENGTH3 #STRENGTH4 Sets an actor/explosion/weapons (1670 RADIUSEXPLOSION) Blast radius(globe) and damage amount (not the actual animation but just the damage.) The <radius> value is the maximum distance from center to the outer most distance that the explosion can cause damage(concussion/burn/fragments etc). The <strength1> value is the strength or damage that is inflicted between 75% to 100% range. The <strength2> value is the damage that is inflicted between 50% to 75% range. The <strength3> value is the damage that is inflicted between 25% to 50% range. The <strength4> value is the damage that is inflicted between 0% to 25% range. Note: value <strength1> is normally the least amount of damage since it is the farthest from center. However special effects may require otherwise. Example: You might want to produce an engulfing explosion, where the most damage would be at value <strength1> and increase as it moves towards center.
Section "I"
ifaction #ACTION { line of code } Checks to see IF the current actor is executing this <action>. If so, then return true. ifaction 0 would return true if no action is executed.
ifactioncount #AMOUNT Checks IF the current actors animation has
ifactor #ACTOR Checks if the current actor matches this <actor>(A numerical value of an actor.) If so, then return true
ifactorhealthg (only available in Redneck Rampage RA) un proven
ifactorhealthl (only available in Redneck Rampage RA) un proven
ifactornotstayput Checks if the actor has been executed EX: Seen by the player or the actor has seen Duke. If either has 'seen' each other then return as true, execute actor code. It also checks if the current actor is not set as 'stayput,' if not then return as true, allow activation of the actor code. (A stayput actor is a sprite that has been 'textured' with the stayput tile image.) Some actors activate immediately (such as 487 and 489) You can spot an actor just before and during its being executed, whats it do? It "falls," drawn above the world and then dropped into place. Another example: When you enter a room and a liztrooper is just standing there, not doing anything. A split second later the trooper comes to life.(the actor isn't free roaming) Normally you shouldn't see to much of this while playing, however if your running at low frame rates then it will almost always occur.
ifai $NAME Checks if the current actor is using the ai <name> that has been previously defined.
ifangdiffl #ANGLE (only available in Duke3D v1.5, NAM, WWII GI) Checks if the angle between the current actor and the player is less than <angle>. If so, then return true. 360 degrees is a value of 2048.
ifangdiffg #ANGLE (only available in Duke3D v1.5, NAM, WWII GI) Checks if the angle between the current actor and the player is greater than <angle>. If so, then return true. 360 degrees is a value of 2048.
ifawayfromwall Checks if an actor is away from all or any wall(?hardcode constant is?) If so, then return true. Walls also include sector divisions, the red lines in the game.
ifbulletnear Checks if an actor is near a 'flying' bullet or other projectiles that use impact damage. If so, then return true. This primitive has questionable results. One test I did is to have a sound play if a bullet was near the player(an idea to generate excitement post Crow and Pre Matrix), I never heard the sound. It maybe more useful for A.I. actors? The actual value for "near," the distance is 8 BUILD Units.
ifcansee Checks if the current actor can see a target(player only, makes it hard to make helper bots). If so, then return true. Dual Function: When using ai functions like seekenemy and some others(?all or which?) you will need to call ifcansee when using ai functions to allow most routines to work 'correctly.' If you do not call ifcansee while using an ai function then the actor will go to the previous position of the player and just stop there! Effectively ending its routine.
ifcanseetarget Checks if the current actor can see a target(player only, makes it hard to make helper bots). If so, then return true
ifcanshoottarget Checks if the current actor can shoot a target(shoot player only, makes it hard to make helper bots). If so, then return true
ifceilingdistl #DISTANCE Checks if the current actors true center(center of sprite?) is less than <distance> to the ceiling. If so, then return true
ifcoop (only available in Redneck Rampage RA) (?The primitive has not been tested or provin' to exist?)
ifcount #AMOUNT Checks if the current actors local counter has reached a <amount> of
counts. If so, then return true
ifdead Checks if the current actor had more than 0 strength(was alive) but is now dead(at 0 strength.) If so, then return true. EX: The actor must have started with some strength to become dead. For some situations(?which?) the primitive ifhitweapon must be called prior to using the ifdead function.
iffloordistl #DISTANCE Checks if the current actors true center(center of sprite?) is less than <distance> to the floor. If so, then return true
ifgapzl #AMOUNT Checks if the distance between the floor and ceiling is less than <amount> at the current actors location. If so, then return true
ifgotweaponce #VARIABLE Checks if <variable> in multiplayer game settings(no weapon spawn, in cooperative or dukematch), is set to 0. If so, return true and restrict player from getting more than one of each weapon type. EX: The player can only get this weapon type if they don't already carry it. Checks if <variable> in multiplayer game settings(no weapon spawn, in cooperative or dukematch), is set to 1. If so, return true and restrict player from getting the current weapon he is touching/near. EX: The player can not get this weapon type at all.
ifhitedge (only available in Duke3D 1.0) un proven, non functioning?
ifhitspace Checks if the player (player actor is APLAYER or 1405, meaning any player-all share same code) or the nearest player is pressing the use key. This is set in the config file, default is the space bar.
ifhittruck (only available in Redneck Rampage) Checks if the current actor hit(touched) the truck(tags?), if so return true. This does not check if the truck hit an actor.
ifhitweapon Checks if the current actor has been hit by a weapon. This does not check which weapon it was.(Makes it hard to check weapon types and make helper bots)
ifinouterspace Checks if the current actor is in outerspace. "Outerspace" means when the sector is parallaxed and the texture is one of these space textures(84-89 inclusive) and the ceiling or (?what if both?) floor palette on the BigSpace texture is 0. If so, then return true. This will instantly kill the actor with out a spacesuite(the game doesn't have a working spacesuite code.)
ifinspace Checks if the current actor is in space. "Space" means when the sector is parallaxed and the texture is one of these space textures(80-89 inclusive). If so, then return true.
ifinwater Checks if the current actor is underwater.(a sector with a lotag of 2) If so, return true.
ifwind (only available in Redneck Rampage RA) un proven
ifmotofast (only available in Redneck Rampage RA) Checks if the current actor motorcycle is moving fast. The defined speed is hardcoded.
ifmove #NAME Checks if the current actor is using the predefined movement <name>.
ifmovecount #NAME (only available in Duke3D Lameduke 1-3-95Beta)
ifmultiplayer Checks if the current multiplayer game is in cooperative mode. If so, return true.
ifnocover (only available in Redneck Rampage) un proven
ifnosounds Checks if the current actor is not playing any sounds. If so, then return true.
ifnotmoving Checks if the current actor is still moving within the game freely. If so, return true. Ex: If an actor is "stuck" between walls (such as at joining points or an a.i actor monster stuck near a door) - at which point the operate(open and check) primitive can be used to allow the stuck actor to try and free himself. (Smart A.I.)
ifonboat (only available in Redneck Rampage RA) Checks if the current actor is on the boat(?tile num?). If so, then return true.
ifonmoto (only available in Redneck Rampage RA) Checks if the current actor is on the motorcycle(?tile num?). If so, then return true.
ifonmud (only available in Redneck Rampage RA) Checks if the current actor is on mud(tile 7889). If so, then return true.
ifonwater Checks if the actor is in above or near the water surface(sector with a lotag of 1.) If so, return true.
ifoutside Checks if the actor is outside(a sector with a parallaxed surface.) If so, return true.
ifp #CONDITION Checks if the current <condition> is true. If so, then return true. EX: If player is doing this <condition> then do this. Legal values for the <condition> parameter:
ifpdistg #AMOUNT Checks if the players distance from the current actor is less than <amount> If so, then return true. A value of 1024 is equivalent to the largest grid size in Build.
ifpdistl #AMOUNT Checks if the players distance from the current actor is less than <amount>. If so, then return true. A value of 1024 is equivalent to the largest grid size in Build.
ifpdrunk (only avalable in Redneck Rampage RA) Checks if the current player actor is drunk.(meter level?) If so return true. The defined level of alcohol is Hardcoded. (??)
ifphealthl #AMOUNT Checks if the players health is less than <amount>. If so, then return true.
ifphealthg #AMOUNT Checks if the players health is greater than <amount>. If so, then return true.
ifpinventory #ITEM #AMOUNT Checks if <item> is not equal to <amount> If so, then return true. Look at the description again, you will notice this does not test a less than, it tests a not equal to. In the original CONs it appears as if it is testing an 'if it is less than.' but its not. This has been determined several times by different editors over the years attempting to properly use 'ifpinventory.' Its not really consistent with the way other primitives work, but then again these are the CONs. Legal values for <item> can be found below. If you want to test if the player has a given amount of inventory( does #ITEM have #AMOUNT ), try this example code: ifpinventory #ITEM #AMOUNT { nullop } else { optional lines of code } Notice the nullop, this will allow this primitive to be used as: ifpinventory is not equal to amount, it is equal, so do this The following is an example of using inventory items as Variables, this was pulled out of NewWorld 3 TC for DN3D v1.3!(by James Ferry.) The TC also contains many other longer examples of this type of function (about 1000 lines or so), to control the flame-thrower's fuel, the credit clips, and the buying/purchasing, as well as the persuading. A mile-stone in CON Hacking. This is the code for the blue flag during a CTF type game. The code checks if the player is on the other team (If so, give them the red flag) or its own team (If so, take the red flag away). This code has been tailored for this example. ifpdistl FLAG_CAPTURE_DIST ifhitspace // close enough and hitting space { ifpinventory GET_FIRSTAID 2 { } else // is the team red { addinventory GET_FIRSTAID 4 quote 163 } // if so, give flag ifpinventory GET_FIRSTAID 3 { } else // is the team blue and has flag { addinventory GET_FIRSTAID 1 // take the red flag away quote 164 // and tell them they have scored } }
Heres a simple little trick using ifpinventory:
Values for ifpinventory <item>
ifplayersweapon WEAPON#x (only available in Duke3D Lameduke 1-3-95Beta) Checks to see which <weapon#x> the player used to attack with. Which player <weapon#x> hit the current actor. Valid values for <WEAPON#x>:
ifrespawn Checks if the current actor is an item(weapons, ammo, etc.) or an A.I. actor(monstors,) currently active(code is being executed.) If so return true. If both factors are not met then it will return false.
ifrnd #NUM Generates a random probability of something happening. The <num> value is divided by 256(100%). Example, a <num> of 128 would result in a 50% chance of happening. So a <num> of 256 would happen all the time. (Formula: <num>/256 = # = %).
ifsizedown (only available in Redneck Rampage RA) un proven
ifskill #NUM (only available in Duke3D Lameduke 1-3-95Beta) Checks if skill level is <num> If so, then return true. (Skill 1-4)
ifspawnedby #ACTOR Checks if the current actor was spawned by <actor>. If so, then return true.
ifspritepal #NUM Checks palette <num> to see if it matches the current actors palette. If so, then return true. See the primitive 'spritepal' for palette values and explanations. INTRODUCTION: ADDING NEW ACTORS THE EASY WAY:
ifsquished Checks if an actor has been squished. Squishing occurs under several situations, being shrunken and stepped on, by being in a space to small exist in(i.e. - falling sector, the ceiling height of the sector is the same height at the floor height of the sector), teleporting to a killer shaped sector, or in a squishing sector.
ifstrength #AMOUNT Checks to see if the current actors health is at <amount> or less.
ifsounddist $AMOUNT (only available in Redneck Rampage RA) Checks to see if the current sound is playing at distance <amount>. If so then return true.
ifsoundid $NAME (only available in Redneck Rampage RA) Checks to see if the current sound <name> is playing. The <name> is the name of the defined sound to play, not the filename.
iftipcow (only available in Redneck Rampage) Checks to see if the current actor is being tipped over, checks if tipping animation is currently being used. If so return True.
ifwasweapon $WEAPON Checks <weapon> to determine which weapon hit the current actor. This primitive only functions properly if called after the ifhitweapon primitive. If so, then return true. Legal values for ifwasweapon <weapon>:
ifvarg $NAME #NUM (only available in WWII GI) Checks if the game variable <name> is greater than the value <num>, if so then return true.
ifvarl $NAME #NUM (only available in WWII GI) Checks if the game variable <name> is less than <num>, if so then return true.
ifvare $NAME #NUM (only available in WWII GI) Checks if the game variable <name> is equal to value <num>, if so then return true. See primitive 'setvar' for some valid pre-set system variables.
ifvarvarg $NAME1 $NAME2 (only available in WWII GI) Checks if the game variable <name1> is greater than game variable <name2> , if so then return true.
ifvarvarl $NAME1 $NAME2 (only available in WWII GI) Checks if the variable <name1> is less than variable <name2> , if so then return true.
ifvarvare $NAM1 $NAME2 (only available in WWII GI) Checks if the variable <name1> is equal to variable <name2> , if so then return true.
include $FILENAME Includes the <filename> into the location where this primitive has been called from. This is typically used to parse or combine multiple CON files to be compiled together as one. You may place these where you see fit, remember the defines all have to be done before you use them amongst the code. The <filename> can only be 13 characters long.
isdrunk (only available in Redneck Rampage) un proven
iseat (only available in Redneck Rampage) un proven
Section "J"
none
Section "K"
killit Removes the current actor from the game map. Effectively "killing" the actor.
Section "L"
lotsofglass #AMOUNT The hardcoded actor spawns <amount> of glass shards. normally used to show a glass pane breaking.
larrybird (only available in Redneck Rampage RA)
Section "M"
mail #AMOUNT (only available in Duke3D v1.5, NAM, WWI GI) The hardcoded actor will spawn <amount> of envelope sprites up and outwards, they then float to the ground.
mamaend (only available in Redneck Rampage RA) Ending(E2L7) animations and routines for the dieing mamma jackalop(tile 7805 pal 32)
mamaquake (only available in Redneck Rampage RA) Animations and routines for when mamma jackalope jumps, the ground shakes.
mamaspawn (only available in Redneck Rampage RA) Mamma jackalope spawns out a baby to protect her. Every few hits on her causes a baby creation.
mamatrigger (only available in Redneck Rampage RA)
mikesnd Plays the sound assigned to the microphone sprite in BUILD(the microphone sprite's hitag is the sound number to be played). This seems for use with the microphone sprite only.(Hardcoded behavior)
money #AMOUNT The hardcoded actor will spawn <amount> of dollar bill sprites, up and outwards. It then gently floats to the ground.
motoloopsnd (only avalable in Redneck Rampage RA) Plays the assigned motorcycle engine sound(?filename?) and loops it.(Hardcoded behavior)
move $NAME #HORIZONYALSPEEDXY #VERTICALSPEEDZ #INSTRUCTIONS Defines <name> to a horizontal <horizontalspeedxy> and vertical <verticalspeedz> speed. <instructions> is optional. Calling Syntax: move $NAME #INSTRUCTIONS1 #INSTRUCTIONS2 The actor seems to see if it will end in a water sector at the end of its executed a.i. routine, if so, then return true. Effectively considering the boundary between the water and the dry sector as a wall. It maybe used to block them from walking into the water and from jumping into the water. The known legal values for <instructions> can be found in The Primitive Declaration Document under ai LameDuke Special: move $NAME #HORIZONYALSPEEDXY #VERTICALSPEEDZ #INSTRUCTIONS Sets a <name> to a horizontal <horizontalspeedxy> and vertical <verticalspeedz> speed. <instructions> is optional. With total in <name> If <horizontalspeedxy> or <verticalspeedz> is not set, the con parser
asumes 0. The known legal values for Lameduke <instructions> are:
music #FLAG FILENAME1 FILENAME2 ... Defines the MIDI music usage for the game. If <flag> is 0, then the first song would be played at the main title and the second song would be played at the ending of the entire game(allowing a maximum of two songs for <flag> 0.) If <flag> is 1, 2 or 3 ...then these are used to define each level in each episode <flag>. The first song <filename1> will be for level 1 and the second song<filename2> is for level 2 ...etc... This is normally defined in the USER CON. See the RTCM Document "con-user-con" for detailed information.
Section "N"
newpic #TILE (only available in Redneck Rampage RA) Calls for a new tile image to be displayed <num>
nuke (only available in Duke3D Lameduke 1-3-95Beta) Spawns a sprite that resizes, grows and shrinks very quickly with two explosions.(Hardcoded action - can not alter the tile order, etc...)
nullop Another way to signify empty braces - { }. This function means 'do nothing'
Section "O"
operate If the current actor is close enough(distance?) to a swinging door it will open(if
closed) or close (if open)
onevent #EVENT_property (only available in WWII GI) Calls a specified <event> to be processed. Most events are followed by a RETURN code. See the RTCM document "con-primitive-declarations" for more information.
Section "P"
palfrom #INTENSITY #RED #GREEN #BLUE The current screen palette of the current player, or closest player, is optionally set by a specified color (<red> + <green> + <blue> equals new color) The <intensity> is how fast it will flash, dropping one level of intensity after each flash. Effectively slowing the flashes down. The values for the parameters can be between 0 and 64 Negative values are considered zero and default values are 0. You may use a higher value than 64 to create 'special effects' as the palette spills into another region.
paper #AMOUNT (only available in Duke3D v1.5, NAM, WWI GI) The hardcoded actor spawns <amount> of paper sprites up and out wards, floating gentle down to the ground.
pkick The current or closest player will use the weapon "quick kick." Using the kick image(Hardcoded arguments) Note, in multiplayer this 'action' is drawn to be seen by the other players.
pstomp The current players, or the nearest player view will shift down(and turn if actor is to the side), and the nearest actor will be squished(if one is present) The player's view will then shift back to normal.(Hardcoded arguments) I found if there are many(alot!) actors near a player that is stomping, it could produce unusual effects.
Section "Q"
quote #NUM Prints quote <num> at the top of the screen. <num> is a predefined by definequote See the RTCM Document "con-user-con" for more information.
Section "R"
resetactioncount Resets the current actors action counter to 0. This counter counts the number of frames in the animation that an action has displayed.
resetcount Resets the current actors local counter to 0. This counter counts the number of frames in the animation that an action has displayed.
resetmovecount (only available in Duke3D Lameduke 1-3-95Beta) Resets the current actors local counter to 0. This counter counts the number of frames in the animation that an action has displayed.
resetplayer During a multiplayer game, it will reset a player(usualy used after death). It places him at any(Hardcoded, random?) of the starting positions, with default amounts of ammo, armor and health. Weapons are also set to default. The player is then able to continue playing in the same game without starting the entire game over. During single player games it will reset the map aswell.
respawnhitag Executes any nine(9) actors who have the same lotag as the current actor's hitag. Effectively respawning.
rise (only available in Duke3D 1.0) un proven, non functioning?
rndmove (only available in Redneck Rampage RA)
runningspeed
Section "S"
shadeto #NUM (only available in Duke3D 1.0) Direct control to the shade values <num> of sprites. Negative numbers work aswell.
state #NAME { lines of code } ends To begin with, there are three main STATEments one must get to know when hacking a GAME.CON type file, they are: action, actor, and state. The state declaration is simply a collection of statements that will execute a subroutine or procedure when called. A state doesn't use any arguments other than the <name> (You can't define or pass parameters in a list) Creates a function called <name>, <lines of code> can be added within the state. This must be closed with the ends function. Internally this calls the predefined state <name> and is treated as a normal function, no additional arguments or routines. See the RTCM document "con-primitive-declarations" for full details. Predefined State Functions are listed below.
state #NAME This primitive calls a state function, <name> being the name of the state function called. The state function called must have been predefined above where this line calls from. See the RTCM document "con-primitive-declarations" for full details. Predefined State Functions are listed below.
Predefined State Functions The following is a listing of (most) state functions that already exist in the GAME.CON file. You can alter these to your liking, but the default functions are described here. The states are listed in order of appearance (at least in the 1.4/1.5 CON files).
state jib_sounds Plays one of those nice sounds like "What a mess" or "Let God sort em' out".
state standard_jibs Spawns some random body parts.
state genericshrunkcode Shrink an actor and stomp on it if you are within the correct distance.
state genericgrowcode (Versions 1.4/1.5 Only) Make the current actor grow and then explode.
state blimphitstate Spawn an explosion and debris, kill the actor, and some other stuff...
state rats Spawn some rats.
state toughgalspeech (Versions 1.4/1.5 Only) The sounds to play when the tough girl talks.
state jibfood (Versions 1.4/1.5 Only) Make food disappear when shot and spawn some gross jibs.
state breakobject (Versions 1.4/1.5 Only) Code that makes all the breakable objects in versions 1.4 and 1.5 break when shot by the player.
state headhitstate Gets called when player is hurt badly. The screen tilts when the player gets hit and his health is very low.
state burningstate Set the current actor on fire.
state steamcode Update steam sprite, subtract health from player who is near, etc.
state random_ooz (Versions 1.4/1.5 Only) Spawns some ooze.
state burningbarrelcode Code for a burning barrel.
state getcode Gets an item and prepares it for respawn (if necessary).
state randgetweapsnds Plays a random sound when a weapon is picked up by the player. Examples are "Groovy" or "Come get some!".
state getweaponcode Gets the current weapon and prepares it for respawn if necessary.
state respawnit Respawn items in a multiplayer game.
state quikget Get code for the atomic health or other items. Does not cause the sprite to respawn.
state quikweaponget Get code for weapons.
state firestate Updates flames, checks to see if Duke is burning himself, etc.
state drop_ammo Drops ammo if the odds for dropping it are right.
state drop_battery Drops chaingun ammo if the odds for dropping it are right.
state drop_sgshells Drops shotgun ammo if the odds for dropping it are right.
state drop_shotgun Drops shotgun if the odds for dropping it are right.
state drop_chaingun Drops chaingun if the odds for dropping it are right.
state random_wall_jibs Spawns blood on the walls when an enemy is shot and near a wall.
state femcode Takes care of the female actors in the game.
state killme Lets some women say "kill me" when the player presses the space bar near her.
state tipme Lets Duke give some women a dollar bill and say "Wanna dance" or "Shake it baby".
state toughgaltalk (Versions 1.4/1.5 Only) Make the tough girl talk when the player presses [SPACE].
state troop_body_jibs Spawns some trooper body parts.
state liz_body_jibs Spawns some lizard body parts.
state standard_pjibs Spawns some Duke body parts.
state handle_dead_dukes The code for making blood pools, etc. when Duke dies. Also handles the disappearing for Duke's body in multiplayer.
state check p_standard Makes the animations of Duke walking when walking, jumping when jumping, etc.
state rf Changes the cstat to 4 ifrnd 128, else it makes the cstat 0. This is used in flipping corpse sprites so they don't all look the same. There are too many enemy states to put here, but they all cover the basic artificial intelligence routines for each enemy.
state headhitstate { } ends This is really a custom state that gets called externally in the original CONs when the player gets hit while low on health.(how low?) The state basically contains the 'wackplayer' primitive only. Remarked out to prevent functioning. You may make use of this state to include other code if you so desire to produce special magical effects or other ideas. See 'wackplayer' primitive.
setvar $NAME #NUM (only available in WWI GI) Sets the variable <name> to be value <num> Will work with negative numbers. Here's some valid pre-set system variables: You are not limited to these, but these have special purposes.
You may wish to paste the following con lines into the GAME.CON under definitions. // Pre-set system variables(system) gamevar RESPAWN_MONSTERS 0 0
setvarvar $NAME1 $NAME2 (only available in WWI GI) Sets the variable <name1> equal to variable <name2> So <name1> is now the same variable value.
shoot $WEAPON Allows the current actor to spawn/shoot - eject - fire the specified projectile <weapon>. The direction that the <weapon> is fired depends on the A.I. function of the actor/ current direction facing. Legal values for shoot<weapon>:
sink (only available in Duke3D Lameduke 1-3-95Beta) Let the current actor sink into the water.
sizeat #X #Y (only available in Duke3D v1.5, NAM, WWI GI) Instantly resizes the current actor to <x> width and <y> height.
sizeto #X #Y Resizes <x> width and <y> height in real time(not instantly)
slapplayer (only available in Redneck Rampage RA)
sleeptime #TIME Sets the current active actor to deactivate(sleep) for <time> counts. The current actor is not executed again until it "sees" the player.
smackbubba (only available in Redneck Rampage RA)
smacksprite (only available in Redneck Rampage RA)
sound #SOUND Playsback <sound> as a local sound (heard by the closest or current player). This
primitive allows multiple occurrences of the <sound> to be played at once, if
desired.
soundonce #SOUND Playsback <sound> as a local sound (heard by the closest player or current player
only) The sound cannot be activated again until it has completely finished playing.
soundtag (only available in Redneck Rampage RA)
soundtagonce (only available in Redneck Rampage RA)
spawn #ACTOR Spawns a predefined <actor> into the game at the location it is called. Some actors can be spawned to create special effects. The actors below are effected by the spawn primitive differently than other actors. They are:
spritepal #PALNUM Changes the current actor's - current image palette to <palnum>. Legal values for <palnum> are listed below. Values for spritepal <palnum> The following is a listing of all the legal values for the spritepal primitive. Palettes can effect 3 different 'layers' of a tile. The easiest way to understand these 3 different 'layers' is by using the stripper sprite. The 3 'layers' are: Background (her skin), Foreground (her clothes), and Minor Foreground (money, accessories, etc).
Note: There are advance ways of using the spritepal to actualy identify an actor, Ex: CTF type games such as Duke Arena demonstrate this. NYK came up with this method inorder to allow TRUE CTF game play. Also I think you can use similiar coding to allow two objects to travel together, such as a motorcyle and rider. I may be wrong on the last since it has been so long. (?reminder, review?) See the primitive 'ifspritepal' for additional information. The following is a palette list you may wish to put in your CONs. It was tested on the Stripper sprite due to the multiple layers. Copy and paste it into the beginning of the GAME.CON or in your USER.CON // //////////////////////////////////////////////////////////////////////////
stopsound $SOUND Stops the <sound> from playing.
strafeleft (only available in Redneck Rampage RA) unproven
straferight (only available in Redneck Rampage RA) unproven
strength #AMOUNT Changes the current actors strength (health) to that of <amount>.
Section "T"
tearitup (only available in Redneck Rampage RA) unproven
tip Starts the current or closest player's "tipping" animation routine(Hardcoded action - can not alter the tile order, etc...)
tossweapon This primitive spawns(tosses) the player's currently selected weapon when the player dies. The weapon then becomes an item(minor actor) that can be obtained.
Section "U"
useractor useractor #INSTRUCTIONS $NAME #STRENGTH {actor code} { AI_FUNCTION code} enda (available in DN3D v1.5, NAM, WWII GI) See the RTCM document "con-primitive-declarations" for all the details.
Section "V"
none
Section "W"
wackplayer (only available in Duke3D v1.3 , v1.5, NAM, WWII GI) Tilts the the screen to one side. The players head is tilted.(Hardcoded routine) Most
commonly used for blows to the head or other body jarring effects.
weapon#x (only available in Duke3D Lameduke 1-3-95Beta) Weapons 1-5
Section "X"
none
Section "Y"
none
Section "Z"
none
-
|