Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
Weapons

 
Post new topic   Reply to topic Printable version
 View previous topic  SpamGen (heh soloace) Post :: Post object toggling problem  View next topic  
Author Message
Jacen Solo
Newbie


Joined: Oct 19 2004
Posts: 5
Offline

PostPosted: Wed Dec 29, 2004 6:49 pm    Post subject: Weapons Reply to topic Reply with quote

Does anyone know what the weapon values are?... I'm trying to write in some stuff for my bot to shoot different types of weapons but don't know what the values are... the only thing I know is -37000 which OverBurn told me was a level 3 mine with prox and shrap.

I'm writing it for TWCore but I don't think that really matters since it just sends a packet to the server to make it fire the weapon so the values should be the same for all cores.
Back to top
View users profile Send private message Add User to Ignore List
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Wed Dec 29, 2004 7:04 pm    Post subject: Reply to topic Reply with quote

Code: Show/Hide
#define WPN_NONE           0x00
#define WPN_BULLET         0x01
#define WPN_BOUNCINGBULLET 0x02
#define WPN_BOMB           0x03
#define WPN_PROXBOMB       0x04
#define WPN_REPEL          0x05
#define WPN_DECOY          0x06
#define WPN_BURST          0x07
#define WPN_THOR           0x08

typedef struct WPN_
   {
   WORD type        : 5;
   WORD level       : 2;
   WORD shrapbounce : 1;
   WORD shraplevel  : 2;
   WORD shrap       : 5;
   WORD multimine   : 1;
   } WPN;

_________________
4,691 irradiated haggis!
Back to top
View users profile Send private message Add User to Ignore List
Jacen Solo
Newbie


Joined: Oct 19 2004
Posts: 5
Offline

PostPosted: Wed Dec 29, 2004 7:09 pm    Post subject: Reply to topic Reply with quote

mmm... that doesn't make much sense to me... I've never really looked at MERVBot... the Ship class for the bot in TWCore just has a method called fire and its parameter is a int value and the bot sends that int value in a fire weapon packet.
Back to top
View users profile Send private message Add User to Ignore List
D1st0rt
Miss Directed Wannabe


Age:37
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Wed Dec 29, 2004 8:11 pm    Post subject: Reply to topic Reply with quote

the weapon number sent in the packet (wepinfo) is set up like this:

Code: Show/Hide
    public WeaponFired( ByteArray array ){
        super( array );
        short wepinfo = getWeaponInfo();
        m_weaponType = wepinfo & 0x001f;
        m_weaponLevel = ((wepinfo & 0x0060)>>5) + 1;
        m_weaponBouncyShrap = ((wepinfo & 0x0080)>>7)==1;
        m_weaponShrapLevel = ((wepinfo & 0x0300)>>8) + 1;
        m_weaponShrapCount = (wepinfo & 0x7c00)>>10;
        m_weaponAlternative = (wepinfo & 0x8000)>>15==1;
    }



I'll try to have something usable by tomorrow
_________________

Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Wed Dec 29, 2004 8:11 pm    Post subject: Reply to topic Reply with quote

The defines ARE the int values for the weapons. The structure shows how the weapon info is stored in the weapon packet.

d1stort, are you serious? Who wrote that ridiculous code? They should not be allowed to program ever again.
Back to top
View users profile Send private message Add User to Ignore List
D1st0rt
Miss Directed Wannabe


Age:37
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Wed Dec 29, 2004 8:13 pm    Post subject: Reply to topic Reply with quote

it came with twcore...

not how I'd do it personally

EDIT: I was looking around, and I couldn't even find a way to extract certain bits from a number in java, so I had to write this function:

Code: Show/Hide
   public static int getBitFragment(byte b, int startIndex, int endIndex)
   {
      b &= (int)Math.pow(2,8 - startIndex);
      return (b >> (8 - endIndex));
   }
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Solo Ace
Yeah, I'm in touch with reality...we correspond from time to time.


Age:37
Gender:Gender:Male
Joined: Feb 06 2004
Posts: 2583
Location: The Netherlands
Offline

PostPosted: Wed Dec 29, 2004 8:28 pm    Post subject: Reply to topic Reply with quote

Don't make fun of my code, it must be elite because Qndre was my teacher! icon_sad.gif
Back to top
View users profile Send private message Add User to Ignore List
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Wed Dec 29, 2004 8:50 pm    Post subject: Reply to topic Reply with quote

OMG! I'm staying out of this thread. I'm about to puke up what I had for Thanksgiving 1984. new_puppy_dog_eyes.gif
Back to top
View users profile Send private message Add User to Ignore List
Solo Ace
Yeah, I'm in touch with reality...we correspond from time to time.


Age:37
Gender:Gender:Male
Joined: Feb 06 2004
Posts: 2583
Location: The Netherlands
Offline

PostPosted: Wed Dec 29, 2004 9:18 pm    Post subject: Reply to topic Reply with quote

Haha, yeah gtfo Ek! icon_smile.gif
Back to top
View users profile Send private message Add User to Ignore List
50% Packetloss
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Sep 09 2003
Posts: 561
Location: Santa Clarita, California
Offline

PostPosted: Wed Dec 29, 2004 9:26 pm    Post subject: Reply to topic Reply with quote

Keep in mind that many of the weapons are controlled by server settings, such as emps.

This is how its written in mervbot (which is exactly what ekted has above)

Code: Show/Hide

union weaponInfo
{
   struct
   {
      Uint16 type         : 5;   // enum Projectile_Types
      Uint16 level      : 2;   // Only for bombs/bullets
      Uint16 shrapBounce   : 1;   // Bouncing shrapnel?
      Uint16 shrapLevel   : 2;   // Shrapnel level 0..3
      Uint16 shrapCount   : 5;   // 0-31
      Uint16 fireType      : 1;   // Bombs -> Mines, Bullets -> Multifire
   };

   Uint16 n;
};


// Weapon types for weaponInfo.type

enum Projectile_Types
{
   // Seen "in the wild"
   PROJ_None,
   PROJ_Bullet,
   PROJ_BBullet,
   PROJ_Bomb,
   PROJ_PBomb,
   PROJ_Repel,
   PROJ_Decoy,
   PROJ_Burst,
   PROJ_Thor,

   // Internal to the bot
   PROJ_InactiveBullet,
   PROJ_Shrapnel
};


// Weapon levels for weaponInfo.level

enum Weapon_Levels
{
   LVL_One,
   LVL_Two,
   LVL_Three,
   LVL_Four
};
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Wed Dec 29, 2004 11:43 pm    Post subject: Reply to topic Reply with quote

In case Ekted looks at this thread again, that's one of the cleaner ways of doing it in Java. icon_razz.gif
_________________
This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
D1st0rt
Miss Directed Wannabe


Age:37
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Thu Dec 30, 2004 3:05 pm    Post subject: Reply to topic Reply with quote

If anyone can come up with a better solution, please tell me. I like to learn new techniques, and I've really only known how to program for a year. Heh, I wasn't even around in 1984.

Last edited by D1st0rt on Fri Dec 31, 2004 11:03 am, edited 1 time in total
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Bak
?ls -s
0 in


Age:26
Gender:Gender:Male
Joined: Jun 11 2004
Posts: 1826
Location: USA
Offline

PostPosted: Thu Dec 30, 2004 5:21 pm    Post subject: Reply to topic Reply with quote

Code: Show/Hide
/**
* get the bit fragment from startIndex to endIndex
* @param extractFrom the byte to extract from
* @param startIndex the inclusive leftbound index: 1234 5678
* @param endIndex the inclusive rightbound index 1234 5678 and > startIndex
* @return the int extracted from the requested bits
*/
public static int getBitFragment(byte extractFrom, int startIndex, int endIndex)
{
      int shift = 8 - endIndex;
      int numBits = endIndex - startIndex + 1;
      byte mask = (byte)((0x01 << numBits) - 1);

      return (extractFrom >> shift) & mask;
}
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Bot Questions All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 120 page(s) served in previous 5 minutes.

phpBB Created this page in 0.503754 seconds : 38 queries executed (93.0%): GZIP compression disabled