WildCat,
You need the code for an AI script? As to tell the NPC where the player is supposed to be on hit time, knowing the rocket speed and player movement?
The code for a guided rocket, as AcidCrow said?
Or other?
------------------
Acid, I think you could help me on a similar case with a hand in the back:
I'm trying to write a cinematic action. The objective is to make it so easy to use, no wdl would be touched by the level developer. In WED the user would have just to create an entity for camera (and attach the action to it), a path, and a target. All the names would have to be "camera_#", "caminho_#", and "camalvo_#" respectively, where # is the number of the group. And for last, he should provide some information on the camera trought skills. This way could be easily added several cameras to create a beautiful cinematic sequence full of travelings or rough cuts. The skills necessary are:
Skill 1 - Time to start the # camera movement;
Skill 2 - Time to end it;
Skill 5 - How many ticks it must take to fly from one to the next point of the path;
Skill 8 - The # of the group.
I got the cam entity follow the right path, I got my camera following the cam entity, I got the camera looking where my cam entity is looking to, but I didn't get my cam entity to look to the target entity. I can make it look to a given point in 3d space with wdl, but couldn't make it look to an entity which name is given by a string. This is vital since, proving myself I can do this, I plan to improve the action giving mobile targets, maybe smooth movement trought paths (algebra here I come!), and make the sequence start on a trigger event, not only based on time since start of the level. And at the end, optimize everything.
Following is the part of the code I have something wrong.
///////////////////////////////////////////
...
SYNONYM entidade {type entity;}
STRING camalvo_num = " ";
STRING cine_numstr = " ";
ACTION cinematica
{
...
DEFINE cine_num = MY.skill8;
to_string cine_numstr, cine_num;
str_cpy(camalvo_num,"camalvo_");
str_cat(camalvo_num,cine_numstr);
entidade = syn_for_name(camalvo_num);
...
temp.x = entidade.x - my.x;
temp.y = entidade.y - my.y;
temp.z = entidade.z - my.z;
vec_to_angle(my.pan,temp);
...
}
///////////////////////////////////////////
All works perfectly, I get all my script working if I substitute entidade.x for a vector as I said, or for player.x. I think it would be as the my synonym, but it isn't. The problem is I don't know how to get entidade's position vector. Couldn't find on the manual. I'm pretty sure the problem is here. Thanks, and sorry for the bad english.
------------------
Maybe after this problem is solved, something may be usable by WildCat.