C-Scrip To C-Lite... Meet many mistake ! Help !!??

Posted By: TrQuocAn

C-Scrip To C-Lite... Meet many mistake ! Help !!?? - 07/24/09 02:02

Hi everyone !
I try to convert my scrip from C-Scrip to Lite-C but I met many Mistake , and I don't knoiw why frown

1. Do We have any perfect converter (I try BK Replace Em in 3DGS Manual) but it's not so good !

2. See the picture below ! How to define a Skill... and use it?? What's the problem ???



3. if I had the code in C-Scrip:

Code:
function Set_Visible(on_off)
{
   my.VISIBLE = on_off;
}



Conver to C-Lite :

Code:
function Set_Visible(on_off)
{
   if (on_of==1) set(my,VISIBLE);
   else reset(my,VISIBLE);
}



--> it make my code longer... do we have any way else ???

4. I have the code :
Code:
ENTITY* testent = {
   type = "some file...";
   skill1 = 2;
   skill2 = 3;
}


-> I meet the syntax error... How to uses Skill In Layer Model ??
Posted By: Michael_Schwarz

Re: C-Scrip To C-Lite... Meet many mistake ! Help !!?? - 07/24/09 04:53

about #3:

toggle(..)

edit: sorry if i'm not more help, i'm just a c-script user.. don't know anything about lite-c wink
Posted By: TrQuocAn

Re: C-Scrip To C-Lite... Meet many mistake ! Help !!?? - 07/24/09 11:41

another one questtion :
C-SCrip :

Code:
var angl[3];
....
angl.pan = 90;
angl.tilt = 180;



In C-Lite ... we can't uses pan and tilt for the var[3] and VECTOR... So do we have the Angle object ???
Posted By: TrQuocAn

Re: C-Scrip To C-Lite... Meet many mistake ! Help !!?? - 07/25/09 05:33

anyone ???
Posted By: Pappenheimer

Re: C-Scrip To C-Lite... Meet many mistake ! Help !!?? - 07/25/09 09:26

Originally Posted By: TrQuocAn
another one questtion :
C-SCrip :

Code:
var angl[3];
....
angl.pan = 90;
angl.tilt = 180;



In C-Lite ... we can't uses pan and tilt for the var[3] and VECTOR... So do we have the Angle object ???


I can't believe that this worked in c-script, because you define a var and use it later as a pointer!

For using angl like angl.pan = 90; you have to define it as ENTITY* angl.
Posted By: MrGuest

Re: C-Scrip To C-Lite... Meet many mistake ! Help !!?? - 07/25/09 12:57

you can use
Code:
VECTOR vec_name; //then use vec_name.x, vec_name.y and vec_name.z
otherwise use ANGLE ang_name; //then use ang_name.pan, ang_name.tilt and ang_name.roll



for skills you'll see in compat.h
Code:
#define skill1 skill[0]



so for definig your own skills either decide if you're using the array skill[0] or skill1 just for simplicity (even though they're both the same things
Code:
#define HEALTH skill1; //same as #define HEALTH skill[0]

//then later in your project maybe an action?
action act_bobo(){
   my.HEALTH = 100;
   //same as my.skill1 = 100;
   //same as my.skill[0] = 100;



for flags my.VISIBLE
Code:
now you need
set(my, VISIBLE); //which is defined in acknex.h, to set panels visible

//though ENTITIES use reset(my, INVISIBLE);



you can also use toggle as Michael says, which will automatically toggle a flag
Code:
toggle(my, VISIBLE);



and to then check if something is visible use
Code:
if(is(my, VISIBLE)){ //work you magic



in layer models, you'll need to place the .x ahead of the camera
Code:
ENTITY* shotgun_onscreen =
{
  type = "shotgun.mdl";
  layer = 2; // display above view entities with layer 1
  flags2 = SHOW; // lite-C only: visible on screen from the start  x = 100; // place 100 quants ahead of the view
  y = -50; // 50 to the right
  z = 0; // and center vertically
}



hope this helps
Posted By: TrQuocAn

Re: C-Scrip To C-Lite... Meet many mistake ! Help !!?? - 07/26/09 08:50

@MrGuest : Thanks alot for your help !
I solved this problem ! thanks again !

And want think I see that ... we can't set the Skill in the "ENTITY* ent = {...}"

it's impossible !
© 2024 lite-C Forums