CON PRIMITIVE LIST v1-01-2003 Release 1 © RTCM
Reaper_Man
/!\ Attention: These FAQ's where written before the development of EDuke, many limits do not apply anymore. These CON FAQs was written because I believe that there is no one place where CON information can be found - from the
simplest ideas to the most complex effects. After the fall of Dukeworld and 3D Portal, a web-edition of the CON FAQ seems to have been lost, and that leaves Duke RTCM as the only other source of CON information. Though they do have information on CONs and how to edit them, I don't
believe that this information is easily understood by the newest of newbie's. INTRODUCTION | TABLE OF CONTENTS
To my knowledge, Todd Replogle never named the language that CONs are written written, but it is commonly called "DukeC", since it's syntax resembled the C programming language. It's just a guess, but I think that "CON" means "C On Narcotics". You never know, it could be.
================== TABLE OF CONTENTS ================== */
================ BASIC PRIMITIVES ================ */
break: Forces the code to cut from the current "{ }" or state. /* addphealth (value): Adds (value) to the player's health. Can be a negative number to take health. cactor (actor): Changes the code from the current actor to (actor), while keeping the current strength, speed, action, palette, size, action and AI of the original actor. count (value): Changes the current count to (value). endofgame (time): Ends the current episode in (time) ticks. globalsound (sound): Plays the defined sound (sound), making it audible to every player. include (file name): Includes the file (file name) when compiling the CONs before the game starts. lotsofglass (amount): Spawns (amount) pieces of glass. mail (amount): Spawns (amount) pieces of mail. money (amount): Spawns (amount) pieces of money. paper (amount): Spawns (amount) pieces of paper. quote (quote number): Displays the defined quote (quote number) at the top of the screen. shoot (weapon type): Forces the actor to shoot a (weapon type) projectile. Possible projectiles are: RPG - Rocketsound (sound): Plays the defined sound (sound). soundonce (sound): Plays the defined sound (sound) only if it is not being currently played by any other actor. spawn (actor definition): Spawns the actor (actor definition) into the game. spritepal (value): Sets the sprite's palette to (value). strength (value): Sets the actor's strength to (value). /* addinventory (inventory item) (amount): Sets (inventory item)'s current amout to (amount). addweapon (weapon) (amount): Gives the player the weapon (weapon) with (amount) units of ammo. debris (type) (amount): Spawns (amount) pieces of debris type (type). define (actor) (tile number): Defines the name (actor) to the texture (tile number). This is used for naming actors. guts (type) (amount): Spawns (amount) pieces of guts type (type). sizeat (vertical) (horizontal): Instantly resizes the actor to (vertical)/256 by (horizontal)/256. sizeto (vertical) (horizontal): Gradually resizes the actor to (vertical)/256 by (horizontal)/256. /* (action definition) - names the action; this is the only required modifiermove (move definition) (vertical) (horizontal): Defines a rate of movement. Modifiers are not required, and stand for the following: (move definition) - names the movement; this is the only required modifierai (ai definition) (action) (move) (ai routine): Defines an AI routine. All modifiers are required, and stand for the following: (ai definition) - names the AIList of the basic AI routines available: faceplayer - makes the actor face the direction of the playeractor (actor definition) (health) (action) (ai) (code) enda: Code syntax for an actor. Modifiers are not required, and stand for the following: (actor definition) - names the actor; usually pre-defineduseractor (actor type) (actor definition) (health) (action) (ai) (code) enda: Code syntax for a user-made actor. Only the modifier (actor type) is required, and stand for the following: (actor type) - defines what type of actor the useractor will be either notenemy, enemy, or enemystayputcstat (value): Changes physical characteristics of the actor. They can be added for combined effects. Stands for 'C'ombined 'STAT'istics. List of possible (value)s: 0 - resets all cstat propertiescstator (value): Adds (value) and the current cstat value. Example: actor ACTOR 0 cstat 1 // Make actor solid ... Later in the code ... cstator 1 enda 1 + 1 = 2. The actor's new cstat would make the actor go from solid to translucent. hitradius (radius) (strength 1) (strength 2) (strength 3) (strength 4): Used to make a damage-area (radius) wide that will destroy glass, lights, etc. and cause damage type RADIUSEXPLOSION to actors. The damage area is divided into 4 sections, (strength 1) on the outer edge and (strength 4) being in the center. palfrom (intensity) (red) (green) (blue): Used to change the screen's tint (intensity) strong, with the color of (red), (green), and (blue) combined. Mainly used for when the player picks up items and takes damage from projectiles. Modifiers must be integers from 0 to 63. state (state definition) (statement code) ends: When used outside of an actor primitive, it defines a block of code that can be called by all other actors following it, and must be ended with ends. When used internally, ends is not used, and the code in the defined statement is called. /* if (modifier) { ... statment block 1 ... } else { ... statment block 2 ... } Basically, if modifier is true, then the code in statement block 1 is executed. If it is false, then the code in statement block 2 is execued. If there is no else statement, then nothing happens and the code moves on. ifactornotstayput: True if the actor is not a stayput actor. Stayput actors are ones that do not leave the sector they started out in. ifai (ai definition): True if the current AI is (ai definition). ifaction (action definition): True if the current action is (action definition). ifactioncount (value): True if the current action count is greater than or equal to (value). ifangdiffl (value): True if the difference between the current actor's angle and the player's angle is less than (value). ifbulletnear: True if a projectile is heading toward the actor. ifcansee: True if the actor can see the player. ifcanseetarget: True if the player can see the actor. ifcanshoottarget: True if the actor can shoot at the player, without hitting other actors, walls, etc. ifceilingdistl (value): True if the distance between the actor and the current sector's ceiling is less than (value). Note: One PAGE-UP in Build is equal to 4. ifcount (value): True if the actor's counter is greater than or equal to (value). ifdead: True if the actor's strength is less than or equal to 0. iffloordistl (value): True if the distance between the actor and the current sector's floor is less than (value). Note: One PAGE-UP in Build is equal to 4. ifgapzl (value): True if the current sector's height, floor to ceiling, is less than (value). Note: One PAGE-UP in Build is equal to 4. ifhitspace: True if the player is pressing the use key, spacebar by default. ifhitweapon: True if the actor was hit by a projectile. ifinwater: True if the actor is in an underwater sector. ifmove (move definition): True if the actor is moving at speed (move definition). ifnotmoving: True if the actor has hit a wall or other object, and is no longer moving at the desired speed. ifonwater: True if the actor is in an above water sector. ifp (player event): True if the player is performing one of the following events: pstanding - True if the player is standingifpdistl (value): True if the player's distance from the actor is less than (value). ifphealthl (value): True if the player's health is less than (value). ifpinventory (inventory item) (amount): True if the player's item (inventory item) is NOT EQUAL TO (value). The following code: ifpinventory GET_BOOTS 100 { ... } Is NOT the same as: ifpinventory GET_BOOTS 100 { } else { ... } As James Ferry discovered, the first set of code will be executed if the item (inventory item) is not equal to (value). The second set of code will be executed if the item (inventory item) is equal to (value). This opens up limitless possibilities for CON-made events and triggers. Please read the Inventory Theory for more information. ifplayersl (value): True if the current number of players is less than (value). ifrespawn: True if the game has respawn for enemies and items is on. ifrnd (value): True if (value) is less than or equal to a number randomly picked between 1 and 255. This random drawing resets itself every game tick. ifspawnedby (actor definition): True if the actor was spawned by (actor definition). ifspritepal (value): True if the actor's palette is (value). ifsquished: True if the actor is in a sector with 0 height. ifwasweapon (weapon type): Used with ifhitweapon, true if the actor was hit by one of the following projectiles: RPG - Rocket
|