Why this simple script does not compile?

GPC2 script programming for Titan Two. Code examples, questions, requests.

Why this simple script does not compile?

Postby thedude » Wed Apr 10, 2019 8:14 pm

Help here, please?

Seems I did not udnerstand the language yet.

Why is this wrong?

fix32 R = pow(abs(get_val(axis)),abs(get_val(axis)));
if( R < 0 ) R = -R;

GPC error: PIPs_v3.gpc(108): Illegal operation '<'.
GPC: GPC Compile ABORTED with 0 warning(s) and 1 error(s).
User avatar
thedude
Staff Sergeant
Staff Sergeant
 
Posts: 12
Joined: Wed Apr 10, 2019 8:09 pm

Re: Why this simple script does not compile?

Postby thedude » Wed Apr 10, 2019 10:40 pm

Ok, found.

Either of these will compile:
if( R < (fix32)0 ) R = -R;
if( R < 00.00 ) R = -R;
User avatar
thedude
Staff Sergeant
Staff Sergeant
 
Posts: 12
Joined: Wed Apr 10, 2019 8:09 pm

Re: Why this simple script does not compile?

Postby J2Kbr » Tue Apr 16, 2019 9:46 am

thedude wrote:Ok, found.

Either of these will compile:
if( R < (fix32)0 ) R = -R;
if( R < 00.00 ) R = -R;

:smile0517:
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm


Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 179 guests

cron