EDF Editing Tutorial #1 : Calling Scripts With EDF By Joe Kennedy Before we begin I'll assume you have used DeHackEd/WhackEd before and know about the way the frames and actions work and whatever. Righty then, today we'll be learning how to call scrips with EDF. This could be pretty useful if you think about it. Doors opening when all monsters are killed without using linedef 666, a scoring system where you gain points for killing monsters, or as we'll see today, we can use it to insult the player! Today our subject will be the imp. Real imps are mean guys, and wouldn't hesitate to throw a barrage of insults the Doomguy's way. Sadly in Doom they cannot talk and we have been unable to hear their "your mom" jokes and other assorted cussing. Until now! Okay, first of all we'll need to write ourselves a nice function in Small which we will be calling later on. Something like this: public Script1() { _Printf(_MSG_CENTER, "YOU IDIOT!"); } When writing your function remember that Small is case sensitive so it HAS to be Script1 (not script1 or ScRiPt1 or whatever you kids do nowadays). Right so we now have a function that will print "YOU IDIOT!" in the center of the screen. Lovely. Compile this script as gamescr.amx and then embed that file into a WAD as a data lump named GAMESCR. Using our extensive DeHackEd knowledge we can surely say that the imp has 5 death frames organized as so: DEH ETERNITY ACTION ---------------------------- TROOI S_TROO_DIE1 NULL TROOJ S_TROO_DIE2 SCREAM TROOK S_TROO_DIE3 NULL TROOL S_TROO_DIE4 NULL TROOM S_TROO_DIE5 FALL We wanna call a script, so we'll be using the StartScript codepointer (action). We can't just throw StartScript in anywhere, so we'll use a "Delta Structure" called framedelta (think of delta meaning change and you'll see why it's called that) which allows us to modify the properties of a single frame, in our case S_TROO_DIE1. We choose DIE1, by the way, as DIE2 and 5 already have actions we'd like to keep. Anyway, framedelta works like this : ------------------------------------------------------------------------------- stdinclude(root.edf) // We need to include this! framedelta { name = S_TROO_DIE1 // The frame we want to change the properties of action = StartScript // The action of the frame. We could have fall or // scream or another action here instead args = { 1, 1 } // The first number is the Script# we want to // execute, in our case 1 and the second number // shows that the script is a levelscript. See this // for more info: // http://www.doomworld.com/eternity/engine/codeptrs.html#small } ------------------------------------------------------------------------------- Of course if you want to get clever we can stick it all on one line too: framedelta { name = S_TROO_DIE1; action = StartScript; args = { 1, 1 } } Now save that and run Eternity with your wad and the command line parameter "-edf youredf.edf" or just include the files with the Eternity launcher. Note you could also embed the EDF into your wad as a text lump named EDFROOT, and the game would load it automatically. Extra Task! * Randomize the insult!