Project X Forums



It is currently Thu Mar 28, 2024 5:48 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Highlander mod: crates
PostPosted: Sat Oct 03, 2015 3:40 pm 
Offline

Joined: Mon Jul 30, 2012 9:45 am
Posts: 194
Would it be possible to get the weapon from a picked up crate into the script so that it works in for example a Highlander?

I've studied the Highlander code and understand how it works (1 huge array for all worms' weapons in the game, a certain register within the array is loaded for each specific worm). So if someone might help me with how to get the crate's weapon - when it is picked, into the code (if at all possible), I think I could go from there and adapt the Highlander script.

Thanks in advance for any help.

_________________
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: Highlander mod: crates
PostPosted: Sun Mar 20, 2016 5:38 am 
Offline

Joined: Sat Aug 09, 2014 1:30 am
Posts: 43
-raffie- wrote:
Would it be possible to get the weapon from a picked up crate into the script so that it works in for example a Highlander?

I've studied the Highlander code and understand how it works (1 huge array for all worms' weapons in the game, a certain register within the array is loaded for each specific worm). So if someone might help me with how to get the crate's weapon - when it is picked, into the code (if at all possible), I think I could go from there and adapt the Highlander script.

Thanks in advance for any help.




easiest way I've found out


Code:
override void CCrate::Free(bool FreeMem)
{
    if((desc.type == CT_WEAPON || desc.type == CT_MWEAPON) && desc.weapon > 100)
    {
         local wep = GS->GetWeaponByIndex(1, desc.weapon-100);
         
         if(wep != NullObj)
         {
              local wepindex = wep->GetWeaponIndex();    //index of picked up weapon
         }
    }
   
    super;
}


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

All times are UTC


Who is online

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