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,791 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
Page 2 of 4 1 2 3 4
Re: ladder detection [Re: 3run] #311928
02/22/10 11:07
02/22/10 11:07
Joined: May 2009
Posts: 5,377
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,377
Caucasus
Damn! Will some one try to help?! I even posted my script!!!!!!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: ladder detection [Re: 3run] #311956
02/22/10 14:59
02/22/10 14:59
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Ask yourself a question:
Do you want to have a finished game or do you want to create your own game?
In the latter case try and learn by yourself (asking is of course allowed but should not be the primary option).

And never say something like "Damn! Will some one try to help?! I even posted my script!!!!!!" again or I will punch your healthpoints out of you.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: ladder detection [Re: Superku] #311981
02/22/10 17:07
02/22/10 17:07
Joined: May 2009
Posts: 5,377
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,377
Caucasus
Damn! Will some one try to help?! I even posted my script!!!!!!
Now try to punch my healthpoints out of me, if you can badass! grin And I'm not asking for finished game, the ladder script is the only thing left undone in my player script laugh All I'm asking is some ideas how to creat ladder as I sad. Or batter for example of script or even small demo.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: ladder detection [Re: 3run] #311983
02/22/10 17:15
02/22/10 17:15
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Try to change the bold line

proc_late();
climb = 1;
vec_set(player.x,my.skill21); //place it at the stored position to prevent the normal movement
my.skill30 = c_move(p...

into player.z = my.skill23;



and

break;
}
vec_set(my.skill21,player.x);
wait(1);

into my.skill23 = player.z;

Add before the wait(1); comment above for example this:

if(vec_dist(vector(my.skill21,my.skill22,0),vector(player.x,player.y,0) > 64) {
climb = 0;
break;
}


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: ladder detection [Re: Superku] #311991
02/22/10 17:49
02/22/10 17:49
Joined: May 2009
Posts: 5,377
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,377
Caucasus
Thank you. Changed it like this, needs testing and so on... Bugy a little bit. If any other ideas will be very greatful.

Code:
function ladder_event()
{
	if(you)
	{
		if(you == player)
		{
			my.enable_impact = off;	//prevent the event to be triggered again and again during climbing
			vec_set(my.skill21,player.x);	//store the players position
			while(1)
			{
				proc_late();
				climb = 1;
				player.z = my.skill23;
				my.skill30 = c_move(player,ladder_movement,nullvector,ignore_passable|ignore_passents|glide);	//move the player up or down
				if(camera.tilt > - 40)
				{
					ladder_movement.z = 25 * (key_w - key_s)*time_step;
			   } 
			   if(camera.tilt < - 40)
			   {
			   	ladder_movement.z = 25 * (key_s - key_w)*time_step;
			   }
			   ladder_movement.x = 0;
			   ladder_movement.y = 25*(key_a - key_d)*time_step;
			   
			   vec_set(pos1,my.x);
			   vec_set(pos2,vector(1,0,0)); 
			   vec_rotate(pos2,my.pan); 
			   vec_add(pos2,my.x);
			   vec_set(pos3,vector(0,0,1)); 
			   vec_rotate(pos3,my.pan); 
			   vec_add(pos3,my.x);
			   vec_diff(dir1,pos1,pos2); 
			   vec_diff(dir2,pos2,pos3);
			   vec_cross(ladder_normal,dir1,dir2);  
			   vec_normalize(ladder_normal,1);
			   _result = (vec_dot(player.x,ladder_normal)-vec_dot(my.x,ladder_normal))/sqrt( vec_dot(ladder_normal,ladder_normal) );
			   
			   vec_set(trace_coords.x, vector(400, 0, 0)); 
			   vec_rotate(trace_coords.x, player.pan);
			   vec_add(trace_coords.x, player.x);
			   
			   c_trace(player.x, trace_coords.x, IGNORE_ME | GLIDE); 
			   if(trace_hit){allow_climb = 1;}else{allow_climb = 0;}
			   if(vec_dist(vector(my.skill21,my.skill22,0),vector(player.x,player.y,0)) > 64 || key_space == 1)	
				{
					climb = 0;
					break;	
				}
				my.skill23 = player.z;
				wait(1);
			}
			climb = 0;
			wait(-0.1);	
			my.enable_impact = on;	
		}
	}
}




Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: ladder detection [Re: 3run] #312210
02/23/10 18:04
02/23/10 18:04
Joined: May 2009
Posts: 5,377
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,377
Caucasus
SOME ONE! NEED HELP WITH THIS THING!!!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: ladder detection [Re: 3run] #312214
02/23/10 18:18
02/23/10 18:18
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Originally Posted By: 3run
Damn! Will some one try to help?! I even posted my script!!!!!!


Originally Posted By: 3run
SOME ONE! NEED HELP WITH THIS THING!!!



"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: ladder detection [Re: Superku] #312217
02/23/10 18:31
02/23/10 18:31
Joined: Feb 2010
Posts: 886
Random Offline
User
Random  Offline
User

Joined: Feb 2010
Posts: 886
There is an alot easyer way to do that, Newbie helps Member :D;

Wolla;
__________________________________________________________________________________
action ladder()
{
my.emask |= (ENABLE_IMPACT | ENABLE_ENTITY);
my.event = ladder_event;
set(my,POLYGON);
c_setminmax(me);
}

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);
if((key_s && my.skill30 < 0.1) || (key_w && (player.z+player.min_z) > (my.z+my.max_z+player.max_z)))
{
break;
}
vec_set(my.skill21,player.x);
wait(1);

wait(-0.1);
my.emask = ENABLE_IMPACT;
}
}
}
_______________________________________________________________



Re: ladder detection [Re: Random] #312221
02/23/10 19:14
02/23/10 19:14
Joined: May 2009
Posts: 5,377
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,377
Caucasus
Doesn't work man frown Is this from WIKI? And it makes player just walk upwards... to climb... no side walk... no even turning camera... And if make ladder this way, player woun't be able to climb down...
Here is my current script made by help of my friend:
Code:
function ladder_event()
{
	if(you)
	{
		if(you == player)
		{
			my.emask &= ~(ENABLE_IMPACT);	//prevent the event to be triggered again and again during climbing
			wait(1);
			while(1)
			{
				proc_mode = PROC_LATE;
				climb = 1;
				if(camera.tilt > - 40)
				{
					ladder_movement.z = 20*(key_w - key_s)*time_step;
				} 
				if(camera.tilt < - 40)
				{
					ladder_movement.z = 20*(key_s - key_w)*time_step;
				}
				player_movement.x = 0;
				player_movement.y = 0;
				c_move(my,ladder_movement,nullvector, IGNORE_PASSABLE | GLIDE );
			   vec_set(pos1,my.x);
			   vec_set(pos2,vector(1,0,0)); 
			   vec_rotate(pos2,my.pan); 
			   vec_add(pos2,my.x);
			   vec_set(pos3,vector(0,0,1)); 
			   vec_rotate(pos3,my.pan); 
			   vec_add(pos3,my.x);
			   vec_diff(dir1,pos1,pos2); 
			   vec_diff(dir2,pos2,pos3);
			   vec_cross(ladder_normal,dir1,dir2);  
			   vec_normalize(ladder_normal,1);
			   _result = (vec_dot(player.x,ladder_normal)-vec_dot(my.x,ladder_normal))/sqrt( vec_dot(ladder_normal,ladder_normal) );
			   
				if(player.z + player.min_z - 30 > my.max_z + my.z || player.z + player.min_z + 20 < my.min_z + my.z || _result < my.min_y || _result > my.max_y || key_space)
				{
					climb = 0;
					break;
				}
				wait(1);
			}
			
			climb = 0;
			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
		}
	}
}

action ladder_act()
{
   my.eflags |= FAT | NARROW;
   c_setminmax(my);
   my.emask |= (ENABLE_IMPACT); 
   my.event = ladder_event;
}


As you see, I can in my script, here:
Code:
vec_set(pos1,my.x);
			   vec_set(pos2,vector(1,0,0)); 
			   vec_rotate(pos2,my.pan); 
			   vec_add(pos2,my.x);
			   vec_set(pos3,vector(0,0,1)); 
			   vec_rotate(pos3,my.pan); 
			   vec_add(pos3,my.x);
			   vec_diff(dir1,pos1,pos2); 
			   vec_diff(dir2,pos2,pos3);
			   vec_cross(ladder_normal,dir1,dir2);  
			   vec_normalize(ladder_normal,1);
			   _result = (vec_dot(player.x,ladder_normal)-vec_dot(my.x,ladder_normal))/sqrt( vec_dot(ladder_normal,ladder_normal) );
			   
				if(player.z + player.min_z - 30 > my.max_z + my.z || player.z + player.min_z + 20 < my.min_z + my.z || _result < my.min_y || _result > my.max_y || key_space)
				{
					climb = 0;
					break;
				}


I calculate distanse in Y, and save it in _result, so if player walk to the side, if he will be not on ladder, there is a "break" that stopes while loop... now I whant to do the same thing, but only in X coordinates... how to do that? I do not know frown please help me.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: ladder detection [Re: 3run] #312633
02/25/10 18:42
02/25/10 18:42
Joined: Feb 2010
Posts: 886
Random Offline
User
Random  Offline
User

Joined: Feb 2010
Posts: 886
Realey?
It works with the player from intense x.



Page 2 of 4 1 2 3 4

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