Project X Forums



It is currently Fri May 25, 2018 10:50 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Restricting Girder placement around worm's radius
PostPosted: Thu Oct 05, 2017 5:16 pm 
Offline

Joined: Mon Jul 30, 2012 9:45 am
Posts: 194
This could really help out in many different schemes (like Holy War) in making it a lot harder to block worms with the girder.
Probably easy to do but I have no idea where to start, any help is eternally appreciated :D

_________________
http://twitch.tv/wormsdotam | http://worms.am/hl | http://worms.am/zombieshopper | http://worms.am/golf | http://worms.am/holywar


Top
 Profile  
Reply with quote  
 Post subject: Re: Restricting Girder placement around worm's radius
PostPosted: Fri Oct 06, 2017 2:23 pm 
Offline

Joined: Wed Sep 09, 2015 2:15 pm
Posts: 42
I'd be interested in this as well for my scheme. Sorry I can't help but you aren't alone in wanting this.


Top
 Profile  
Reply with quote  
 Post subject: Re: Restricting Girder placement around worm's radius
PostPosted: Sun Oct 08, 2017 5:02 am 
Offline

Joined: Sat Aug 09, 2014 1:30 am
Posts: 40
Saludos,
I hope this helps.

Code:
override void CTurnGame::Message(CObject* sender,EMType Type,int MSize,CMessageData* MData)
{
     super;
     //rafa``2
     if(int(Type) == 17)
   {
             if((GS->Tick % 2) == 0)
             {
                       
                        CWorm * cw = GetCurrentWorm();
                        if(cw == NullObj || cw->CurWeapon == NullObj) return;
                       
                        if(cw->CurWeapon->CheckName("Girder") || cw->CurWeapon->CheckName("Girder Starter-Pack"))
                        {
                             for (local i = 1; i < Env->Objs.Count; i++)
                             {
                                  local obj = Env->Objs.Objs[i];
                             
                                  if(obj == NullObj) continue;
                                  if((obj is CWorm) == false) continue;
                             
                                  CWorm * w = CWorm(obj);
                             
                                  if(w == NullObj) continue;                             

               local dx = w->PosX - GS->landSelectX; 
               local dy = w->PosY - GS->landSelectY;
               local dist = sqrt(dx*dx + dy*dy);

                                   if(dist <= 100)
               {
                    //cw->CanFire = false;
                    cw->WeaponN = 0;
                  
                                        if((GS->Tick % 4) == 0)
                                             cw->PlayLocalSound(120, 3, 1, 1);
                                        return;
               }         
             }
             //cw->CanFire = true;
             cw->WeaponN = cw->CurWeapon->GetWeaponIndex();
                        }
               }
}


Last edited by rafa``2 on Mon Oct 09, 2017 12:45 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Restricting Girder placement around worm's radius
PostPosted: Sun Oct 08, 2017 8:43 am 
Offline

Joined: Mon Jul 30, 2012 9:45 am
Posts: 194
rafa``2 to the rescue! PogChamp

I'll use this in my scheme and test it tonight! Thank you so much!

_________________
http://twitch.tv/wormsdotam | http://worms.am/hl | http://worms.am/zombieshopper | http://worms.am/golf | http://worms.am/holywar


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 1 guest


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