Project 6: Advanced Computer Graphics: C-Script Editing with SED


Reference for this project: Chapter 7 (Link to page of draft book chapter. )


x
Figure 1.  An extremely simple level.


Basic Output: Error messages

x
Figure 2.  Error message.



Adding Actions

x
Figure 3.  Player and fish added.



Adding Keyboard Controls and If Statements


Adding Functions and Triggers

x
Figure 3.  Player and second fish added.



Creating and Animating New Entities

var tw_walk_counter;
action tw_walk
{
    while(1) //start loop
    {
    tw_walk_counter = tw_walk_counter + 1;     //add to walk counter
     //ent_frame("walk",tw_walk_counter);          //old style syntax, pre 6.31
    ent_animate(me,"walk",tw_walk_counter,ANM_CYCLE+ANM_ADD);  //new syntax
    if(tw_walk_counter >= 100)
      {
        tw_walk_counter = 0;                                 // reset counter at 100 percent
      }
      wait(1);
   }
}
var tw_mod_vector[3]=30,40,50;                             // where entity is located         
string mod_name = <animatedmodel1.mdl>;             //file name of fish entity
function tw_create_mod1() //called by pressing "p"
{
ent_create (mod_name, tw_mod_vector, tw_walk);    //create the fish entity
}
x
Figure 4.  Another model added from within script at corner.


Gravity and Collision Detection

    me.z=me.z-1;
    me.x=me.x+0.5;
x
Figure 5.  Two entities in front of player with one going through floor.


Report and demonstration:



Copyright © 2005- 2007 by Thomas Paul Weldon


ACKNEX, WED, MED, and 3D GameStudio are trademarks of Conitec Corporation.
Microsoft, DOS, MS-Dos, Windows, DirectX, Halo, and Direct3D are trademarks of Microsoft, Inc.

PAC-MAN trademarks or registered trademarks of Namco Limited
Nintendo, Mario, are trademarks of Nintendo
Atari, Pong, are trademarks of Atari
Intel, 8086, are trademarks of Intel Corporation
id, DOOM, and Quake are trademarks or registered trademarks of Id Software, Inc.
Autodesk, 3D Studio, and 3ds Max are trademarks or registered trademarks of Autodesk, Inc.
Alias and Maya are trademarks or registered trademarks of Alias Systems Corp.