Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Ayumi), 1,405 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
C-Scrip To C-Lite... Meet many mistake ! Help !!?? #280743
07/24/09 02:02
07/24/09 02:02
Joined: Apr 2009
Posts: 39
T
TrQuocAn Offline OP
Newbie
TrQuocAn  Offline OP
Newbie
T

Joined: Apr 2009
Posts: 39
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 ??

Last edited by TrQuocAn; 07/24/09 02:42.
Re: C-Scrip To C-Lite... Meet many mistake ! Help !!?? [Re: TrQuocAn] #280758
07/24/09 04:53
07/24/09 04:53
Joined: Aug 2003
Posts: 7,439
Red Dwarf
Michael_Schwarz Offline
Senior Expert
Michael_Schwarz  Offline
Senior Expert

Joined: Aug 2003
Posts: 7,439
Red Dwarf
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

Last edited by Michael_Schwarz; 07/24/09 04:53.

"Sometimes JCL reminds me of Notch, but more competent" ~ Kiyaku
Re: C-Scrip To C-Lite... Meet many mistake ! Help !!?? [Re: Michael_Schwarz] #280833
07/24/09 11:41
07/24/09 11:41
Joined: Apr 2009
Posts: 39
T
TrQuocAn Offline OP
Newbie
TrQuocAn  Offline OP
Newbie
T

Joined: Apr 2009
Posts: 39
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 ???

Re: C-Scrip To C-Lite... Meet many mistake ! Help !!?? [Re: TrQuocAn] #281031
07/25/09 05:33
07/25/09 05:33
Joined: Apr 2009
Posts: 39
T
TrQuocAn Offline OP
Newbie
TrQuocAn  Offline OP
Newbie
T

Joined: Apr 2009
Posts: 39
anyone ???

Re: C-Scrip To C-Lite... Meet many mistake ! Help !!?? [Re: TrQuocAn] #281065
07/25/09 09:26
07/25/09 09:26
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
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.

Re: C-Scrip To C-Lite... Meet many mistake ! Help !!?? [Re: Pappenheimer] #281085
07/25/09 12:57
07/25/09 12:57
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
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

Re: C-Scrip To C-Lite... Meet many mistake ! Help !!?? [Re: MrGuest] #281226
07/26/09 08:50
07/26/09 08:50
Joined: Apr 2009
Posts: 39
T
TrQuocAn Offline OP
Newbie
TrQuocAn  Offline OP
Newbie
T

Joined: Apr 2009
Posts: 39
@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 !


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