Gamestudio Links
Zorro Links
Newest Posts
Lapsa's very own thread
by Lapsa. 06/26/24 12:45
Executing Trades on Next Bar Open
by Zheka. 06/20/24 14:26
A simple game ...
by VoroneTZ. 06/18/24 10:50
Face player all the time ...
by bbn1982. 06/18/24 10:25
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 813 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mino, squik, AemStones, LucasJoshua, Baklazhan
19061 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Polygon Collision [Re: Fenriswolf] #130511
05/20/07 21:51
05/20/07 21:51
Joined: May 2006
Posts: 69
Canada
L
Leaf Offline OP
Junior Member
Leaf  Offline OP
Junior Member
L

Joined: May 2006
Posts: 69
Canada
I've removed the 'use_aabb' flag but it still doesn't colide correctly. I honestly don't know whats going on, it should work

Re: Polygon Collision [Re: Leaf] #130512
05/20/07 23:11
05/20/07 23:11
Joined: Mar 2003
Posts: 4,264
Wellington
Nems Offline

.
Nems  Offline

.

Joined: Mar 2003
Posts: 4,264
Wellington
ok, this is confusing.

All advice should have scored you a hit but nadda is happening so....

We need to see your main and a complete explanation as to what it is your are wanting to effect.

Some questions for you to answer;

Do you have a player script?
Do you have an enemy script?
Do you have an enclosed level?
Do you have level blocks?
Do you have entity blocks?
Do you have level model terrain?
Do you have level terrain map?

Sure, we can see all that in your screenies but please answer any way.

Cheers...

Re: Polygon Collision [Re: Nems] #130513
05/20/07 23:27
05/20/07 23:27
Joined: May 2006
Posts: 69
Canada
L
Leaf Offline OP
Junior Member
Leaf  Offline OP
Junior Member
L

Joined: May 2006
Posts: 69
Canada
Do you have a player script? Yes. then KHmovement in AU Tutorials
Do you have an enemy script? Yes, it's an enemy dummy script
Do you have an enclosed level? Yes, a sky sphere
Do you have level blocks? Yes, A simple room
Do you have entity blocks? No, there are no prefabbed wmb's in the level
Do you have level model terrain? No
Do you have level terrain map? No

Goal: I am looking to have my player able to run up the stairs of a static MDL file, IE Polygon collsion with that stairs MDL.



///////////MAIN.WDL////////////
include <player.wdl>;
include <enemy.wdl>;
include <animation.wdl>;
include <beam.wdl>;

include <lflare.wdl>;




FUNCTION main(){
sky_color.red = 1;
sky_color.green = 1;
sky_color.blue = 1;
camera.clip_far = 2000;
camera.fog_start = 0.8 * 2000; // fog at 80% of clip_range
camera.fog_end = 0.9 * 2000; // fog till 90% of clip_range
fog_color.red = 1;
fog_color.green = 1;
fog_color.blue = 1;
video_switch(7,0,1);
level_load("level.wmb");

_move_straight(); // predefined camera movement

sky_clip = -65;

lensflare_create(); // init the lens flare
lensflare_start(); // start lens flare

wait(2);
// start with lens flare in frame
camera.pan = 25;
camera.tilt = 15;





}


ON_2 = lensflare_start;
ON_3 = lensflare_stop;




bmap bmap_background = <xhair.pcx>;
panel panel_editor{
pos_x = 380;
pos_y = 280;
layer = 1;
bmap = bmap_background;
flags = visible, overlay, translucent, filter;
}

Last edited by Leaf; 05/20/07 23:32.
Re: Polygon Collision [Re: Leaf] #130514
05/22/07 22:11
05/22/07 22:11
Joined: Mar 2003
Posts: 4,264
Wellington
Nems Offline

.
Nems  Offline

.

Joined: Mar 2003
Posts: 4,264
Wellington
Hi Leaf,

Sorry about delay, been busy with my own stuff.

I compiled a small level to test this out but its been a while since I applied ground based players so everything might not work as indicated.

What the level has is a 'Model' terrain, a player model and a skybox.

As expected, everything works as it should do.

Here is the script and if you want the level, i will put it up to download.
The file is 3mgbs but may not be able to pass thru gmail due to the file holding an .exe.

This may not help you out with your current project but based on your posts, it should.

Its not very well commented but post if you want a comprehensive 'comments'.
Be prepared for a long wait from me, hopefully other users more experienced will be able to help out.

Code:
 //Set path to files

path ".\\wdls";
path ".\\models";
path ".\\sounds";
path ".\\images";
path ".\\maps";

string level_str = <leaf.WMB>;

var video_screen = 1;
var enable_polycollision = 1;
var video_mode = 8; //1024*764 Bild
var video_depth = 32; // 32 bit colour D3D mode
var max_entities = 5000;
var tex_share = 1;
var disable_z_glide =1;
var camera_distance = 30;
var camera_height = 8;
var VecTo;
var VecFrom;
var player_distance; // moves the player
var jumping = 0;

define attack skill42;
define strength skill43;
define health = skill18; // just another name for skill18

function player_event();
function player_jumps();


font arial = "arial", 0, 20;

panel debug_pl
{
pos_x = 10; pos_y = 10;
layer = 10;
digits = 5, 5, 3, arial, 16, time_fac;
flags = visible, refresh;
}

sky cube
{
type=<canyons+6.tga>;
layer=2; /// default
//z= 20; //// shifts height, experiment with this value
material=mat_sky; //makes sky brighter
flags=cube,visible;
}

function set_camera()
{

while(1)
{

camera.x = player.x - camera_distance * cos(player.pan);
camera.y = player.y - camera_distance * sin(player.pan);
camera.z = player.z + camera_height;

camera.pan = player.pan;
camera.tilt += 2 * mouse_force.y * time;
wait(1);
}
}


FUNCTION main()
{


level_load(level_str );

wait(4);

sky_clip = -65;


wait(2);

set_camera();




}





action player_me // attached to the player
{

my.fat = on;
my.narrow = on;
c_setminmax(my);

player = me; // I'm the player
player.attack = 30;
player.strength = 200;
my.enable_impact = on;
player.health = 200; // and I have 100 health points
my.event = player_event;

while (my.health > 0)
{
camera.tilt += 10 * mouse_force.y * time;
camera.pan -= 10 * mouse_force.x * time;
my.pan = camera.pan;
my.tilt = camera.tilt;

vec_set (temp, my.x);
temp.z -= 100000;
c_trace(VecFrom.x,VecTo.x,ignore_me+ignore_passable+use_box+activate_sonar);
// trace_mode = ignore_me + ignore_passable + use_box+activate_sonar;
my.skill30 = trace (my.x, temp);
if(result <= 0 )
{
//place player on ground
vec_set(VecFrom,my.x);
vec_set(VecTo,my.x);
VecTo.z -= 80* time; // place player on floor
my.z -= c_trace(VecFrom.x,VecTo.x,ignore_me+ignore_sprites+ignore_passable+ignore_passents+use_box);
my.z += 0.2;
}

player_distance.x = 8 * (key_w - key_s) * time; // moves forward / backward with W / S
player_distance.y = 8 * (key_a - key_d) * time;
player_distance.z = 8 * (key_space - key_c) * time;

c_move(my,player_distance,nullvector,ignore_passable + glide);


if (key_shift ==1 && key_w==1 )
{
player_distance.x = 15 * time;
}
if (jumping == 0)
{
vec_set (temp, my.x);
temp.z -= 10000;
c_trace(VecFrom.x,VecTo.x,ignore_me+ignore_passable+use_box+activate_sonar);
my.skill30 = trace (my.x, temp);

if (my.skill30 < 50) // fall on the ground when closer than 50 quants to the surface
{
player_distance.z = -my.skill30;
}
else // way up in the air?
{
player_distance.z -= 15 * time; // then decrease player's z slowly

}
// player_distance.z = -trace (my.x, temp);
my.skill30 = -trace (my.x, temp);


if ((key_w == 1) || (key_s == 1)) // the player is walking
{
ent_cycle("walk", my.skill20); // play walk frames animation
my.skill20 += 8 * time; // "walk" animation speed
if (my.skill20 > 100) {my.skill20 = 0;} // loop animation
}
else // standing
{
ent_cycle("stand", my.skill21); // play stand frames animation
my.skill21 += 2 * time; // "stand" animation speed
if (my.skill21 > 100) {my.skill21 = 0;} // loop animation
}

if (key_a== 1) // strafe
{
ent_cycle("walk", my.skill20);
my.skill20 += 8 * time; // "walk" animation speed
if (my.skill20 > 100) {my.skill20 = 0;} // loop animation
}
if (key_d== 1) // strafe
{
ent_cycle("walk", my.skill20);
my.skill20 += 8 * time; // "walk" animation speed
if (my.skill20 > 100) {my.skill20 = 0;} // loop animation
}

}
if ((key_space == 1) && (jumping == 0)) // space to jump
{
player_jumps();
}
c_move(my,player_distance,nullvector,ignore_passable + glide);
// move_mode = ignore_passable + ignore_passents + ignore_models + ignore_sprites + glide;

wait (1);

}


}









////////////////////////////////////////////////////////////////////////
function player_jumps()
{
proc_kill(4);
my.skill20 = 0;
jumping = 1;
while (my.skill20 < 95)
{
ent_cycle("jump", my.skill20);
my.skill20 += 3 * time; // "jump" animation speed
// player_distance.x += 2 * time;
if (my.skill20 < 30)
{
player_distance.z += 0.1 * time;
}
else
{
player_distance.z -= 0.1 * time;
}
wait (1);
}
jumping = 0;
}

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

function player_event()
{

if (my.health > 0)
{
my.health -= 0.5;
// snd_play (playerhit_snd, 40, 0);

}
}

Action Poly
{
my.polygon = on;
}



Cheers...
and have fun doing this...

Re: Polygon Collision [Re: Nems] #130515
05/24/07 02:30
05/24/07 02:30
Joined: May 2006
Posts: 69
Canada
L
Leaf Offline OP
Junior Member
Leaf  Offline OP
Junior Member
L

Joined: May 2006
Posts: 69
Canada
Ok ive got it working thanks NEMs

Re: Polygon Collision [Re: Leaf] #130516
05/24/07 04:20
05/24/07 04:20
Joined: Mar 2003
Posts: 4,264
Wellington
Nems Offline

.
Nems  Offline

.

Joined: Mar 2003
Posts: 4,264
Wellington
Good to hear Leaf, glad you could nut it out and implement what you needed, 5 stars for that!

Page 2 of 2 1 2

Moderated by  HeelX, Spirit 

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