Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by Zheka. 06/20/24 14:26
Lapsa's very own thread
by rki. 06/19/24 11:27
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
2 registered members (RealSerious3D, rvl), 1,187 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
squik, AemStones, LucasJoshua, Baklazhan, Hanky27
19060 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Mario jump #76172
05/31/06 21:29
05/31/06 21:29
Joined: May 2005
Posts: 222
T
tek Offline OP
Member
tek  Offline OP
Member
T

Joined: May 2005
Posts: 222
I would like to know if anyone knows the code for jumping on a head and making the enemies dissapear, kinda like mario when he jumps on a goomba.
If anyone can help me I would greatly appreciate.

Re: Mario jump [Re: tek] #76173
05/31/06 21:32
05/31/06 21:32
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
I don't have the code, but an idea how to realize it:
(you need a normal jump code for this)
check the enemies event_impact and event_entity, if its the player, check if the player.z is higher than the enemie.z and higher than the enemie.z + the hight of his bounding box.
Caus this would mean that the player jumps on top of the enemie.

Re: Mario jump [Re: Xarthor] #76174
06/14/06 16:34
06/14/06 16:34
Joined: May 2005
Posts: 222
T
tek Offline OP
Member
tek  Offline OP
Member
T

Joined: May 2005
Posts: 222
Thanks Thunder I tried to do it, but it didn't work does anyone have a code I can try and work with. thanks everyone.

This is my code for jumping

function jump()
{
exclusive_global;
while (jump_time > -1)
{
player_distance.z = 40 * time * jump_time;
jump_time -= 0.09 * time;
if(my.ground_dist < 5){jump_time = 1;break;
}
wait (1);
}
while (key_space == 1)
{wait(1);
}
jump_time = 1;
}

I would like to know what to implement on my opponent and my jump that when I hit him on the head with my shoes when im jumping he turns into like a splashed goomba but when I get into a collision with him and where both standing I die.
I already know how to morph an enemy so I know how to implement him morphing into a splashed enemy, but I don't know how to implement hitting him when i'm jumping.
If anyone does not know but knows where I can get a tutorial on this I would appreciate.


Last edited by tek; 06/14/06 19:11.
Re: Mario jump [Re: tek] #76175
06/14/06 21:05
06/14/06 21:05
Joined: Apr 2005
Posts: 2,332
Germany, BaWü
aztec Offline

Expert
aztec  Offline

Expert

Joined: Apr 2005
Posts: 2,332
Germany, BaWü
try something with ent_remove justlook it up in the manual


Visit:
schwenkschuster-design.de
Re: Mario jump [Re: tek] #76176
06/15/06 06:22
06/15/06 06:22
Joined: Jun 2002
Posts: 3,682
Coppell, Texas
Ran Man Offline
Expert
Ran Man  Offline
Expert

Joined: Jun 2002
Posts: 3,682
Coppell, Texas
It looks like you need excellent collision for banging on the snakes head only? Hmmnnn

Okay, well I would make a special little invisible platform to follow the serpents head at all times. Make the platform out of blocks and in a .wmb file.

Okay next, I would attach an action to this new small little platform to make it follow the serpents head.

action snakehead // Just a little ole dumb head platform
{

while (1)
{
vec_set(my.x, snake.x); // copy snake.x to my.x
vec_set(my.y, snake.y); // copy snake.y to my.y
vec_set(my.z, snake.z); // copy snake.z to my.z
wait (1);
}
}

Now, what does the code above do? Well nothing but simply make the platform to follow the center of the snake. Yeah, okay, but we don't want the center, but we want the head right?

Perhaps we should adjust the y cooridinate to get it on the head by doing something like below?

vec_set(my.y, snake.y) - 10; // copy snake.y to my.y minus 10

Okay, but your snake needs an action and have to be called an entity named SNAKE.

entity* snake;

action nicesnake
{
snake=me;
//do movement stuff below...
}

Now as far as the jumping goes just make a variable that sets as the player jumps, then make it reset once he hits ground. <not the poor snakey>

Then if that jumping variable is set, then is when you affect the snakes code action to either die or resist.

Anyways, that is how I would do it.


Oh I forgot, make the invisible platform to be triggered once the player gets near it with a very small value.

This will take some coding to accomplish buddy!

Last edited by Ran Man; 06/15/06 06:27.

Cougar Interactive

www.zoorace.com
Re: Mario jump [Re: Ran Man] #76177
06/16/06 01:12
06/16/06 01:12
Joined: May 2005
Posts: 222
T
tek Offline OP
Member
tek  Offline OP
Member
T

Joined: May 2005
Posts: 222
RanMan, thank you so much for your contribution, you game me a nice idea.

What I am gonna do is create a snake head and snake body, i'm gonna give the body the action of going forward and backwards at a speed of 5 If I touch the body I die.
I have already the code for this.
For the head I will put a different action I will put the same movement, direction and speed as the body and that if I touch the head, (which this can only be acomplished if I jump) then the head disappears and the body turns into a splashed goomba (snake).
Man I am a genius (just kidding).

I have a question i would like to ask.

I know this is simple but how do I implement that when I touch something it dissapears ? for instance when I touch the snake head I want the sname head to disappear.
I know it's my.enable_impact =on; to touch but to make the snakehead to disappear what do I put ?

also, I know to morph an enemy I will have to put ent_morph.

But my question is if I touch the snake head what do I implement so that the snake body morphs unto the turtle splash.

I already have the model snakesplash.

I know I would use this if I wanted to make let's say the head turn unto the snake splash.

ent_morph(me,"snakeplash.mdl");

What I want is instead of ent_morph(me)
its ent_morph(snakebody,"snakesplash.mdl");
maybe what I just wrote could work lol I'll see if it does.

but if that's not the way and someone knows it would really help.
well, thanks for all your help these forums are great help I have learned so much about game design and coding.
In my wildest dreams I would never have thought I could get as far as I am.

Last edited by tek; 06/16/06 01:21.
Re: Mario jump [Re: tek] #76178
06/16/06 02:08
06/16/06 02:08
Joined: Jun 2002
Posts: 3,682
Coppell, Texas
Ran Man Offline
Expert
Ran Man  Offline
Expert

Joined: Jun 2002
Posts: 3,682
Coppell, Texas
Quote:

know this is simple but how do I implement that when I touch something it dissapears ? for instance when I touch the snake head I want the sname head to disappear.
I know it's my.enable_impact =on; to touch but to make the snakehead to disappear what do I put ?



Hi,
The key is "entity.invisible=on;" Here is a way to do it below.


Code:
 function headhit  // only do this upon impact!
{
my.invisible=on;
}


action snakehead
{
my.enable_entity=on;
my.enable_impact=on;// on impact do function assigned below
MY.EVENT = headhit; // assign headhit function to this action

// Now do more movement below in a while loop!
}



Of course once the headhit function is entered upon impact, then you need to check the jumping variable and see if the player jumped or not. If not jumping, then exit the function and do not make it invisible and stuff...

So, it will only work if the player is jumping on top of the poor snakey.


Yes, that morphing idea should work for you. Let us know if it does not though...

Last edited by Ran Man; 06/16/06 02:09.

Cougar Interactive

www.zoorace.com
Re: Mario jump [Re: Ran Man] #76179
06/16/06 03:58
06/16/06 03:58
Joined: May 2005
Posts: 222
T
tek Offline OP
Member
tek  Offline OP
Member
T

Joined: May 2005
Posts: 222
thanks the invisible worked when I jump on the snakes head it disappears
the other one didnt I couldnt get the body to turn into the snake splashed.

This is what I implemented.

Like the function you gave me I did another one but with the morphing

function turntoenemysplash
{
ent_morph(snakebody,"enemysplashed.mdl");
wait(1);
}

then in the snakehead action I put this

while (1)
{
my.enable_entity=on;
my.enable_impact=on;
MY.EVENT=headhit;
My.event=turntoenemysplash;
break;

when I did this it gave me an error

Parameter unknown snakebody KEYWORD

I also tried adding the mdl like this snakebody.mdl to the function but still no good.

I have a model snakebody and an action snakebody so I don't understand why it didnt detect it.

Do you know how to do that that when you touch one model another model morphs into something else is it possible to do this on gamestudio?
I want to do that when I touch the snakehead.mdl the snakebody.mdl turns unto snakesplashed.mdl.
I already got the head sdisappearing but not the morphing body :\ I will keep trying.

everything works perfectly except the snakebody turning, in the game the snakebody and head come at me at same speed so it looks like one snake is coming at me and when I jump and hit him on the head the head disappear but the body is still there and moving forward.

Last edited by tek; 06/16/06 04:48.
Re: Mario jump [Re: tek] #76180
06/16/06 18:06
06/16/06 18:06
Joined: Jun 2002
Posts: 3,682
Coppell, Texas
Ran Man Offline
Expert
Ran Man  Offline
Expert

Joined: Jun 2002
Posts: 3,682
Coppell, Texas
Hey wait Bro...

You can't have two MY.EVENT functions, but only one.

Just use one, then use variables to determine what you want to do once it enters that function.

Oh, and why is there a break; at the start of the while loop?

Btw, you don't need this code below in a while loop.
my.enable_entity=on;
my.enable_impact=on;
MY.EVENT=headhit;

Put that code before the while loop. Just put your movement or sounnds or whatever in that loop.

Last edited by Ran Man; 06/16/06 18:09.

Cougar Interactive

www.zoorace.com

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