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
Freq

 
Post new topic   Reply to topic Printable version
 View previous topic  Another fake player problem... Post :: Post hud/counter  View next topic  
Author Message
Hakaku
Server Help Squatter


Joined: Apr 07 2006
Posts: 299
Location: Canada
Offline

PostPosted: Tue Jul 29, 2008 10:42 pm    Post subject: Freq Reply to topic Reply with quote

I have a question concerning how would it be possible to lock frequencies without locking ships? I tried looking at how game.c is coded for locking the arena, but it doesn't really tell me much on how I could go about locking only frequencies. icon_confused.gif Any ideas?

(from game.c)
Code: Show/Hide
local void lock_work(const Target *target, int nval, int notify, int spec, int timeout)
{
   LinkedList set = LL_INITIALIZER;
   Link *l;

   pd->TargetToSet(target, &set);
   for (l = LLGetHead(&set); l; l = l->next)
   {
      Player *p = l->data;
      pdata *pdata = PPDATA(p, pdkey);

      if (spec && p->arena && p->p_ship != SHIP_SPEC)
         SetFreqAndShip(p, SHIP_SPEC, p->arena->specfreq);

      if (notify && pdata->lockship != nval && chat)
         chat->SendMessage(p, nval ?
               (p->p_ship == SHIP_SPEC ?
                "You have been locked to spectator mode." :
                "You have been locked to your ship.") :
               "Your ship has been unlocked.");

      pdata->lockship = nval;
      pdata->expires = (nval == FALSE || timeout == 0) ? 0 : time(NULL) + timeout;
   }
   LLEmpty(&set);
}
Back to top
View users profile Send private message Add User to Ignore List Send email
Dr Brain
Flip-flopping like a wind surfer


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

PostPosted: Wed Jul 30, 2008 8:23 am    Post subject: Reply to topic Reply with quote

Make a freq manager that allows people to change ships but not frequencies.
_________________
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
Samapico
No, these DO NOT look like penises, ok?


Joined: May 08 2003
Posts: 1252
Offline

PostPosted: Wed Jul 30, 2008 11:39 pm    Post subject: Reply to topic Reply with quote

Dr Brain wrote:
Make a freq manager that allows people to change ships but not frequencies.
Isn't that like telling your <any sport> team: "hey, try to score goals" ?
_________________
(Insert a bunch of dead links here)
Back to top
View users profile Send private message Add User to Ignore List
Dr Brain
Flip-flopping like a wind surfer


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

PostPosted: Thu Jul 31, 2008 7:56 am    Post subject: Reply to topic Reply with quote

Samapico wrote:
[..]

Isn't that like telling your <any sport> team: "hey, try to score goals" ?


It's more like telling them which side of the field the goal is on.
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
Hakaku
Server Help Squatter


Joined: Apr 07 2006
Posts: 299
Location: Canada
Offline

PostPosted: Fri Aug 01, 2008 1:12 am    Post subject: Reply to topic Reply with quote

Although I agree Brain is right, and perhaps Grel meant to eventually add a frequency manager judging by game.c, but the problem is that I don't know how. I assume the code for lock_work should pretty much be the same as if it were used for locking only frequencies. The difference being that locking the arena uses the following (commented out the rest):
Code: Show/Hide
#define KEY_SHIPLOCK 46
//
#include "packets/shipchange.h"
//

typedef struct
{
//

   /* some flags */
   byte lockship, rgnnoanti, rgnnoweapons, pad2;
//
} pdata;

typedef struct
{
//
   int initlockship, initspec;
//
} adata;

Code: Show/Hide
struct ShipChangePacket
{
   u8 type;
   i8 shiptype;
   i16 pnum;
   i16 freq;
};

This explains why both ships and frequencies cannot be changed after pdata->lockship = TRUE;, however I don't understand what #define KEY_SHIPLOCK 46 does exactly? Or more specifically, where does 46 come from?
Back to top
View users profile Send private message Add User to Ignore List Send email
Dr Brain
Flip-flopping like a wind surfer


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

PostPosted: Fri Aug 01, 2008 7:55 am    Post subject: Reply to topic Reply with quote

I'm not sure what you mean about Grel eventually adding freq managers... they've been in ASSS since the first release. Look at fm_normal and fm_lockspec.

The simplest solution is to have the manager always lock teams, and then to lock them you just attach the module to the arena. If you want mods to be able to use the command, then you'll have to set up the module to work normally until a command is activated (I suggest starting with fm_normal).

the KEY_SHIPLOCK is a unique key for the persist data. 46 is a number no other module is using.
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
D1st0rt
Miss Directed Wannabe


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

PostPosted: Sun Aug 03, 2008 10:33 am    Post subject: Reply to topic Reply with quote

If you don't want to use C, there's even an example fm module in python (fm_password) that you can modify to do what you need.
_________________

Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Hakaku
Server Help Squatter


Joined: Apr 07 2006
Posts: 299
Location: Canada
Offline

PostPosted: Mon Aug 04, 2008 8:22 pm    Post subject: Reply to topic Reply with quote

Dr Brain wrote:
I'm not sure what you mean about Grel eventually adding freq managers... they've been in ASSS since the first release. Look at fm_normal and fm_lockspec.

The simplest solution is to have the manager always lock teams, and then to lock them you just attach the module to the arena. If you want mods to be able to use the command, then you'll have to set up the module to work normally until a command is activated (I suggest starting with fm_normal).

the KEY_SHIPLOCK is a unique key for the persist data. 46 is a number no other module is using.
Oh ok, that makes sense; I missed those two files. For some reason I was expecting there to be a file named just freqman, similar to arenaman, capman, or cmdman.

Anyhow, thanks for the input. I was just trying to see how it could be done, rather than emulating a bot's way of using *setfreq to place a player back on his/her respective team when another player or team has picked up all flags (to prevent freq hopping for points).
Back to top
View users profile Send private message Add User to Ignore List Send email
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> ASSS 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: 26 page(s) served in previous 5 minutes.

phpBB Created this page in 0.459304 seconds : 32 queries executed (93.4%): GZIP compression disabled