Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, Quad, 1 invisible), 721 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 4
Page 10 of 15 1 2 8 9 10 11 12 14 15
Re: Slightly improved Zelda code [Re: gamespider] #38107
04/27/06 07:16
04/27/06 07:16
Joined: Apr 2006
Posts: 36
India
G
gamespider Offline
Newbie
gamespider  Offline
Newbie
G

Joined: Apr 2006
Posts: 36
India
sorry for double posting..... just remembered...

The following code in the first if(movement_mode==0) branch:

IF (z_force < -2) { //are we falling?

vec_set(temp,my.x); //scan in front of player to see if he has hit a wall
temp.x += 30 * cos(my.pan);
temp.y += 30 * sin(my.pan);
temp.z = my.z + player_head_height; //scan at head height
trace_mode = ignore_me+ignore_sprites+ignore_models;
result = trace(my.x,temp);
IF(result == 0) {
ledge_grab_test = 0;
} ELSE {
IF (result > 0) && (ledge_grab_test == 0) {
vec_to_angle(temp,normal.x);
IF (abs(ang(my.pan - (temp.pan - 180))) < 30) {
temp2.pan = (temp.pan - 180); //make player face towards ladder
vec_set(temp,target.x); //scan to see if there is space up above player for it to grab onto ledge
temp.x += 10 * cos(temp2.pan);
temp.y += 10 * sin(temp2.pan);
temp.z += player_head_height - 2; //scan at head height
target.z += 10;
trace_mode = ignore_me+ignore_sprites+ignore_models;
result = trace(temp.x,target.x);
// vec_to_angle(temp,target.x);
IF (result > 0) { //if we have a wall in the way, and the surface above is less than a 10 degree slant
vec_set(temp,my.x); //scan to see if there is space up above player for it to grab onto ledge
temp.z += player_head_height - 2; //scan at head height
trace_mode = ignore_me+ignore_sprites+ignore_models;
result = trace(temp.x,target.x);
IF (result == 0) { //scan above head to make sure we didn't hit a roof
ledge_grab_test = 1;
movement_mode = 10;
my.pan = temp2.pan; //make player face towards ladder
}
}
}
}
}


can be safely replaced by the following with NO problems at all. tested it out myself.... Asu can see, the code is much shorter and easier to execute...

IF (z_force < -2) { //are we falling?

vec_set(temp, my.x);//trace straight from belly
temp.x += 30 * cos(my.pan);
temp.y += 30 * sin(my.pan);
temp.z += 30;
vec_set(temp3, my.x);
temp3.z += 30;
trace_mode = ignore_me+ignore_sprites+ignore_models;
result = trace(temp3, temp);
if(result> 0 && ledge_grab_test == 0)
{
//IF (abs(ang(my.pan - (temp.pan - 180))) < 30)
//{
vec_to_angle(temp,normal.x);
temp2.pan = (temp.pan - 180);
vec_set(temp, my.x);
temp.z += 42;
vec_set(temp3.x, my.x);
temp3.z += 42;
temp3.x += 30 * cos(my.pan);
temp3.y += 30 * sin(my.pan);
trace_mode = ignore_me+ignore_sprites+ignore_models;
result = trace(temp, temp3);
if(result ==0)
{
vec_set(temp,my.x); //scan to see if there is space up above player for it to grab onto ledge
temp.z += 50; //scan at head height
trace_mode = ignore_me+ignore_sprites+ignore_models;
result = trace(temp.x,target.x);
if(result == 0)
{
ledge_grab_test = 1;
movement_mode = 10;
//move_vec.z =0;
my.pan = temp2.pan; //make player face towards ladder
}






}
}

//IF (abs(ang(my.pan - (temp.pan - 180))) < 30)
//}
else
{
ledge_grab_test = 0;
}

}
else
{
ledge_grab_test = 0;
}

Re: Slightly improved Zelda code [Re: gamespider] #38108
04/27/06 13:18
04/27/06 13:18
Joined: Nov 2004
Posts: 862
Australia
DavidLancaster Offline OP
User
DavidLancaster  Offline OP
User

Joined: Nov 2004
Posts: 862
Australia
Gamespider! Really good cleaning up of the code. It is quite messy and buggy, it was my first attempt at a movement script like that.

The difference between:
if(movement_mode==2) and if (movement_mode==12)

I think I used one for climbing up when you were at the top of a ladder and the other was for climbing up if you had grabbed onto a ledge, as there may have been slightly different behaviour and different code for each if statement.

The (movement_mode == 3), I think I added that to stop the player getting stuck in certain circumstances or just so it can work in with whatever animation may be used. I think it was meant to move the player forward when it nears the top of pulling itself up onto a ledge.

But if you can understand this code, how it is working, and be able to clean it up like that, you are on your way to doing some great stuff. Soon you'll be making code alot better than that 8)

Re: Slightly improved Zelda code [Re: Orange Brat] #38109
04/28/06 01:33
04/28/06 01:33
Joined: Jan 2002
Posts: 94
Where ever this is, I 'm lost!
Serlink Offline
Junior Member
Serlink  Offline
Junior Member

Joined: Jan 2002
Posts: 94
Where ever this is, I 'm lost!
Quote:

Finally found some time to test this out. Nice work. Everyone's after a demo...here the script applied in my old new templates tester level:

http://www.geocities.com/hainesrs/tester2.zip




Anyone have this test level??? or any test level using this code?
If so can you post it again?
The camara code and me are not getting along, I wish I could hack Keith Blount fighting cam in to this code. I've tryed but just cannt get it to work.
Thanks
Sam


Friendship starts with two smiles, one on me and one on you.
Serjr 2006
Re: Slightly improved Zelda code [Re: Serlink] #38110
04/28/06 03:29
04/28/06 03:29
Joined: Nov 2004
Posts: 862
Australia
DavidLancaster Offline OP
User
DavidLancaster  Offline OP
User

Joined: Nov 2004
Posts: 862
Australia
It's here:

Zelda Code Implemented

But I'm not planning on renewing my subscription to that URL when the time comes next month, so that link wont be active for long, if it's still in demand afterwards perhaps I'll upload it elsewhere.

Re: Slightly improved Zelda code [Re: DavidLancaster] #38111
04/28/06 05:54
04/28/06 05:54
Joined: Aug 2000
Posts: 7,490
O
Orange Brat Offline

Senior Expert
Orange Brat  Offline

Senior Expert
O

Joined: Aug 2000
Posts: 7,490
Just to eliminate the pending wave of confusion:

http://www.accessphenomenon.com/zelda.zip

I'll see about re-uploading my original test zip once I sort some stuff out. I don't know why I deleted it...all of the other various tester levels seem to still be there.


My User Contributions master list - my initial post links are down but scroll down page to find list to active links
Re: Slightly improved Zelda code [Re: DavidLancaster] #38112
04/28/06 06:00
04/28/06 06:00
Joined: Apr 2006
Posts: 36
India
G
gamespider Offline
Newbie
gamespider  Offline
Newbie
G

Joined: Apr 2006
Posts: 36
India
It was really nothing. what i did was to trace straight from 30 quant above the player origin. If ithit a wall, the code traces straight from 42 quants above the origin. If it hits nothing, the player grabs the ledge....

therefore it grabs a ledge if there is a wall below a certain point and no wall above it....a characteristic property of a ledge...

@ axys,
I did not say that there was anything wrong with the (movement_mode == 3) branch. It is absolutely necessary tostop the player getting stuck.What i said was that the first set of trace instructions in (movement_mode == 3) branch is unnecessary

However, That still doesnt aanswer my first question.....
1. What about grabbing a ladder from the top???

Re: Slightly improved Zelda code [Re: gamespider] #38113
04/28/06 06:32
04/28/06 06:32
Joined: Dec 2003
Posts: 1,220
Just down the road from Raven
BlueBeast Offline
Serious User
Happy Birthday BlueBeast  Offline
Serious User

Joined: Dec 2003
Posts: 1,220
Just down the road from Raven
I'd like to jump in too... it was only mentioned briefly, but what about jumping? Is the jumping pretty good?

My jump will land me on the next block above me if there is one... technically, I could ascend a 10 story bulding from the inside, 1 floor at a time, just by jumping... but then, this was a simple 'lets see what it does' code.. so how is the jumping in the Zelda code?


Gamestudio Pro 6.4
Pentium 4 3.0 GHz 800MHz BUS
AtiRadeon 9800 pro 256Mb 21" Monitor
1 Gig DDR RAM
36 Gig RAPTOR SATA+ 120 Gig SATA
SB Audigy 2 w/ 450 watt Logitech Z680 5.1

www.nordicepitaph.com
Re: Slightly improved Zelda code [Re: gamespider] #38114
04/28/06 06:48
04/28/06 06:48
Joined: Nov 2004
Posts: 862
Australia
DavidLancaster Offline OP
User
DavidLancaster  Offline OP
User

Joined: Nov 2004
Posts: 862
Australia
I'm not too sure about grabbing a ledge from the top, can you walk backwards off a ladder's top and grab it as you fall? Can you jump up to a ladder and grab onto it mid air? I can't remember if I set it up so that you can only use a ladder if you are on the ground or not. As to how you'd get that to work, allow the player to grab onto the ladder even if he is airborne, that might work. I think that the ultimate way to get ladders working the best, is to have trigger areas where if the player enters it, ie walks to the top of a ladder, he automatically climbs onto it, it may be tricky to program.

@BlueBeast
I'd say the jumping is average, not the best, the jumping height changes slightly when the frame rate is low, which is a bit annoying, and you can bob in the ground and stuff when you land, otherwise it works pretty cool, the animations with the jumping are good.

Re: Slightly improved Zelda code [Re: DavidLancaster] #38115
04/28/06 07:26
04/28/06 07:26
Joined: Apr 2006
Posts: 36
India
G
gamespider Offline
Newbie
gamespider  Offline
Newbie
G

Joined: Apr 2006
Posts: 36
India
Nope tried out everything..
The player doesnt grab the ladder by walking backwards....

I will try toget it working as soon as possible.

Re: Slightly improved Zelda code [Re: Orange Brat] #38116
04/28/06 12:05
04/28/06 12:05
Joined: Jan 2002
Posts: 94
Where ever this is, I 'm lost!
Serlink Offline
Junior Member
Serlink  Offline
Junior Member

Joined: Jan 2002
Posts: 94
Where ever this is, I 'm lost!
Quote:


I'll see about re-uploading my original test zip once I sort some stuff out. I don't know why I deleted it...all of the other various tester levels seem to still be there.




yes please upload. like to see more test with this code. I got an enemy fighting back but player is having some problems, i'll work on that tonight
thanks
Sam
ps I have been useing the Serlink name ever since Zelda first came out, God that was a long time a go.


Friendship starts with two smiles, one on me and one on you.
Serjr 2006
Page 10 of 15 1 2 8 9 10 11 12 14 15

Moderated by  adoado, checkbutton, mk_1, Perro 

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