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
Fake player positions

 
Post new topic   Reply to topic Printable version
 View previous topic  Time Post :: Post Another fake player problem...  View next topic  
Author Message
tcsoccerman
Server Help Squatter


Age:33
Gender:Gender:Male
Joined: Jan 15 2007
Posts: 694
Location: Atlantis
Offline

PostPosted: Fri May 02, 2008 10:58 pm    Post subject: Fake player positions Reply to topic Reply with quote

I'm having trouble with fake players. I can create the fake player, which shows up on the player list but i can never see it. Here is the code:

Code: Show/Hide
int InitializeTurrets(Arena *arena)
{
      adata *ad = P_ARENA_DATA(arena, adkey);
     
      int i;
      for(i = 0;i < ad->turret_count;i++)
      {
            TurretData *td = &(ad->turrets[i]);
            Player *fp;
           
            char s[16];
            snprintf(s, 16, "Team%d:Turret%d", td->team, i);
           
            td->FakePlayer = fp = fake->CreateFakePlayer(s,arena,td->ship,td->team);
           
            struct C2SPosition *pos;
           
            lm->Log(L_INFO,"<%s> Check 1","complex_turret");
            pos = &td->pos;
            pos->type = C2S_POSITION;
            pos->x = td->x;
            pos->y = td->y;
            pos->rotation = 0;
            pos->xspeed = pos->yspeed = 0;
           pos->status = 0;
           pos->bounty = 0;
           pos->energy = pos->extra.energy = 1000;
           lm->Log(L_INFO,"<%s> Check 2","complex_turret");
          
           //lets get config here
           /*td->weapon = W_PROXBOMB;
           pos->weapon.type = 0;
           pos->weapon.level = 0;
           pos->weapon.shraplevel = 0;
           pos->weapon.shrap = 0;
           pos->weapon.alternate = 0;*/
          
           lm->Log(L_INFO,"<%s> Created Turret %d","complex_turret",i);
          
           game->FakePosition(td->FakePlayer, &td->pos, 22);
      }
      lm->Log(L_INFO,"<%s> Initialized turrets","complex_turret");
}


also when i do "sizeof(pos)" for arg 3 in game->FakePosition, it gives a bad packet error in game len=4.

so i need to fix the pos packet to make it "good" and imagely show the player on screen...
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Bak
?ls -s
0 in


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

PostPosted: Sat May 03, 2008 3:49 am    Post subject: Reply to topic Reply with quote

sizeof(struct C2SPosition*) is 4
sizeof(struct C2SPosition) is 22

pos is a struct C2SPosition*... do sizeof(struct C2SPosition) instead


try changing
Code: Show/Hide
pos->x = td->x;
pos->y = td->y;


to
Code: Show/Hide
pos->x = 512 * 16;
pos->y = 512 * 16;
and look near the center of the map
_________________
SubSpace Discretion: A Third Generation SubSpace Client
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Dr Brain
Flip-flopping like a wind surfer


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

PostPosted: Sat May 03, 2008 11:24 am    Post subject: Reply to topic Reply with quote

You need to call FakePosition in a loop, otherwise you'll only ever get 1 packet. If you load the module on arena start up, you'll never get a chance to see the turret.
_________________
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
tcsoccerman
Server Help Squatter


Age:33
Gender:Gender:Male
Joined: Jan 15 2007
Posts: 694
Location: Atlantis
Offline

PostPosted: Sat May 03, 2008 11:47 am    Post subject: Reply to topic Reply with quote

Smong: That must be the problem, i was using tiles not pixels :/. td->x and td->y equaled 512.

Dr. Brain:Yes i will do a loop, but i wasn't aware that you need to keep sending packets inorder for it to stay visible. Thank You.
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
tcsoccerman
Server Help Squatter


Age:33
Gender:Gender:Male
Joined: Jan 15 2007
Posts: 694
Location: Atlantis
Offline

PostPosted: Sat May 03, 2008 12:31 pm    Post subject: Reply to topic Reply with quote

Hmmmm...

There seems to be trouble with it, as the players still aren't showing up.

Anybody care to look?




complex_turret.c - 8.14 KB
File downloaded or viewed 26 time(s)
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Samapico
No, these DO NOT look like penises, ok?


Joined: May 08 2003
Posts: 1252
Offline

PostPosted: Sat May 03, 2008 5:18 pm    Post subject: Reply to topic Reply with quote

I looked... but not knowing anything about ASSS I didn't find anything tongue.gif
The timer thing gets executed how often?
_________________
(Insert a bunch of dead links here)
Back to top
View users profile Send private message Add User to Ignore List
tcsoccerman
Server Help Squatter


Age:33
Gender:Gender:Male
Joined: Jan 15 2007
Posts: 694
Location: Atlantis
Offline

PostPosted: Sat May 03, 2008 5:24 pm    Post subject: Reply to topic Reply with quote

I'm not sure. All i know is autoturret.c uses the same method, so probably enough :/.

Did you try compiling it? I get warnings when i try to compile it and it is referring to game->FakePosition...arguement 2 i think, which is a big deal.
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Bak
?ls -s
0 in


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

PostPosted: Sat May 03, 2008 5:50 pm    Post subject: Reply to topic Reply with quote

smong?

http://wiki.minegoboom.com/index.php/Writing_Modules_In_C#Adding_Timers
Back to top
View users profile Send private message Add User to Ignore List AIM Address
tcsoccerman
Server Help Squatter


Age:33
Gender:Gender:Male
Joined: Jan 15 2007
Posts: 694
Location: Atlantis
Offline

PostPosted: Sat May 03, 2008 7:26 pm    Post subject: Reply to topic Reply with quote

Before you posted i actually switched to timers. Initally i had timers, then switched to the callback since that's what autoturret.c had. as i said, i had already switched back again to timers.

i've gotten at least one of the fake players to display. here's the deal.

only the last turret is displayed.

for instance if i have this config file ("complex_turret.conf"):

Code: Show/Hide
[Main]
TurretCount=4

[Turret0]
Region=4
Team=0
Ship=1
Coordinates=512,512

[Turret1]
Region=4
Team=1
Ship=2
Coordinates=530,512

[Turret2]
Region=4
Team=0
Ship=3
Coordinates=530,530

[Turret3]
Region=4
Team=1
Ship=4
Coordinates=512,530


only Turret3 is displayed. They are always on freq 0, for some reason as well. if ship 4 is spider, than the ship is right, otherwise wrong. allthough they don't show up, the other 3 (turrets 0-2) are displayed in the player listbox but never are visible. when i attach to them, a turret green circle shows up where i was and nothing else.




New file

complex_turret.c - 7.98 KB
File downloaded or viewed 33 time(s)
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Thu May 08, 2008 6:17 pm    Post subject: Reply to topic Reply with quote

I don't know about your other problems but Timer() is supposed to return 1.
_________________
ss news
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
tcsoccerman
Server Help Squatter


Age:33
Gender:Gender:Male
Joined: Jan 15 2007
Posts: 694
Location: Atlantis
Offline

PostPosted: Thu Jul 24, 2008 6:26 pm    Post subject: Reply to topic Reply with quote

The problem was that the position struct declared in struct turretdata was a pointer ( or had a * infront of the variable declaration) when it wasn't an array or pointer. it's working now.
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
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: 64 page(s) served in previous 5 minutes.

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