Project X Forums



It is currently Thu Mar 28, 2024 1:03 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Is it possible to make a script that....
PostPosted: Tue Oct 02, 2012 1:30 pm 
Offline
User avatar

Joined: Tue Oct 04, 2011 2:44 pm
Posts: 294
is it possible to make a script that overrides sprites in game? what i mean is, is it possible to make the script check weapon of current worm "sticky bomb" then if true over ride sprite 700 with image "sb.png" in real time? we are fast running out of sprites to override and ive been getting some weird glitches. so if you can override sprites constantly in game when a weapon is changed only 1 sprite number would ever be needed, eg "700"

_________________
“If you can't explain it simply, you don't understand it well enough” - Albert Einstein.


Top
 Profile  
Reply with quote  
 Post subject: Re: Is it possible to make a script that....
PostPosted: Tue Oct 02, 2012 1:44 pm 
Offline
User avatar

Joined: Tue Oct 04, 2011 2:44 pm
Posts: 294
this doesnt work lol

//List of sprites
CSprite* stick;


void SPRITES::InitGraphic()
{
//Loading picture data
CFile *f;
f = GetAttachment("sb.png");
stick = LoadSprite(f, 12, 0);


}
//Let's override the sprites!
override void CWorm::FireFinal(CWeapon* Weap,CShootDesc* Desc)
{
if(Weap->CheckName("Sticky Bomb"))
{
SetSpriteOverride(999, stick);
}
super;
}

_________________
“If you can't explain it simply, you don't understand it well enough” - Albert Einstein.


Top
 Profile  
Reply with quote  
 Post subject: Re: Is it possible to make a script that....
PostPosted: Tue Oct 02, 2012 3:05 pm 
Offline
User avatar

Joined: Sat Nov 27, 2010 12:59 pm
Posts: 346
SetSpriteOverride works only once... We can't override the Index otherwise.


Top
 Profile  
Reply with quote  
 Post subject: Re: Is it possible to make a script that....
PostPosted: Sun Jul 31, 2016 11:42 pm 
Offline
User avatar

Joined: Mon Aug 31, 2015 5:28 pm
Posts: 74
StepS wrote:
SetSpriteOverride works only once... We can't override the Index otherwise.


Why is this? I've come to a halt because i'm not sure how i can have two version of mole bomb in game.
It works only one time, BUT IT WORKS WHENEVER. For example if you wait 10 turns and then call Override before the sprite is in memory it will be overwritten. If there was some way to remove the sprite from memory and allow another override..


Code:
override void CWorm::FireFinal(CWeapon* Weap, CShootDesc* Desc)
{
   if(Weap->CheckName("Mole Bomb"))
   {
      SetSpriteOverride(158 , mfn);
        SetSpriteOverride(159 , mn1);
        SetSpriteOverride(160 , mn2);
        SetSpriteOverride(161 , mn3);
        SetSpriteOverride(166 , mwn);
       
   }
   else if(Weap->CheckName("Super Mole Bomb"))
   {
        SetSpriteOverride(158 , mfk);
        SetSpriteOverride(159 , mk1);
        SetSpriteOverride(160 , mk2);
        SetSpriteOverride(161 , mk3);
        SetSpriteOverride(166 , mwk);
   }
   
      super;
   
}


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 31 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