Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (SBGuy), 712 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Problems to encrypt c-script into lite-c #282532
08/01/09 21:23
08/01/09 21:23
Joined: Oct 2008
Posts: 112
N
Ness Offline OP
Member
Ness  Offline OP
Member
N

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 Offline
Serious User
Claus_N  Offline
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 smile 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 smile

Oh, and about your code:
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" smile

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
N
Ness Offline OP
Member
Ness  Offline OP
Member
N

Joined: Oct 2008
Posts: 112
BIG THX laugh

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

Re: Problems to encrypt c-script into lite-c [Re: Ness] #282570
08/02/09 10:08
08/02/09 10:08
Joined: May 2004
Posts: 1,510
Denmark
Claus_N Offline
Serious User
Claus_N  Offline
Serious User

Joined: May 2004
Posts: 1,510
Denmark
It's called 'SHOW' instead of visible in Lite-C smile

Quote:
And how to change this?

my.tilt = max(-90, ( min(my.tilt, 90) ));

It should be working in Lite-C as well, however you could check out "clamp" in the manual for simplifying this code smile

Re: Problems to encrypt c-script into lite-c [Re: Claus_N] #282585
08/02/09 11:22
08/02/09 11:22
Joined: Oct 2008
Posts: 112
N
Ness Offline OP
Member
Ness  Offline OP
Member
N

Joined: Oct 2008
Posts: 112
well there is STILL MAX in the sed code helper and thats really BAD,because is still c-script there,but some are with lite-c! However i get an error for this max,it says undeclared! That means it doesnt exist anymore!

Re: Problems to encrypt c-script into lite-c [Re: Ness] #282586
08/02/09 11:26
08/02/09 11:26
Joined: May 2004
Posts: 1,510
Denmark
Claus_N Offline
Serious User
Claus_N  Offline
Serious User

Joined: May 2004
Posts: 1,510
Denmark
ah sorry, I forgot that you need to use "maxv" instead of "max" and "minv" instead of "min" wink


Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1