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, alibaba), 1,184 guests, and 3 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
ladder script #264645
05/07/09 12:16
05/07/09 12:16
Joined: Jul 2003
Posts: 893
Melbourne, Australia
Matt_Coles Offline OP

User
Matt_Coles  Offline OP

User

Joined: Jul 2003
Posts: 893
Melbourne, Australia
trying to convert a ladder for lite c. I know it's in c script, not much of a programmer but I'm trying to convert slinn's one from aum. could someo programming genius help? I can't work out why the engine errors when event_impact is called frown

Code:
Quote:

#include <acknex.h> // include for Pure Mode
#include <default.c> // default key functions

function ladder_event()
{
if(you)
{
if(you == player)
{
my.ENABLE_IMPACT = off;
vec_set(my.skill21,player.x);
vec_set(my.skill24,player.pan);

while(1)
{
proc_late();
vec_set(player.x,my.skill21);
vec_set(player.pan,my.skill24);
my.skill30 = c_move(player,nullvector,vector(0,0,(key_w-key_s)*my.skill1*time_step),ignore_passable|ignore_passents|glide); //move the player up or down
if((key_s && my.skill30 < 0.1) || (key_w && (player.z+player.min_z) > (my.z+my.max_z+player.max_z))) //if the ground or the end of the ladder is reached,
{
break; //stop the loop
}

vec_set(my.skill21,player.x); //stores the new position

wait(1);
}

wait(-0.1); //prevent the player from triggering the event again and again when leaving the ladder
my.enable_impact = on; //make the ladder again sensible for the player
}
}
}

//skill1: ClimpSpeed 10
ENTITY* ladder =
{
my.enable_impact = on;
my.event = ladder_event;

my.polygon = on;

c_setminmax(me);
}

void main()
{
video_mode = 9;
video_depth = 32;
video_screen = 1;
//d3d_antialias = 4;
//d3d_automaterial = 2;
fps_max = 35;
wait(1);
}



thanks in advance - mattcoles

Re: ladder script [Re: Matt_Coles] #264655
05/07/09 12:42
05/07/09 12:42
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:

Click to reveal.. (The Code)
Code:
#include <acknex.h> // include for Pure Mode
#include <default.c> // default key functions

function ladder_event()
{
	if(you)
	{
		if(you == player)
		{
			my.emask = NULL;
			vec_set(my.skill21,player.x); 
			vec_set(my.skill24,player.pan); 
		}
		while(1)
		{
			proc_mode = PROC_LATE;
			vec_set(player.x,my.skill21);
			vec_set(player.pan,my.skill24); 
			my.skill30 = c_move(player,nullvector,vector(0,0,(key_w-key_s)*my.skill1*time_step),IGNORE_PASSABLE|IGNORE_PASSENTS|GLIDE); //move the player up or down
			if((key_s && my.skill30 < 0.1) || (key_w && (player.z+player.min_z) > (my.z+my.max_z+player.max_z))) //if the ground or the end of the ladder is reached,
			{
				break; //stop the loop
			}
			vec_set(my.skill21,player.x); //stores the new position
			wait(1);

			wait(-0.1); //prevent the player from triggering the event again and again when leaving the ladder
			my.emask = ENABLE_IMPACT; //make the ladder again sensible for the player
		}
	}
}

//skill1: ClimpSpeed 10
ENTITY* ladder = 
{
	my.emask = ENABLE_IMPACT;
	my.event = ladder_event;
	set(my,POLYGON);
	c_setminmax(me);
}

void main()
{
	video_mode = 9;
	video_depth = 32;
	video_screen = 1;
	//d3d_antialias = 4;
	//d3d_automaterial = 2;
	fps_max = 35;
	wait(1);
}


Re: ladder script [Re: Cowabanga] #264683
05/07/09 14:28
05/07/09 14:28
Joined: Jul 2003
Posts: 893
Melbourne, Australia
Matt_Coles Offline OP

User
Matt_Coles  Offline OP

User

Joined: Jul 2003
Posts: 893
Melbourne, Australia
Thanks for the try, still errors on my.emask = enable_impact frown

Re: ladder script [Re: Matt_Coles] #264692
05/07/09 15:09
05/07/09 15:09
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
ENABLE_IMPACT has to be uppercase.


3333333333
Re: ladder script [Re: Quad] #264693
05/07/09 15:21
05/07/09 15:21
Joined: Jul 2003
Posts: 893
Melbourne, Australia
Matt_Coles Offline OP

User
Matt_Coles  Offline OP

User

Joined: Jul 2003
Posts: 893
Melbourne, Australia
it is in uppercase in the code. On my iPhone responding as I don't have net at the moment where I am with the laptop hence why I didn't captialize, pain to type on lol.
Anyone got any ideas on how to get this working? It'd be greatly appreciated

Re: ladder script [Re: Matt_Coles] #264702
05/07/09 15:50
05/07/09 15:50
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Code:
ENTITY* ladder = 
{
	my.emask = ENABLE_IMPACT;
	my.event = ladder_event;
	set(my,POLYGON);
	c_setminmax(me);
}


what do you exactly want to at this part, i guess what you mean was

Code:
action ladder()
{
	my.emask = ENABLE_IMPACT;
	my.event = ladder_event;
	set(my,POLYGON);
	c_setminmax(me);
}



3333333333
Re: ladder script [Re: Quad] #264738
05/07/09 20:48
05/07/09 20:48
Joined: May 2008
Posts: 331
Lithuania, Vilnius
Jaxas Offline
Senior Member
Jaxas  Offline
Senior Member

Joined: May 2008
Posts: 331
Lithuania, Vilnius
that code looks to difficult, and useless..there's way to write a shorter, simpler code for that..(my opinion). I know, Matt_Coles ask to translate it to Lite-C, but does that really need for us? sorry if off topic..


The smaller the bug, the harder it is to kill.
_________________________________________
Forklift DEMO (3dgs)
Re: ladder script [Re: Jaxas] #264754
05/07/09 22:59
05/07/09 22:59
Joined: Jul 2003
Posts: 893
Melbourne, Australia
Matt_Coles Offline OP

User
Matt_Coles  Offline OP

User

Joined: Jul 2003
Posts: 893
Melbourne, Australia
thanks soo much for the help cowabanga and quadraxas. I will credit you in my small projects ladder code and if you need any help with any small bit of art don't hesitate to yell out and i'll give a hand

@Jaxas - i know a little c script but cause I'm no programmer I have not delved into lite-c yet at all so i greatly appreciate people with coding abilities and i do lend my artistic hand to them sometimes. That's why i need help with this sort of code

thanks again

mattcoles

Re: ladder script [Re: Matt_Coles] #264797
05/08/09 08:17
05/08/09 08:17
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...
Anytime smile


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