Not logged in, Join Here! or Log In Below:  
 
News Articles Search    
 

 Home / Game Design & Programming / Binding actions from scripts to characters in game (?) Account Manager
 
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.
 
Vast

January 16, 2005, 11:00 PM

Ok, i have lua bound to my engine, and i have my models loaded. I dont really have a level format (besides from a modified Quake3 BSP but i plan for it to become part of a larger level format, which would include entities). So what i need to know, is say, i have a script, that animates an entity, and moves it according to a view vector. Actually, i have a FILE, that has many functions, and one of them, is ACTION_ai__() which does the job.

How could i have an entity suck everything from the ACTION_ai__ and behave accordingly to it?

thanks.
Tim

 
I'M BRIAN FELLOWS

January 16, 2005, 11:14 PM

SWITCH(M_CURRENTSTATE)

 
Vast

January 16, 2005, 11:30 PM

Could u be more specific please? Im looking for an indepth info...

THanks.

 
XycsoscyX

January 16, 2005, 11:43 PM

Can't you assume a type of "this" pointer to all the scripts? Basically, an entity loads a script, when the script runs, it has variables (like view vector, position, etc), whenever those get modified in the script, the entity is basically performing this->viewvector and this->position. Basically, having a set or predefined variables iside your logic scripts, and setting those to the values of the current entity when the script is run (and retrieved after, I dunno how lua works, if you can actually pass the data to the script as a pointer, so that it modifies it directly), else you'll simply have to retrieve the data after the script executes.

 
Vast

January 17, 2005, 12:04 AM

Im not sure exactly what you mean. So, each entity script would have a this pointed to all the possible fields for that object?

 
This thread contains 5 messages.
 
 
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.