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
King of the hill

 
Post new topic   Reply to topic Printable version
 View previous topic  We need 2 modules. Post :: Post Custom bomb trajectory  View next topic  
Author Message
tcsoccerman
Server Help Squatter


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

PostPosted: Sat Jun 30, 2007 4:46 pm    Post subject: King of the hill Reply to topic Reply with quote

I'm looking for an as3 module that chooses a location on the map and puts a graphic at that location. you must go to that place and hold that hill for x amount of seconds to win that "king of the hill round". once you win..say 5 hills, you win that game. For an example of this go to Halo zone. Anything is appreciated.
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: Sat Jun 30, 2007 5:42 pm    Post subject: Reply to topic Reply with quote

I was asked to make this for halo same time last year. I'm attaching the module/source and a sample arena. I'm sure Halo won't mind since they never used it.

It doesn't run for 5 rounds and the reward is set to 200 bounty per round. If you want to make it give points have a look at stats.h and statcodes.h.
_________________
ss news




1.4.3 src doc dll arena

asss-halo_hill-1.2.zip - 132.82 KB
File downloaded or viewed 50 time(s)
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
tcsoccerman
Server Help Squatter


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

PostPosted: Sat Jun 30, 2007 6:34 pm    Post subject: Reply to topic Reply with quote

ty!
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
BDwinsAlt
Agurus's Posse


Age:33
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Sun Jul 01, 2007 1:17 am    Post subject: Reply to topic Reply with quote

Halo was going to use it, but when it was compiled for Windows (by Muskrat), it crashed ASSS. Linux one worked fine on the development server. Awesome module.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
tcsoccerman
Server Help Squatter


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

PostPosted: Mon Jul 02, 2007 10:03 pm    Post subject: Reply to topic Reply with quote

smong, can you tell me what is wrong w/ this coding. it crashes as3 IN GAME.

Code: Show/Hide
else if (ad->rewardtype == 1)//points
   {
      pd->Lock();
      Link *link;
      Player *p;
         FOR_EACH_PLAYER(p)           
         {
           if (p->status == S_PLAYING &&
            p->arena == arena &&
            p->p_ship != SHIP_SPEC)
            {
                      stats->IncrementStat(p, STAT_BALL_GOALS, 1);
                      stats->SendUpdates();
              }
         }
         pd->Unlock();           
      chat->SendArenaSoundMessage(arena, SOUND_OOO,
         "Freq %d wins the Hill game! %d points given.",
         freq, ad->reward);

      lm->LogA(L_INFO, "halo_hill", arena,
         "freq %d won hill game. %d POINTS given.",
         freq, ad->reward);
        }
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Solo Ace
Yeah, I'm in touch with reality...we correspond from time to time.


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

PostPosted: Tue Jul 03, 2007 2:03 am    Post subject: Reply to topic Reply with quote

The indenting, for starters.
Back to top
View users profile Send private message Add User to Ignore List
Animate Dreams
Gotta buy them all!
(Consumer whore)


Age:36
Gender:Gender:Male
Joined: May 01 2004
Posts: 821
Location: Middle Tennessee
Offline

PostPosted: Tue Jul 03, 2007 8:19 am    Post subject: Reply to topic Reply with quote

Don't you have to use p->p_freq?
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address MSN Messenger
tcsoccerman
Server Help Squatter


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

PostPosted: Tue Jul 03, 2007 8:46 am    Post subject: Reply to topic Reply with quote

Ty, i forgot that. it still isn't fixed though :\.
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
tcsoccerman
Server Help Squatter


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

PostPosted: Tue Jul 03, 2007 8:58 am    Post subject: Reply to topic Reply with quote

Here is as3 when it crashed:

Code: Show/Hide
E <deadlock> deadlock detected, aborting

This application has requested the Runtime
Please contact the application's support t
asss out of memory. restarting.
asss 1.4.3 built at Jun  8 2006 23:41:46
Loading modules...


i also figured out that the crash happened in these two lines:

Code: Show/Hide
stats->IncrementStat(p, STAT_BALL_GOALS, 1);
                      stats->SendUpdates();


hope that helps.i'm just gonna play around w/ it and see what happens. maybe i'll get lucky
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:36
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Tue Jul 03, 2007 9:23 am    Post subject: Reply to topic Reply with quote

Well, there's nothing obviously wrong with that code, so either it's a bug in asss or you're corrupting the internal state somewhere else in your code.
_________________
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
tcsoccerman
Server Help Squatter


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

PostPosted: Tue Jul 03, 2007 12:14 pm    Post subject: Reply to topic Reply with quote

I'm also adding a command to warp to the hill, and had to use mapdata to make sure the player can warp there w/out being warped back to spawn point because of a tile. i do this:

int tile = map->GetTile(p->arena, ad->x, ad->y);

and that line crashes as3 INGAME.

look in mapdata.h for info on it.
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: Wed Jul 04, 2007 11:35 am    Post subject: Reply to topic Reply with quote

The first issue, SendUpdates() can't be called if you hold the player lock. You only need to call it once anyway, do it after the loop and after the unlock().

The second one, you may want check the coordinates are valid before calling GetTile. They may be set to -1,-1 if the game isn't currently running or hasn't loaded yet.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
tcsoccerman
Server Help Squatter


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

PostPosted: Wed Jul 04, 2007 11:51 am    Post subject: Reply to topic Reply with quote

i think i found the problem. i forgot the

mm->getinterface

and

mm->releaseinterface

it still doesn't work though..




take a look

halo_hill.c - 19.4 KB
File downloaded or viewed 54 time(s)
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
tcsoccerman
Server Help Squatter


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

PostPosted: Thu Jul 05, 2007 10:21 am    Post subject: Reply to topic Reply with quote

I have fixed it by myself icon_smile.gif (*dr.brain*)
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
tcsoccerman
Server Help Squatter


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

PostPosted: Thu Jul 05, 2007 11:32 am    Post subject: Reply to topic Reply with quote

Ok, i'm trying to notify the player when they spend money on this item, so i do this coding:

game->WarpTo(p, ad->x, ad->y);
chat->SendMessage(p, "Warped to %i, %i for %i dollars :)",ad->x, ad->y, price);
chat->SendMessage(p, "Tiles 1,2,3,4= %i, %i, %i, %i",tile[1],tile[2],tile[3],tile[3]);


why is it that the player is warped, but the message is never sent?
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 Jul 05, 2007 2:35 pm    Post subject: Reply to topic Reply with quote

Looking at your code from a few posts back there are some corrections you can make:
- WarpTo takes a Target parameter, not a Player (lines 561 and 567).
- You're still using SendUpdates inside the player lock (line 334).
- The command "hillwarp" needs unregistering when the module detaches.
- You should put something in the comments at the top that you have edited this file from the original. You probably also want to change the info_halo_hill string (line 658).
- Your tile coordinates don't match up, in one place you are warping to x+4,y-3 but put x+4,y-4 in the chat message. If it's supposed to be like that add some comments to the code explaining why.
- Most people use %d instead of %i.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
tcsoccerman
Server Help Squatter


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

PostPosted: Thu Jul 05, 2007 2:38 pm    Post subject: Reply to topic Reply with quote

Ty for responding smong. I did some stuff w/ friends and forgot to reply back that i got it to work.
-Fixed already
-Will fix, even though it works right now.
-Already fixed
-Will do
-Noticed that earlier, will fix.
-I've always used %i, what's the difference?
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 Jul 05, 2007 2:57 pm    Post subject: Reply to topic Reply with quote

I think %d and %i do exactly the same thing. Typically if you edit someone elses code you use their conventions to give it a consistent look.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
tcsoccerman
Server Help Squatter


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

PostPosted: Thu Jul 05, 2007 8:34 pm    Post subject: Reply to topic Reply with quote

Ok, what's the quickest way to find all the players within the hill. is there a "for" statement that would work best? i'm looking at mapdata.h and i don't really see anything for larger areas. i'm 99% sure you can't make elvl regoins in-game....what do you think?
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 Jul 05, 2007 9:12 pm    Post subject: Reply to topic Reply with quote

There's already code in the timer function that does that using a for loop, just copy/paste it then edit it.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
tcsoccerman
Server Help Squatter


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

PostPosted: Thu Jul 05, 2007 9:14 pm    Post subject: Reply to topic Reply with quote

oh....i'm stupid. ty again. where would i be w/out you......(do me a favor and don't answer that).
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
cmdrpinksock
Novice


Age:43
Gender:Gender:Male
Joined: Dec 05 2008
Posts: 43
Location: Fort Worth
Offline

PostPosted: Sun Dec 14, 2008 7:44 pm    Post subject: Linux version Reply to topic Reply with quote

where can I get the linux version?
Back to top
View users profile Send private message Add User to Ignore List
tcsoccerman
Server Help Squatter


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

PostPosted: Sun Dec 14, 2008 7:49 pm    Post subject: Reply to topic Reply with quote

for linux your gonna have to compile a .so. I can't help you their but you could ask your host, or if you are your own host/run a linux machine, to compile the same .c file. I'm not very familiar with linux, at least not enough to tell you how to do this.
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
cmdrpinksock
Novice


Age:43
Gender:Gender:Male
Joined: Dec 05 2008
Posts: 43
Location: Fort Worth
Offline

PostPosted: Sun Dec 14, 2008 7:51 pm    Post subject: Compile for linux Reply to topic Reply with quote

Ok, thanks.... does anyone know how to compile this?
Back to top
View users profile Send private message Add User to Ignore List
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: 692 page(s) served in previous 5 minutes.

phpBB Created this page in 0.755453 seconds : 51 queries executed (94.1%): GZIP compression disabled