PDA

View Full Version : [Request] hand grenade



Shazza Dani
12-18-2008, 10:04 PM
I have another request for people to ignore…

A bomb that Link "throws" instead of setting. So I need a script that makes Link throw the bomb two tiles in front of him (like the candle flame?) then it explodes instantly.

pkmnfrk
12-19-2008, 12:08 AM
*claims* This shouldn't be too difficult.

Joe123
12-19-2008, 04:23 AM
http://users.sephiroth.ws/Migokalle/the_dead_forest.zip

hehehe....
Works best in 819.

I can organise the code from that to work in a more Zelda game if you want?

Shazza Dani
12-19-2008, 04:34 AM
EDIT: I tried that quest in the newest build, then 819 and I see the items aren't working properly in the new one.

But that grenade is close to what I want. I actually want it to explode as soon as it hits the ground.

Joe123
12-19-2008, 06:16 PM
I know it won't work in the new build.
_L_ change the way item speeds work.

Explode on impact is fine yeah, I can do that.

Joe123
12-20-2008, 07:48 AM
http://www.purezc.com/forums/index.php?showtopic=39138&pid=556625&st=0&#entry556625

Shazza Dani
12-20-2008, 08:22 AM
I'm getting an error compiling it.

Joe123
12-20-2008, 10:20 AM
Make sure you have import "std.zh" in your .z file.

pkmnfrk
12-20-2008, 12:59 PM
A suggestion:

for(int i=1;i<=Screen->NumLWeapons();i++){
Grenade = Screen->LoadLWeapon(i);
if(Grenade->ID != LW_SCRIPT1) continue;
Found = true;
}

I would write this like:


for(int i=1;i<=Screen->NumLWeapons();i++){
Grenade = Screen->LoadLWeapon(i);
if(Grenade->ID == LW_SCRIPT1) {
Found = true;
break;
}
}

So that it stops once it finds the grenade, rather than continuing to check every single lweapon on the screen (not that big of a problem, but it makes more sense this way)

Other than that, this script looks pretty good (especially since it uses the proper global-script form!)

Joe123
12-20-2008, 01:38 PM
Mm, I had a reason at the time for not writing it like that. I can't remember what it was now though.

Your method of writing global scripts is definately much better :thumbsup:

Shazza Dani
12-20-2008, 10:31 PM
Joe, your PM box is full.

Anyway, both scripts appear to be working perfectly now. Thanks a lot for all the help.

Joe123
12-21-2008, 05:43 AM
Oops!

Not anymore.
Glad you got them working though.