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
0 registered members (), 18,767 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
Problems with the "ladder-script"f rom AUM100 #374479
06/19/11 08:19
06/19/11 08:19
Joined: Feb 2010
Posts: 40
Germany
G
Grandma Offline OP
Newbie
Grandma  Offline OP
Newbie
G

Joined: Feb 2010
Posts: 40
Germany
Hello,

the ladder-script from AUM 100 works fine with Gamestudio A7-C. With Gamestudio A8-C the Player always become stuck on the bottom of the ladder.
Did something changed importend for the code?

Here is the ladder-skript:
Code:
function enviroment()
{
	vec_set(d3d_lodfactor,vector(50,60,70)); 
	sun_light = 100;
	camera.clip_near = 0;
	camera.clip_far = 3000;
	camera.fog_start = 0; 
	camera.fog_end = 3000; 
	fog_color = 4;
	d3d_fogcolor4.red = 175; 
	d3d_fogcolor4.green = 175; 
	d3d_fogcolor4.blue = 175; 
	sky_color.red = d3d_fogcolor4.red; 
	sky_color.green = d3d_fogcolor4.green; 
	sky_color.blue = d3d_fogcolor4.blue; 
}

function main()
{
	freeze_mode = 1;
	sky_clip = 50;
	collision_mode =2; 
	video_set(800,600,32,0);
	fps_max = 60;
	fps_lock = 1;
	level_load("1.WMB");
	wait(3);
	enviroment();
	freeze_mode = 0;
}



and the player code:
Code:
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

ENTITY* ladder;

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

FONT* digfont = "digfont.pcx";

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

VECTOR dist;
VECTOR absdist;
VECTOR force;
VECTOR camera_center;

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

var my_height;
var step_height = 4;
var mouse_spd = 10;
var cam_height = 30;
var climb = 0; // if it is 1 then player is climbing
var pandeladder;

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

function camera_()
{
	vec_lerp(camera.x,camera.x,camera_center.x,0.3);
	vec_lerp(camera_center,camera_center,vector(0,0,cam_height),1);
	vec_rotate(camera_center,my.pan);
	vec_add(camera_center,my.x);
	camera.arc = 90;
	camera.pan -= mouse_spd * mouse_force.x * time_step;
	camera.tilt += mouse_spd * mouse_force.y * time_step;
	if(camera.tilt > 70){camera.tilt = 70;}
	if(camera.tilt < -70){camera.tilt =-70;}
}

function input()
{
	if(climb == 1)
	{
	   if(camera.tilt > - 40)
	   {
		   absdist.z = 15 * (key_w - key_s) * time_step;
	   } 
	   if(camera.tilt < - 40)
	   {
		   absdist.z = 15 * (key_s - key_w) * time_step;
	   }
	   dist.x = 0;
		dist.y = 15 * (key_a - key_d) * time_step;
	}
	if(my_height <= 10)
	{
		force.x = 15 * (key_w - key_s) * time_step;
		accelerate(dist.x,force.x,0.7);
		force.y = 15 * (key_a - key_d) * time_step;
		accelerate(dist.y,force.y,0.7);
	}
	move_friction = 0.2;
	move_min_z = -1;

}

action player_()
{
	player = my;
	set(my,INVISIBLE|POLYGON);
	my.scale_x = 1;
	my.scale_y = my.scale_x;
	my.scale_z = my.scale_x;
	while(1)
	{
		if(climb == 0 && my_height <= 10)
		{
			my.pan = camera.pan;
		}
		my_height = c_trace(my.x,vector(my.x,my.y,my.z-9999),IGNORE_MODELS|IGNORE_PASSABLE|IGNORE_ME|USE_BOX);
		if(my_height > 10)
		{
			accelerate(absdist.z,-10 * time_step,-1);
		}    
		else
		{
			absdist.z = -(my_height/1.2)+ step_height;
			absdist.z = clamp(absdist.z,-step_height,step_height);
			if((my_height + absdist.z) > 10){ absdist.z = -my_height -10; }
		} 
		input();
		c_move(my,dist,absdist, IGNORE_PASSABLE|GLIDE);		
		camera_();
		wait(1);
	} 
}
function ladder_event()
{
	if(event_type == EVENT_IMPACT)
	{
		ladder = my;
		pandeladder = ladder.pan;
		if(you == player)
		{
			my.emask &= ~(ENABLE_IMPACT);	
			while(1)
			{
				camera.pan=clamp(camera.pan,player.pan-30,player.pan+30);
				player.pan += clamp(ang(ladder.pan-player.pan)*0.5,-25,25)*time_step;	
				if(pandeladder == 0)
				{
					player.x = ladder.x - 30;
				}	
				if(pandeladder == 90)
				{
					player.y = ladder.y - 30;
				}
				if(pandeladder == 180)
				{
					player.x = ladder.x + 30;
				}	
				if(pandeladder == 270)
				{
					player.y = ladder.y + 30;
				}	
				proc_mode = PROC_LATE;
				climb = 1;
				if(player.z + player.min_z - 40 > my.max_z + my.z || player.z + player.min_z + 20 < my.min_z + my.z)	
				{
					force.x = 65  * time_step;
					accelerate(dist.x,force.x,1.1);
					break;
				}
				if(key_space || vec_dist(vector(my.x,my.y,0),vector(player.x,player.y,0)) > 35)
				{
					force.x = - 25  * time_step;
					accelerate(dist.x,force.x,1.1);
					break;
				}
				wait(1);
			}
			climb = 0;
			wait(-0.1);	
			my.emask |= (ENABLE_IMPACT);	
		}
	}
}

action ladder_act()
{
	my.eflags |= FAT | NARROW;
	set(my,POLYGON);
	wait(1);
	c_updatehull(my,0);
	my.emask |= ENABLE_IMPACT; 
	my.event = ladder_event;
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//PANELS//////////////////////////////////////////////////////////////////////////////////////////////////////

PANEL* gui_ =
{
	layer = 4;
	//digits(10,0,4,digfont,1,player.skill1); // use to be health here
	flags = SHOW;
}



Jürgen

Re: Problems with the "ladder-script"f rom AUM100 [Re: Grandma] #374482
06/19/11 10:00
06/19/11 10:00
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
no, the problem is a huge problem with the bounding boxes is A8!
press f1 twice to see the bounding boxes and you will know what's the problem


Visit my site: www.masterq32.de
Re: Problems with the "ladder-script"f rom AUM100 [Re: MasterQ32] #374483
06/19/11 10:21
06/19/11 10:21
Joined: Feb 2010
Posts: 40
Germany
G
Grandma Offline OP
Newbie
Grandma  Offline OP
Newbie
G

Joined: Feb 2010
Posts: 40
Germany
Problem is solved! Thx a lot!
I just changed the size of the boundingbox...


Moderated by  George 

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