Trouble understanding workshops

Posted By: Marc_Gagne

Trouble understanding workshops - 04/13/09 22:23

I just don't understand how so few code can give the player the power to move an object. It starts with the 8th Workshop. Until then, I understood everything, but from then on, I was lost. Can anybody explain to me the code used to move the car(s)?
Yours truly,
Marc
Posted By: Marc_Gagne

Re: Trouble understanding workshops - 04/14/09 15:01

Can anybody help me?
Posted By: Mr_Bullet

Re: Trouble understanding workshops - 04/14/09 15:58

when you read the lite-c tutorial you will find the code!

Peace
Posted By: Marc_Gagne

Re: Trouble understanding workshops - 04/14/09 16:21

Well that's my problem. When I read the code, I don't see how the player is assigned to the car (isn't there supposed to be a pointer or something?).
Posted By: Mr_Bullet

Re: Trouble understanding workshops - 04/14/09 16:41

I understand...

///////////////////////////////
#include <acknex.h>
#include <default.c>

///////////////////////////////

function main()
{
level_load ("work18.wmb");
}

action move_me()
{
while (!key_s) wait (1); // wait until the player presses the [S] key
while (1)
{
my.x += 15 * time_step; // move the entity along the x axis
my.z += 3 * time_step;
wait (1);
}

I would also like to know how the player is assigned to the car laugh

Peace
Posted By: Marc_Gagne

Re: Trouble understanding workshops - 04/14/09 16:42

My first thought was that there was another, hidden script attached, but I think that that's impossible. Does anybody else know how this script works?
Posted By: Marc_Gagne

Re: Trouble understanding workshops - 04/14/09 17:12

Anybody know the answer?
Posted By: ptrc1c

Re: Trouble understanding workshops - 04/14/09 17:33

I think you mean the 18th workshop. The code contained within the action has been applied to the model in WED, the level editor. Anything that has an action applied to it will be the me or my in the action. If you right click on a model in WED you get the properties menu and here you will find a list of all the actions contained within the script associated with the level.
Posted By: Marc_Gagne

Re: Trouble understanding workshops - 04/14/09 17:54

Ohhhh... Now I get it... Thank you!
© 2024 lite-C Forums