Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
3 registered members (Martin_HH, steyr, alibaba), 509 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
climbing #301930
12/15/09 13:19
12/15/09 13:19
Joined: Nov 2009
Posts: 96
philippines
joh Offline OP
Junior Member
joh  Offline OP
Junior Member

Joined: Nov 2009
Posts: 96
philippines
how am i going to run this one so i could try if it works?

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
vec_set(my.skill24,player.pan); //store its angles

while(1)
{
proc_late();

vec_set(player.x,my.skill21); //place it at the stored position to prevent the normal movement
// vec_set(player.pan,my.skill24); //enable this to disable the player from turning during climbing

my.skill30 = c_move(player,nullvector,vector(0,0,(key_w-key_s)*my.skill1*time_step),ignore_passable|ignore_passents|glide); //move the player up or down
if((key_s && my.skill30 < 0.1) || (key_w && (player.z+player.min_z) > (my.z+my.max_z+player.max_z))) //if the ground or the end of the ladder is reached,
{
break; //stop the loop
}

vec_set(my.skill21,player.x); //stores the new position

wait(1);
}

wait(-0.1); //prevent the player from triggering the event again and again when leaving the ladder
my.enable_impact = on; //make the ladder again sensible for the player
}
}
}

//skill1: ClimpSpeed 10
action ladder()
{
my.enable_impact = on;
my.event = ladder_event;

my.polygon = on;

c_setminmax(me);
}

Re: climbing [Re: joh] #301946
12/15/09 15:35
12/15/09 15:35
Joined: Sep 2009
Posts: 155
France
ayks Offline
Member
ayks  Offline
Member

Joined: Sep 2009
Posts: 155
France
put this code in a wdl of your game and put an entity in your game with the ladder() action ?


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