|
Problems to encrypt c-script into lite-c
#282532
08/01/09 21:23
08/01/09 21:23
|
Joined: Oct 2008
Posts: 112
Ness
OP
Member
|
OP
Member
Joined: Oct 2008
Posts: 112
|
huhu, well i know c-script ,but lite-c is absolutely new for me! It gave me a big hurt,that a7 doesnt support c-script anymore... well the first thing is that even if i know some basic facts about lite-c ,i still cant do anything! There are LOTS OF COMMENTS in c-script,that doesnt exist in any kind? I dont know,the tutorial and the manual didnt say ANYTHING!
action my_player { while (1) { vec_set (camera.pos, my.pos); camera.pan = my.pan; camera.tilt += 6 * mouse_force.y * time; my.pan -= 10 * mouse_force.x * time; vec_set (temp, my.x); temp.z -= 1000; trace_mode = ignore_me + ignore_passable + use_box; temp.z = -trace (my.x, temp); temp.x = 8 * (key_w - key_s) * time; temp.y = 6 * (key_a - key_d) * time; ent_move (temp, nullvector); wait (1); } }
temp doesnt exist!
Trace mode doesnt exit!
camera/my.pos doesnt exist!
HELP!
greetings Ness
|
|
|
Re: Problems to encrypt c-script into lite-c
[Re: Ness]
#282534
08/01/09 21:44
08/01/09 21:44
|
Joined: May 2004
Posts: 1,510 Denmark
Claus_N
Serious User
|
Serious User
Joined: May 2004
Posts: 1,510
Denmark
|
That is indeed very old c-script syntax, as trace_mode and trace got replaced by c_trace, and ent_move replaced by c_move. Although your code MIGHT be working with the latest version of A6 (although I doubt that), then it is because it's backward-compatible, as it's using outdated c-script syntax Also "pos" is outdated in c-script - you can just use "my.x" to get the position vector of the "my"-entity. For some reason "temp" doesn't exist anymore in Lite-C, and it annoys me a lot as well - but "target" and "normal" can still be used, so simply just replace temp with target. You should check the manual: Contents -> Game Programming -> C-Script to Lite-C Oh, and about your code:
action my_player
{
while (1)
{
vec_set (camera.x, my.x);
camera.pan = my.pan;
camera.tilt += 6 * mouse_force.y * time_step;
my.pan -= 10 * mouse_force.x * time_step;
vec_set (target, my.x);
target.z -= 1000;
target.z = -c_trace(my.x,target,IGNORE_ME |IGNORE_PASSABLE | USE_BOX);
target.x = 8 * (key_w - key_s) * time_step;
target.y = 6 * (key_a - key_d) * time_step;
c_move (my,target, nullvector,IGNORE_PASSABLE | GLIDE);
wait (1);
}
}
Edit: Oh, and "time" got renamed to "time_step"
Last edited by Claus_N; 08/01/09 21:45. Reason: time -> time_step
|
|
|
Re: Problems to encrypt c-script into lite-c
[Re: Claus_N]
#282550
08/02/09 01:07
08/02/09 01:07
|
Joined: Oct 2008
Posts: 112
Ness
OP
Member
|
OP
Member
Joined: Oct 2008
Posts: 112
|
BIG THX Have new things: I want to generate a VIEW! But in the view,i used my.visilbe= on; but in the cheesy lite-c,i would have to use set(my,VISIBLE); which doesnt function! Do i have to use another words? And how to change this? my.tilt = max(-90, ( min(my.tilt, 90) )); Greetings Ness
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|