Gamestudio Links
Zorro Links
Newest Posts
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,549 guests, and 14 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19058 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Convert from Lite-C to C #242380
12/22/08 20:13
12/22/08 20:13
Joined: Sep 2007
Posts: 268
United States
Doof_Guy Offline OP
Member
Doof_Guy  Offline OP
Member

Joined: Sep 2007
Posts: 268
United States
Hi, would someone be able to convert this to C for me? The script is By Blade

#include <acknex.h>
#include <default.c>

var counter = 0;

function change_colour()
{
my.ambient = 500;
my.lightrange = 150;

while(1)
{
if(counter == 4)
{
counter = 0;
}

if(counter == 0)
{
my.green = 32;
my.blue = 240;
my.red = 160;
}
else if(counter == 1)
{
my.green = 255;
my.blue = 0;
my.red = 0;
}
else if(counter == 2)
{
my.green = 255;
my.blue = 0;
my.red = 255;
}
else if(counter == 3)
{
my.green = 0;
my.blue = 0;
my.red = 255;
}

counter += 1;
wait(-1);
}
}

action flashing_lights()
{
change_colour();
}

function main()
{
level_load("test_light.wmb");
wait(1);
}


Thanks!
Doof


To see what 3d models i have made and animated, see the link to my bloghttp://championsdawn.blogspot.com
Re: Convert from Lite-C to C [Re: Doof_Guy] #242384
12/22/08 20:19
12/22/08 20:19
Joined: Dec 2005
Posts: 490
Germany/Berlin-Velten
kasimir Offline
Senior Member
kasimir  Offline
Senior Member

Joined: Dec 2005
Posts: 490
Germany/Berlin-Velten
why convert this? this should still work in C
just delete the first two lines....

Re: Convert from Lite-C to C [Re: kasimir] #242385
12/22/08 20:22
12/22/08 20:22
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
you have to define my and it's properties, it seems pretty senseless to convert this to c for me.

unless if you mean c-script laugh

for c-script delete first 2 lines and delete () from action flashing_lkights


3333333333
Re: Convert from Lite-C to C [Re: Quad] #242387
12/22/08 20:31
12/22/08 20:31
Joined: Sep 2007
Posts: 268
United States
Doof_Guy Offline OP
Member
Doof_Guy  Offline OP
Member

Joined: Sep 2007
Posts: 268
United States
o ok, thanks alot, i stink at scripting lol


To see what 3d models i have made and animated, see the link to my bloghttp://championsdawn.blogspot.com
Re: Convert from Lite-C to C [Re: Doof_Guy] #242399
12/22/08 21:31
12/22/08 21:31
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
I know you did not ask for this, but that code can be shortened.
(besides: I'm not sure if C-Script knows "else if" statements)
Here is another version, which does the same (at least it should):
Code:
var counter = 0;

var lights_red[4] = 160, 0, 255, 255;
var lights_green[4] = 32, 255, 255, 0;
var lights_blue[4] = 240, 0, 0, 0;

function change_colour()
{
	my.ambient = 500;
	my.lightrange = 150;
	
	while(1)
	{
		my.red = lights_red[counter];
		my.green = lights_green[counter];
		my.blue = lights_blue[counter];

		counter += 1;
		counter %= 4;
		wait(-1);
	}
}

action flashing_lights
{
	change_colour();
}

function main()
{
	level_load("test_light.wmb");
	wait(1);
}


Re: Convert from Lite-C to C [Re: Xarthor] #242402
12/22/08 21:52
12/22/08 21:52
Joined: Sep 2007
Posts: 268
United States
Doof_Guy Offline OP
Member
Doof_Guy  Offline OP
Member

Joined: Sep 2007
Posts: 268
United States
ok, ill try that, the other one didnt work.

Thanks
Doof


To see what 3d models i have made and animated, see the link to my bloghttp://championsdawn.blogspot.com
Re: Convert from Lite-C to C [Re: Xarthor] #242409
12/22/08 22:21
12/22/08 22:21
Joined: Oct 2008
Posts: 218
Nashua NH
heinekenbottle Offline
Member
heinekenbottle  Offline
Member

Joined: Oct 2008
Posts: 218
Nashua NH
Quote:

(besides: I'm not sure if C-Script knows "else if" statements)


Just FYI, it did.


I was once Anonymous_Alcoholic.

Code Breakpoint;

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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