Project X Forums



It is currently Thu Mar 28, 2024 7:34 pm

All times are UTC




Post new topic Reply to topic  [ 17 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Modify mole weapon
PostPosted: Mon Aug 01, 2016 4:14 pm 
Offline
User avatar

Joined: Mon Aug 31, 2015 5:28 pm
Posts: 74
Z
Zed wrote:
Using setspriteoverride with a new sprite is possible, but it wont allow for an animation, because it wont have rotation then (mole sprite is already 'animated' with rotation).


It was actually possible. I extracted the digging, walking and jumping animations and made them transparent .png's which i then overrode. The issue is now there cant be a normal mole sprite animation. Your suggestion is probably the best way to do it if there is no way to call spriteoverride another time, which does not seem possible. It can only run one time before the sprite is loaded in to memory.


Top
 Profile  
Reply with quote  
 Post subject: Re: Modify mole weapon
PostPosted: Mon Aug 01, 2016 7:49 pm 
Offline
User avatar

Joined: Mon Aug 31, 2015 5:28 pm
Posts: 74
Trying to implement it now using AddSpriteEx. The rotation parameter is tricky because who knows the name of the mole rotation variable?? its not rot.. maybe because its a missile its possible to get velocity normal/direction? (is this SpX and SpY)?


Top
 Profile  
Reply with quote  
 Post subject: Re: Modify mole weapon
PostPosted: Tue Aug 02, 2016 2:39 am 
Offline
Betatester

Joined: Fri Oct 16, 2009 3:26 pm
Posts: 155
I don't think CMissile has a rotation var, animframe probably taken straight from spx and spy, as you say.

Try pyro's sprite builder for help. I found this in it:

float WeapSprite::CalculateAngle(float sx, float sy)
{
local a = -atan2(sx, sy) - MATH_PI + MATH_PI * rotation;
rot = a;
return rot;
}

rotation apparently is one of the params directly inputted to find the 'head' of the sprite.

_________________
Skype - verygooder1
ICQ - 420622934
Steam - http://steamcommunity.com/id/jarent/

use steam coz im too lazy to log into icq and skype


Top
 Profile  
Reply with quote  
 Post subject: Re: Modify mole weapon
PostPosted: Tue Aug 02, 2016 5:03 am 
Offline
User avatar

Joined: Mon Aug 31, 2015 5:28 pm
Posts: 74
Interesting function. I wonder why it subtracts PI and then adds it again.
Figured it's very easy to calculate direction by checking x,y coordinates every frame instead. And then maybe average it out a little to make it smooth.

Image

It's a kamikaze-mole, u see it?


Top
 Profile  
Reply with quote  
 Post subject: Re: Modify mole weapon
PostPosted: Tue Aug 02, 2016 5:26 am 
Offline
Betatester

Joined: Fri Oct 16, 2009 3:26 pm
Posts: 155
Yes, it looks like it has a dynamite with a clock on it :P

_________________
Skype - verygooder1
ICQ - 420622934
Steam - http://steamcommunity.com/id/jarent/

use steam coz im too lazy to log into icq and skype


Top
 Profile  
Reply with quote  
 Post subject: Re: Modify mole weapon
PostPosted: Wed Aug 03, 2016 1:15 am 
Offline
User avatar

Joined: Mon Aug 31, 2015 5:28 pm
Posts: 74
How does the explode timer work? Can't set it anywhere.
Tried to edit it in weapon editor :(
and edit the MagicMoleExplodeTimer var you made :(
nothing works.

And mole does not sink in water. The timer stops and u can stay under water with mole until Anti glitch starts.
Edit: It was because when mole sinks there is a force down but if you press UP you can beat it. Have to check if mole is under water and disable keys.

by the way, the rotation is now working with custom sprite but its really weird.. had to bruteforce the right values. I made code very bad, don't look at it. :oops:


Top
 Profile  
Reply with quote  
 Post subject: Re: Modify mole weapon
PostPosted: Wed Aug 03, 2016 3:08 am 
Offline
Betatester

Joined: Fri Oct 16, 2009 3:26 pm
Posts: 155
Mole has two explosion timers, one for walking part (10s), one for digging part (20s). The first is in Explosion (wep editor), the second is in Clusters-Explosion.
MagicMoleExplosionTimer is not an explosion timer :D Sorry name is not fitting

_________________
Skype - verygooder1
ICQ - 420622934
Steam - http://steamcommunity.com/id/jarent/

use steam coz im too lazy to log into icq and skype


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page Previous  1, 2

All times are UTC


Who is online

Users browsing this forum: No registered users and 27 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Skin by Lucas Kane