Project X Forums http://px.worms2d.info/forum/ |
|
Revised Hang-Glider and Swim Suit http://px.worms2d.info/forum/viewtopic.php?f=13&t=1978 |
Page 1 of 1 |
Author: | Pablo [ Fri Mar 07, 2014 3:01 pm ] | |||
Post subject: | Revised Hang-Glider and Swim Suit | |||
Fixed Hang-Glider and Swim Suit libraries. Both of them are fully compatible with Invisibility now. And fixed old landing animation bug in Hang-Glider. Note: In order to get these libs working, you had to uncheck the old s_swimsuit.pxl, swim_suit_tweak.pxl (it's merged into s_swimsuit_revised), and wp_hangglider.pxl from your scheme. UPDATED (25/3/14):
|
Author: | -raffie- [ Fri Mar 07, 2014 4:24 pm ] |
Post subject: | Re: Revised Hang-Glider and Swim Suit |
Great! Perhaps you could give us a clue on what you did, or how you check for Invisibility being true or false? That way it would be possible to apply to other weapons (I'm thinking of Helicopter, ...) Thanks for your work! |
Author: | Pablo [ Fri Mar 07, 2014 9:05 pm ] |
Post subject: | Re: Revised Hang-Glider and Swim Suit |
-raffie- wrote: ...how you check for Invisibility being true or false? That way it would be possible to apply to other weapons (I'm thinking of Helicopter, ...) Well you really don't need invisibility checking, just put your drawing routines in the RenderWorm() event. It won't be called on remote machines when a worm is invisible. The only problem(if you use custom graphics) are the semi-transparent sprites. Here you need invisibility checking, to determine if your sprites must be semi transparent. Here is an example of how to do that(taken from my revised glider): Code: override void CDDQueue::AddSprite(fixed z,fixed x,fixed y,int unk,int sprite,fixed frame) { if(GS->Tick < 1) {super; return;} CWorm *w = GetCurrentWorm(); if(w != NullObj && w->Glider->Deployed) { // Replace normal Parachute sprites with Glider sprites if(sprite >= 287 && sprite <= 288) { w->AddSpriteEx(z, x, y, wormGliderSprite->Index, w->Glider->GliderAnimCycle, -w->Glider->GliderAng, 1); return; } // Replace mirrored Parachute sprites with mirrored Glider sprites if(sprite >= 287+262144 && sprite <= 288+262144) { w->AddSpriteEx(z, x, y, wormGliderSprite->Index+262144, w->Glider->GliderAnimCycle, w->Glider->GliderAng, 1); return; } // Replace semitransparent(invisibilized) Parachute sprites with semitransparent Glider sprites if(sprite >= 287+2097152 && sprite <= 288+2097152) { w->AddSpriteEx(z, x, y, wormGliderSprite->Index+2097152, w->Glider->GliderAnimCycle, -w->Glider->GliderAng, 1); return; } // Replace transparent and mirrored Parachute sprites with transparent mirrored Glider sprites if(sprite >= 287+262144+2097152 && sprite <= 288+262144+2097152) { w->AddSpriteEx(z, x, y, wormGliderSprite->Index+262144+2097152, w->Glider->GliderAnimCycle, w->Glider->GliderAng, 1); return; } } super; } Edit: Updated Hang-Glider!. |
Page 1 of 1 | All times are UTC |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |