Author |
Message |
tcsoccerman Server Help Squatter
Age:32 Gender: Joined: Jan 15 2007 Posts: 694 Location: Atlantis Offline
|
Posted: Sat Jun 30, 2007 4:46 pm Post subject: King of the hill |
|
|
|
|
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 |
|
|
Smong Server Help Squatter
Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Sat Jun 30, 2007 5:42 pm Post subject: |
|
|
|
|
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 52 time(s)
|
|
Back to top |
|
|
tcsoccerman Server Help Squatter
Age:32 Gender: Joined: Jan 15 2007 Posts: 694 Location: Atlantis Offline
|
Posted: Sat Jun 30, 2007 6:34 pm Post subject: |
|
|
|
|
ty!
|
|
Back to top |
|
|
BDwinsAlt Agurus's Posse
Age:33 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Sun Jul 01, 2007 1:17 am Post subject: |
|
|
|
|
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 |
|
|
tcsoccerman Server Help Squatter
Age:32 Gender: Joined: Jan 15 2007 Posts: 694 Location: Atlantis Offline
|
Posted: Mon Jul 02, 2007 10:03 pm Post subject: |
|
|
|
|
smong, can you tell me what is wrong w/ this coding. it crashes as3 IN GAME.
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 |
|
|
Solo Ace Yeah, I'm in touch with reality...we correspond from time to time.
Age:36 Gender: Joined: Feb 06 2004 Posts: 2583 Location: The Netherlands Offline
|
Posted: Tue Jul 03, 2007 2:03 am Post subject: |
|
|
|
|
The indenting, for starters.
|
|
Back to top |
|
|
Animate Dreams Gotta buy them all! (Consumer whore)
Age:36 Gender: Joined: May 01 2004 Posts: 821 Location: Middle Tennessee Offline
|
Posted: Tue Jul 03, 2007 8:19 am Post subject: |
|
|
|
|
Don't you have to use p->p_freq?
|
|
Back to top |
|
|
tcsoccerman Server Help Squatter
Age:32 Gender: Joined: Jan 15 2007 Posts: 694 Location: Atlantis Offline
|
Posted: Tue Jul 03, 2007 8:46 am Post subject: |
|
|
|
|
Ty, i forgot that. it still isn't fixed though :\.
|
|
Back to top |
|
|
tcsoccerman Server Help Squatter
Age:32 Gender: Joined: Jan 15 2007 Posts: 694 Location: Atlantis Offline
|
Posted: Tue Jul 03, 2007 8:58 am Post subject: |
|
|
|
|
Here is as3 when it crashed:
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:
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 |
|
|
Cyan~Fire I'll count you!
Age:36 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Tue Jul 03, 2007 9:23 am Post subject: |
|
|
|
|
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 |
|
|
tcsoccerman Server Help Squatter
Age:32 Gender: Joined: Jan 15 2007 Posts: 694 Location: Atlantis Offline
|
Posted: Tue Jul 03, 2007 12:14 pm Post subject: |
|
|
|
|
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 |
|
|
Smong Server Help Squatter
Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Wed Jul 04, 2007 11:35 am Post subject: |
|
|
|
|
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 |
|
|
tcsoccerman Server Help Squatter
Age:32 Gender: Joined: Jan 15 2007 Posts: 694 Location: Atlantis Offline
|
Posted: Wed Jul 04, 2007 11:51 am Post subject: |
|
|
|
|
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 |
|
|
tcsoccerman Server Help Squatter
Age:32 Gender: Joined: Jan 15 2007 Posts: 694 Location: Atlantis Offline
|
Posted: Thu Jul 05, 2007 10:21 am Post subject: |
|
|
|
|
I have fixed it by myself (*dr.brain*)
|
|
Back to top |
|
|
tcsoccerman Server Help Squatter
Age:32 Gender: Joined: Jan 15 2007 Posts: 694 Location: Atlantis Offline
|
Posted: Thu Jul 05, 2007 11:32 am Post subject: |
|
|
|
|
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 |
|
|
Smong Server Help Squatter
Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Thu Jul 05, 2007 2:35 pm Post subject: |
|
|
|
|
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 |
|
|
tcsoccerman Server Help Squatter
Age:32 Gender: Joined: Jan 15 2007 Posts: 694 Location: Atlantis Offline
|
Posted: Thu Jul 05, 2007 2:38 pm Post subject: |
|
|
|
|
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 |
|
|
Smong Server Help Squatter
Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Thu Jul 05, 2007 2:57 pm Post subject: |
|
|
|
|
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 |
|
|
tcsoccerman Server Help Squatter
Age:32 Gender: Joined: Jan 15 2007 Posts: 694 Location: Atlantis Offline
|
Posted: Thu Jul 05, 2007 8:34 pm Post subject: |
|
|
|
|
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 |
|
|
Smong Server Help Squatter
Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Thu Jul 05, 2007 9:12 pm Post subject: |
|
|
|
|
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 |
|
|
tcsoccerman Server Help Squatter
Age:32 Gender: Joined: Jan 15 2007 Posts: 694 Location: Atlantis Offline
|
Posted: Thu Jul 05, 2007 9:14 pm Post subject: |
|
|
|
|
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 |
|
|
cmdrpinksock Novice
Age:43 Gender: Joined: Dec 05 2008 Posts: 43 Location: Fort Worth Offline
|
Posted: Sun Dec 14, 2008 7:44 pm Post subject: Linux version |
|
|
|
|
where can I get the linux version?
|
|
Back to top |
|
|
tcsoccerman Server Help Squatter
Age:32 Gender: Joined: Jan 15 2007 Posts: 694 Location: Atlantis Offline
|
Posted: Sun Dec 14, 2008 7:49 pm Post subject: |
|
|
|
|
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 |
|
|
cmdrpinksock Novice
Age:43 Gender: Joined: Dec 05 2008 Posts: 43 Location: Fort Worth Offline
|
Posted: Sun Dec 14, 2008 7:51 pm Post subject: Compile for linux |
|
|
|
|
Ok, thanks.... does anyone know how to compile this?
|
|
Back to top |
|
|
|