Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
5 registered members (Dico, AndrewAMD, TipmyPip, NewbieZorro, Grant), 15,253 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Can someone "translate" this to Lite-C? #269324
06/02/09 17:33
06/02/09 17:33
Joined: Mar 2006
Posts: 321
Norway
Eagelina Offline OP
Senior Member
Eagelina  Offline OP
Senior Member

Joined: Mar 2006
Posts: 321
Norway
I hope someone of you can "translate" this code to lite-c.

I found it in Aum 34

Code:
action warlock
{
	player = me; 
	while (1) 
	{ 
		my.skill1 = 5 * time; 
		my.skill2 = 0; 
		vec_set (temp, my.x); 
		temp.z -= 3000; 
		trace_mode = ignore_you + ignore_passable + use_box; 
		
		my.skill3 = -trace (my.x, temp); 
		if (destination != null)
		{
			vec_set (temp.x, destination.x); 
			vec_sub (temp.x, my.x);
			vec_to_angle (my.pan, temp); // turn towards the destination
			my.tilt = 0; // don't bow :)
			if (vec_dist (my.x, destination.x) > 40)
			{
				move_mode = ignore_passable; 
				ent_move (my.skill1, nullvector); // moves using skill1..3
				ent_cycle("walk", my.skill46); 
				my.skill46 += 10 * time; // "walk" animation speed 
				my.skill46 %= 100; // loop animation 
			}
			else
			{
				destination.invisible = on;
				ent_cycle("idle", my.skill46); // play "stand" frames animation 
				my.skill46 += 2 * time; // "stand" animation speed 
				my.skill46 %= 100; // loop animation 
			}
		}
		wait (1); 
	}
}


Thanks for the help grin


A6 and A7 Commercial
-------------------
Programmer always searching for more to learn and understand. smile
Re: Can someone "translate" this to Lite-C? [Re: Eagelina] #269332
06/02/09 17:59
06/02/09 17:59
Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Cowabanga Offline
Expert
Cowabanga  Offline
Expert

Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Untested:
Code:
action warlock()
{
	player = me; 
	while (1) 
	{ 
		my.skill1 = 5 * time_step; 
		my.skill2 = 0; 
		vec_set (temp, my.x); 
		temp.z -= 3000; 
		my.skill3 = c_trace (my.x, temp, IGNORE_YOU + IGNORE_PASSABLE + USE_BOX); 
		if (destination != null)
		{
			vec_set (temp.x, destination.x); 
			vec_sub (temp.x, my.x);
			vec_to_angle (my.pan, temp); // turn towards the destination
			my.tilt = 0; // don't bow :)
			if (vec_dist (my.x, destination.x) > 40)
			{
				c_move(my,my.skill1,nullvector,IGNORE_PASSABLE);
				ent_animate(my,"walk",my.skill46,ANM_CYCLE);
				my.skill46 += 10 * time; // "walk" animation speed 
				my.skill46 %= 100; // loop animation 
			}
			else
			{
				set(destination,INVISIBLE);
				ent_animate(my,"idle",my.skill46,ANM_CYCLE); // play "stand" frames animation 
				my.skill46 += 2 * time_step; // "stand" animation speed 
				my.skill46 %= 100; // loop animation 
			}
		}
		wait (1); 
	}
}

And you should define a temp vector: VECTOR temp;

Re: Can someone "translate" this to Lite-C? [Re: Cowabanga] #269349
06/02/09 19:09
06/02/09 19:09
Joined: Mar 2006
Posts: 321
Norway
Eagelina Offline OP
Senior Member
Eagelina  Offline OP
Senior Member

Joined: Mar 2006
Posts: 321
Norway
Thanks ! I will test it out tomorrow. grin


A6 and A7 Commercial
-------------------
Programmer always searching for more to learn and understand. smile
Re: Can someone "translate" this to Lite-C? [Re: Eagelina] #269793
06/04/09 16:26
06/04/09 16:26
Joined: Jan 2007
Posts: 651
Germany
R
RedPhoenix Offline
User
RedPhoenix  Offline
User
R

Joined: Jan 2007
Posts: 651
Germany
Quote:
my.skill46 += 10 * time; // "walk" animation speed


It has to be time_step in that line, too.

Then you should define temp as following:

VECTOR* temp = { x = 0; y = 0; z = 0; }

And change the null keyword to NULL in this line:

Quote:
if (destination != null)


Last edited by RedPhoenix; 06/04/09 16:28.
Re: Can someone "translate" this to Lite-C? [Re: RedPhoenix] #269884
06/05/09 05:09
06/05/09 05:09
Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Cowabanga Offline
Expert
Cowabanga  Offline
Expert

Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
@RedPhoenix: Yeah, sorry. I forgot about those. smile

Re: Can someone "translate" this to Lite-C? [Re: Cowabanga] #269965
06/05/09 10:53
06/05/09 10:53
Joined: Mar 2006
Posts: 321
Norway
Eagelina Offline OP
Senior Member
Eagelina  Offline OP
Senior Member

Joined: Mar 2006
Posts: 321
Norway
Thanks for the help translating, it worked fine when I changed the time to time_step. Greate jobb.


A6 and A7 Commercial
-------------------
Programmer always searching for more to learn and understand. smile

Moderated by  adoado, checkbutton, mk_1, Perro 

Gamestudio download | 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