Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (7th_zorro, TipmyPip, RealSerious3D), 892 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Ledge Hanging #313942
03/04/10 16:28
03/04/10 16:28
Joined: Oct 2009
Posts: 60
T
Tman Offline OP
Junior Member
Tman  Offline OP
Junior Member
T

Joined: Oct 2009
Posts: 60
Hey guys,

Got another question for you, I see alot of topics with ledge hang is there a script somewhere that I could download and take a look at how it goes or does someone have any code to share that is understandable?

Re: Ledge Hanging [Re: Tman] #313943
03/04/10 16:31
03/04/10 16:31
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
I dont have a script for that, but I do have a theory on this.

You take a point in front of the player, and do a constant trace down that, you check if it's a big enough gap downwards (by checking the distance the hit result returns), and you set the player to the ledge.
You can set the ledge by something like a path along it, and move it over/along that.

hope it gives you a good idea.

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: Ledge Hanging [Re: Helghast] #313961
03/04/10 18:32
03/04/10 18:32
Joined: Oct 2009
Posts: 60
T
Tman Offline OP
Junior Member
Tman  Offline OP
Junior Member
T

Joined: Oct 2009
Posts: 60
Thanks for the quick reply, could you give me like a code snippet of the constant trace down and checking for the gap? If I am not mistaken what you are saying is to do a c trace and do it on the x axis? If that make sense to you?

Re: Ledge Hanging [Re: Tman] #314075
03/05/10 15:40
03/05/10 15:40
Joined: Oct 2009
Posts: 60
T
Tman Offline OP
Junior Member
Tman  Offline OP
Junior Member
T

Joined: Oct 2009
Posts: 60
Having a little trouble with this one, because I would like my player to detect all edges or ledges and grab them I have the animation just trying to wrap my head around grabbing the ledges and just detecting anyone has an idea?

Re: Ledge Hanging [Re: Tman] #314436
03/08/10 16:44
03/08/10 16:44
Joined: Oct 2009
Posts: 60
T
Tman Offline OP
Junior Member
Tman  Offline OP
Junior Member
T

Joined: Oct 2009
Posts: 60
Still needing some help in understanding.
I have another theory based on what Helghast said and I need some help on trying to get this done.I want to do a c_trace to a the top vertices on the wall or ledge and have the player grab those points now if that sounds about right could someone give a code example on how to accomplish this?

Thanks
Tman.

Re: Ledge Hanging [Re: Tman] #314441
03/08/10 17:23
03/08/10 17:23
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)


Code:
(1)
___
   |
   |  <-  player comes close to the wall, a c_trace from his origin detects the wall => (2)
   |
   |

(2)
 c_trace from for examples 64 quants above and in front of the player
  |
 \/
___
   |
   |<-player
   |
   |



If (2) c_trace is successful, the ledge is at target.z and x/y is your player's position or the previous target from c_trace in (1).


"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: Ledge Hanging [Re: Superku] #314849
03/11/10 15:18
03/11/10 15:18
Joined: Oct 2009
Posts: 60
T
Tman Offline OP
Junior Member
Tman  Offline OP
Junior Member
T

Joined: Oct 2009
Posts: 60
How do you make the player detect one particular wall. I have the player detecting the walls in front of it and I labled the wall as flag2 in the code but it detects everything, even those without a flag set to it, so how could I set it to detect just the wall that I want it to detect?
Code:
action shimmy_move()
{
	set(my,FLAG2);
	my.CREATOR = me;	
}

function move_ledge()
{
	VECTOR wall_ahead[3];
	while(1)
	{
	  c_scan(my.x,my.pan,vector(360,0,750),SCAN_ENTS | SCAN_FLAG2 | IGNORE_ME);
	  
     vec_set (wall_ahead.x, vector (70, 0, -20)); // play with 70 and -20
     vec_rotate (wall_ahead.x, my.pan);
     vec_add (wall_ahead.x, my.x);
     if (c_trace(my.x,wall_ahead.x,IGNORE_PASSABLE | SCAN_FLAG2 | SCAN_ENTS |USE_POLYGON) > 0)
     draw_point3d(hit.x,vector(50,50,255),100,3);
     if(HIT_TARGET)
     {
     	draw_text("Wall Hit...",10,10,vector(50,50,255));
     }
     
     wait(1);
     
   }
}



Here is the code that I am using to detect the walls in front of me.

Re: Ledge Hanging [Re: Tman] #314850
03/11/10 15:22
03/11/10 15:22
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Why do you use c_scan?
I don't know of "SCAN_FLAG2", I'm not sure if it even exists.

if (c_trace(my.x,wall_ahead.x,IGNORE_PASSABLE | SCAN_TEXTURE |USE_POLYGON) > 0)
draw_point3d(hit.x,vector(50,50,255),100,3);
if(HIT_TARGET && tex_flag2)
{
draw_text("Wall Hit...",10,10,vector(50,50,255));
}


"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: Ledge Hanging [Re: Superku] #314852
03/11/10 15:37
03/11/10 15:37
Joined: Oct 2009
Posts: 60
T
Tman Offline OP
Junior Member
Tman  Offline OP
Junior Member
T

Joined: Oct 2009
Posts: 60
I was scanning for the particular flag, I got that idea from the lite-c tuts.

Re: Ledge Hanging [Re: Tman] #314858
03/11/10 16:29
03/11/10 16:29
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Have you tried my code?


"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
Page 1 of 2 1 2

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