Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Something as simple as a Bomb (https://forums.graalonline.com/forums/showthread.php?t=134261755)

MrOmega 01-19-2011 04:28 AM

Something as simple as a Bomb
 
Well, getting down to the nitty gritty now and I'm trying to completely recreate the bomb. I have run into a few snags and need some input/guidance. So all clientside I can get this to work flawlessly for the current player. But it looks horrible and choppy for other players and other players cant pick up the bomb after the current player has dropped it. So, I've tried interpolation with it and that has fixed the choppiness of it mostly. (except in cases of extreme lag) My issue is the whole throwing and landing part. I can through it serverside and it looks choppy but how could I go about making it smooth for all at the same time. The bomb is basically an NPC using a gani. Should I change this method or what?

Knux 01-19-2011 04:30 AM

I don't think the bomb NPC is just using a gani sir :O

MrOmega 01-19-2011 04:33 AM

Quote:

Originally Posted by Knux (Post 1623982)
I don't think the bomb NPC is just using a gani sir :O

Well theres code behind it. I mean for displaying it, it uses a gani. Gani lasts for five seconds and then thats when I do my custom explosion as well.

Knux 01-19-2011 04:39 AM

Yes but it's setting a gani like pickup or whatever the gani is. The actual bomb itself is placed with placeexplosion, or whatever isn't it? I dunno I haven't scripted since GS1 and don't remember any of it

MrOmega 01-19-2011 04:44 AM

I'm not using putbomb or any of that, I'm doing it from scratch.

Lance 01-19-2011 04:45 AM

Use a projectile (shoot command) to throw it. Have the projectile handling code place a bomb NPC of your design (with putnpc2) at the destination.

Knux 01-19-2011 04:57 AM

Quote:

Originally Posted by MrOmega (Post 1623990)
I'm not using putbomb or any of that, I'm doing it from scratch.

I understand that. But isn't bomb like predefined or whatever?

MrOmega 01-19-2011 06:05 AM

Quote:

Originally Posted by Knux (Post 1623993)
I understand that. But isn't bomb like predefined or whatever?

Yes but I don't want the predefined one. I'm going for better functionality and customization.

@Lance - how would I read what step that gani is at and how would I make it continue from that step in the shoot, as well as if the bomb needs to explode while in mid air?

MrAnonymous_P2P 01-19-2011 06:45 AM

I believe if you put the lime in the coconut, then mix it all up?


That might work.

Lance 01-19-2011 07:12 AM

Quote:

Originally Posted by MrOmega (Post 1624005)
@Lance - how would I read what step that gani is at

npc.anistep, if I recall correctly.

Quote:

and how would I make it continue from that step in the shoot,
By passing the step as a shoot parameter (see setshootparams).

Quote:

as well as if the bomb needs to explode while in mid air?
You'd have to see what options are available for accessing projectiles-in-motion. I've never dabbled with that personally so I'm not sure what the limitations are or just how inelegant it might be.

cbk1994 01-19-2011 08:02 AM

Quote:

Originally Posted by Lance (Post 1624016)
You'd have to see what options are available for accessing projectiles-in-motion. I've never dabbled with that personally so I'm not sure what the limitations are or just how inelegant it might be.

There aren't really any. If it needs to be able to explode mid-air, I would think your best bet is to use move (or script your own version that handles the NPC's Z) so it appears smooth on clientside. You could still blow it up mid-air if you destroy the NPC and then place the explosion (using another putnpc2, a showani, or however you do it).

DustyPorViva 01-19-2011 08:07 AM

You could POSSIBLY hack a method. Give the bomb projectile a power and zangle based how the time left when thrown. Make a bomb with a short fuse land faster than a bomb with a longer fuse. Then do the Z method yourself(since you'd be giving the bomb a projection based on fuse, and not the actual throw).

Switch 01-19-2011 11:02 AM

Quote:

Originally Posted by cbk1994 (Post 1624017)
There aren't really any.

Which is why I made this and never used it.

http://forums.graalonline.com/forums...hp?t=134259144

Knux 01-19-2011 01:12 PM

Quote:

Originally Posted by MrOmega (Post 1624005)
Yes but I don't want the predefined one. I'm going for better functionality and customization.

@Lance - how would I read what step that gani is at and how would I make it continue from that step in the shoot, as well as if the bomb needs to explode while in mid air?

Are you going to make a bomb for scratch, or get a walk-thru on here? :megaeek:

MrOmega 01-19-2011 03:37 PM

Quote:

Originally Posted by Knux (Post 1624054)
Are you going to make a bomb for scratch, or get a walk-thru on here? :megaeek:

I'm getting help and knowledge of the best practical way to do this. There's nothing wrong with that.

Update : So how do I go about reading the current anistep of a shoot gani? I could catch this gani step while the shoot is in mid air and put the explosion that way, but how would I as well stop a shoot gani while in mid-air? Also how would I make a gani play entirely from a certain anistep?


All times are GMT +2. The time now is 05:04 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.