While he's technically correct, this can be surpassed, what I do is create a function that has all of the actions I want predefined as integer values, and pass those values to the function, the function from there simply translates what I'm sending to it and creates actions from it.

For an example (I know I murdered the explanation)
Code:
#define action1 1
#define action2 2
#define action3 3

main()
{
    ENTITY* aPointer;
    //specifying a pointer allows you to send it/manipulate it later in this or other functions
    aPointer = spawnFunction(action1);
}

//Usually I'd specify 2 or 3 variables for the vector in 
//order to place it where you want but it's really up to you.
ENTITY* spawnFunction(int action)
{
    if(action == action1)
    {
       ent_create("default.mdl", vector(0, 50, 100), yourAction1);
    }
    else if (action == action2)
    {
       ent_create("raptor.mdl", vector(0, 50, 100), yourAction2);
    }
    else if (action == action3)
    {
       ent_create("tower.mdl", vector(0, 50, 100), yourAction3);
    }
    else
    {
        //you could write an error, or whatever here, it's good practice to use error checking
    }
    return my;
}

//Usually defined somewhere else, like another file
action yourAction1()
{
...
}
action yourAction2()
{
...
}
action yourAction3()
{
...
}


Last edited by Trooper119; 10/05/08 07:19.

A clever person solves a problem.
A wise person avoids it.
--Einstein

Currently Codeing: Free Lite-C