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
Module requested from DrBrain

 
Post new topic   Reply to topic Printable version
 View previous topic  <C> ?doors Post :: Post damage (binaries only)  View next topic  
Author Message
WhiskeyTango
Newbie


Age:47
Gender:Gender:Male
Joined: Jul 02 2010
Posts: 12
Offline

PostPosted: Sat Jul 10, 2010 5:08 am    Post subject: Module requested from DrBrain Reply to topic Reply with quote

If you still have it, may I have a copy of that unfinished "multi-decoy" module you were working on.. I found it a very intriguing idea and would love to check it out.. I figure it was better to ask here rather than in-game.. Never know when to catch you.. xD
Back to top
View users profile Send private message Add User to Ignore List
Dr Brain
Flip-flopping like a wind surfer


Age:38
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Sat Jul 10, 2010 9:14 am    Post subject: Reply to topic Reply with quote

hs_decoy.c:

Code: Show/Hide

#include <stdlib.h>
#include <math.h>

#include "asss.h"
#include "hscore.h"
#include "selfpos.h"

//modules
local Imodman *mm;
local Ilogman *lm;
local Inet *net;
local Ihscoreitems *items;
local Iselfpos *selfpos;
local Ichat *chat;

local void Pppk(Player *p, byte *p2, int len)
{
   struct C2SPosition *pos = (struct C2SPosition *)p2;

   if (len < 22)
      return;

   /* handle common errors */
   if (!p->arena)
      return;

   if (p->p_ship == SHIP_SPEC)
   {
      return;
   }

   if (pos->weapon.type == W_DECOY)
   {
      int decoysplit = items->getPropertySum(p, p->p_ship, "decoysplit", 0);
      if (decoysplit)
      {
         int i;
         int offset = 0; // rand() % 40;
         
         double splitvel = items->getPropertySum(p, p->p_ship, "splitvel", 1000);
         struct Weapons weapon = {
            W_DECOY, 0, 0, 0, 0, 0
         };
         
         for (i = 0; i < decoysplit; i++)
         {
            int direction = (offset + (i * (40 / decoysplit))) % 40;

            // 0 = north, pi/2 = east
            double phi = ((double)(direction)) * M_PI / 20.0;
            int v_x = pos->xspeed + (int)(splitvel * sin(phi));
            int v_y = pos->yspeed + (int)(splitvel * cos(phi));

            if (i + 1 < decoysplit)
            {
               chat->SendMessage(p, "Decoy %d: vx=%d vy=%d dir=%d", i, v_x, v_y, direction);
               selfpos->WarpPlayerWithWeapon(p, pos->x, pos->y, v_x, v_y, direction, i - decoysplit - 1, &weapon);
            }
            else
            {
               chat->SendMessage(p, "Final %d: vx=%d vy=%d dir=%d", i, v_x, v_y, direction);
               selfpos->WarpPlayer(p, pos->x, pos->y, v_x, v_y, direction, 0);
            }
         }
      }
   }
}

EXPORT int MM_hs_decoy(int action, Imodman *_mm, Arena *arena)
{
   if (action == MM_LOAD)
   {
      mm = _mm;

      lm = mm->GetInterface(I_LOGMAN, ALLARENAS);
      net = mm->GetInterface(I_NET, ALLARENAS);
      items = mm->GetInterface(I_HSCORE_ITEMS, ALLARENAS);
      selfpos = mm->GetInterface(I_SELFPOS, ALLARENAS);
      chat = mm->GetInterface(I_CHAT, ALLARENAS);

      if (!lm || !net || !items || !selfpos || !chat) return MM_FAIL;

      net->AddPacket(C2S_POSITION, Pppk);

      return MM_OK;
   }
   else if (action == MM_UNLOAD)
   {
      net->RemovePacket(C2S_POSITION, Pppk);

      mm->ReleaseInterface(lm);
      mm->ReleaseInterface(net);
      mm->ReleaseInterface(items);
      mm->ReleaseInterface(selfpos);
      mm->ReleaseInterface(chat);

      return MM_OK;
   }
   return MM_FAIL;
}



You'll need hs_util's selfpos module. I've given up on ever making this work.
_________________
Hyperspace Owner

Smong> so long as 99% deaths feel lame it will always be hyperspace to me
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
WhiskeyTango
Newbie


Age:47
Gender:Gender:Male
Joined: Jul 02 2010
Posts: 12
Offline

PostPosted: Sat Jul 10, 2010 9:25 am    Post subject: Reply to topic Reply with quote

ty very much.. icon_smile.gif
Back to top
View users profile Send private message Add User to Ignore List
Cheese
Wow Cheese is so helpful!


Joined: Mar 18 2007
Posts: 1017
Offline

PostPosted: Sat Jul 10, 2010 4:28 pm    Post subject: Reply to topic Reply with quote

ive got something that does the same thing with no dependencies if youre interested.

the most ive ever gotten from it was four though.
the reason none of these work is because the client starts ignoring them after 2-4 for some reason...
let me know if you get better results
_________________
SSC Distension Owner
SSCU Trench Wars Developer
Back to top
View users profile Send private message Add User to Ignore List Visit posters website AIM Address
JoWie
Server Help Squatter


Gender:Gender:Male
Joined: Feb 25 2004
Posts: 215
Offline

PostPosted: Wed Jul 14, 2010 1:25 pm    Post subject: Reply to topic Reply with quote

Try sending one decoy per tick using the correct timestamp
Back to top
View users profile Send private message Add User to Ignore List
WhiskeyTango
Newbie


Age:47
Gender:Gender:Male
Joined: Jul 02 2010
Posts: 12
Offline

PostPosted: Wed Jul 14, 2010 8:18 pm    Post subject: Reply to topic Reply with quote

I am definately interested Cheese!, thanks for the offer.. For some reason I can always get stuff from brain to compile but ALWAYS have ERROR loading module.. Probably something I'm always forgetting to include in one way or another to make them right.. I even got the hscore stuff to compile after I fixed some things, but I get the same thing... Error loading... I don't know if it's because his is for linux and mine for windows or if that even matters... I guess it could be because I don't have my SQL server connecting correctly or not.. But for now that is on a back burner because I'm working on a new turf idea I've never seen used...

I would however REALLY appreciate a working multi-decoy module.. It's directly related to what I'm doing and I need it...
Back to top
View users profile Send private message Add User to Ignore List
Dr Brain
Flip-flopping like a wind surfer


Age:38
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Wed Jul 14, 2010 9:55 pm    Post subject: Reply to topic Reply with quote

An error loading a newly compiled module is almost always a missing dependency.

Look for a line similar to this in the offending module:
Code: Show/Hide

if (!lm || !net || !items || !selfpos || !chat) return MM_FAIL;


That tells you what it expects. In this case it needs logman, net, hscore_items, hs_util:selfpos, and chat. So if the loading is failing, it's probably because you haven't loaded hscore_items or hs_util:selfpos.

The same debugging technique applies to the hscore modules, and basically any other C module.
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
WhiskeyTango
Newbie


Age:47
Gender:Gender:Male
Joined: Jul 02 2010
Posts: 12
Offline

PostPosted: Wed Jul 14, 2010 10:15 pm    Post subject: Reply to topic Reply with quote

Very cool... Thanks for the info...
Back to top
View users profile Send private message Add User to Ignore List
Cheese
Wow Cheese is so helpful!


Joined: Mar 18 2007
Posts: 1017
Offline

PostPosted: Thu Jul 15, 2010 4:45 am    Post subject: Reply to topic Reply with quote

downside to mine is that its part of my 'misc' module, which is just an array of random crap i havnt put anywhere else yet...

meaning i could give you a slice of code, and not a prebuilt module
Back to top
View users profile Send private message Add User to Ignore List Visit posters website AIM Address
WhiskeyTango
Newbie


Age:47
Gender:Gender:Male
Joined: Jul 02 2010
Posts: 12
Offline

PostPosted: Thu Jul 15, 2010 10:20 pm    Post subject: Reply to topic Reply with quote

That's fine... I can compile it... As long as the slice works... If not just let me know what I need to fix it, or at least, just the fact that it's incomplete.. Either works for me.. Thanks again for offering it...
Back to top
View users profile Send private message Add User to Ignore List
Cheese
Wow Cheese is so helpful!


Joined: Mar 18 2007
Posts: 1017
Offline

PostPosted: Thu Aug 12, 2010 11:38 pm    Post subject: Reply to topic Reply with quote

i tried this again in distension, and ive concluded that the success on this, like the shapnel on thors, is heavily dependant on the timestamp on the packets, as well as the client's and zone's lag. any deviation and the weapon is not seen by clients. additionally, i have to guess that the checksum has to be valid as well. additionally, the timestamp can not match that of another weapon.

i have this up and running in distension, but out of 8 it only randomly gives 4-8 decoys at once, with a 80ms and 5% ploss connection, using timestamps +1,+2,+3,etc.

i wish i knew more, but its very sensitive.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website AIM Address
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> ASSS Custom Projects 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: 443 page(s) served in previous 5 minutes.

phpBB Created this page in 0.483706 seconds : 36 queries executed (80.5%): GZIP compression disabled