|
Server Help Community forums for Subgame, ASSS, and bots
|
Author |
Message |
WhiskeyTango Newbie
Age:47 Gender: Joined: Jul 02 2010 Posts: 12 Offline
|
Posted: Sat Jul 10, 2010 5:08 am Post subject: Module requested from DrBrain |
|
|
|
|
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 |
|
|
Dr Brain Flip-flopping like a wind surfer
Age:38 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Sat Jul 10, 2010 9:14 am Post subject: |
|
|
|
|
hs_decoy.c:
#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 |
|
|
WhiskeyTango Newbie
Age:47 Gender: Joined: Jul 02 2010 Posts: 12 Offline
|
Posted: Sat Jul 10, 2010 9:25 am Post subject: |
|
|
|
|
ty very much.. |
|
Back to top |
|
|
Cheese Wow Cheese is so helpful!
Joined: Mar 18 2007 Posts: 1017 Offline
|
Posted: Sat Jul 10, 2010 4:28 pm Post subject: |
|
|
|
|
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 |
|
|
JoWie Server Help Squatter
Gender: Joined: Feb 25 2004 Posts: 215 Offline
|
Posted: Wed Jul 14, 2010 1:25 pm Post subject: |
|
|
|
|
Try sending one decoy per tick using the correct timestamp |
|
Back to top |
|
|
WhiskeyTango Newbie
Age:47 Gender: Joined: Jul 02 2010 Posts: 12 Offline
|
Posted: Wed Jul 14, 2010 8:18 pm Post subject: |
|
|
|
|
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 |
|
|
Dr Brain Flip-flopping like a wind surfer
Age:38 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
|
Back to top |
|
|
WhiskeyTango Newbie
Age:47 Gender: Joined: Jul 02 2010 Posts: 12 Offline
|
Posted: Wed Jul 14, 2010 10:15 pm Post subject: |
|
|
|
|
Very cool... Thanks for the info... |
|
Back to top |
|
|
Cheese Wow Cheese is so helpful!
Joined: Mar 18 2007 Posts: 1017 Offline
|
Posted: Thu Jul 15, 2010 4:45 am Post subject: |
|
|
|
|
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 |
|
|
WhiskeyTango Newbie
Age:47 Gender: Joined: Jul 02 2010 Posts: 12 Offline
|
Posted: Thu Jul 15, 2010 10:20 pm Post subject: |
|
|
|
|
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 |
|
|
Cheese Wow Cheese is so helpful!
Joined: Mar 18 2007 Posts: 1017 Offline
|
Posted: Thu Aug 12, 2010 11:38 pm Post subject: |
|
|
|
|
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 |
|
|
|
|
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
|
Software by php BB © php BB Group Server Load: 851 page(s) served in previous 5 minutes.
|