|
Server Help Community forums for Subgame, ASSS, and bots
|
Author |
Message |
Smong Server Help Squatter
Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Wed Jun 25, 2003 5:15 pm Post subject: Trigger module |
|
|
|
|
I had some spare time today so I knocked this together.
[Trigger]
Area0=x_tile,y_tile,width,height
;The next would be Area1=...
;Asss will keep processing in consecutive order until it reaches 99
; or there is a gap, fx: Area0, Area1, Area3
Dest0=x,y,w,h
;Players are warped to a random location within this area
;If there are walls within the area players will might get
; warped somewhere unexpected
;The following is optional (warp_basic backwards compatibility)
Message0=You've been Triggered(tm)!
;Default is blank/no message
Prize0=0
;0 is no prize
;Negative gun prizes only work if InitialGuns is lower than
; current gun level, same with bombs.
Ship0=-1
;Negative is no change
; 0 is Warbird, 8 is Spectate
Bong0=-1
;Negative is no sound
Team0=-1
;If given, trigger only effects this team
;Negative is all frequencies |
The warp_basic module only has warping (to reduce server load), while trigger_advanced has the prizes and stuff.
It's not completely finished yet, I intend to add lvz toggling (triggered smoke in a realism zone) and brick laying. With the brick layer you could lay traps and stuff (Viet Cong zone?), also people could spawn and shoot out of a box, while enemies can't shoot/fly into the area (or even the dynamic map thing some people have been talking about).
Anyway, the source is included so feel free to play around with it and please post your updates/suggestions (or linux binaries) here.
Edit: Old version deleted.
|
|
Back to top |
|
|
Smong Server Help Squatter
Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Sat Jun 28, 2003 11:53 am Post subject: version 2 |
|
|
|
|
I've recompiled the binaries for 1.0rc1 and added lvz support to trigger_advanced. Memory is handled more efficiently, so you can attach the modules to as many arenas as you like.
Old stuff. wrote: | Ship0=0
;Negative is no change
; 0 is Warbird, 8 is Spectate |
New stuff. wrote: | Ship0=0
;0 is no change
; 1 is Warbird, 9 is Spectate
Lvz0=0
;0 is no lvz, negative is switch off |
windows binary, docs and source
triggers.zip - 17.15 KB
File downloaded or viewed 68 time(s)
|
|
Back to top |
|
|
Mine GO BOOM Hunch Hunch What What
Age:40 Gender: Joined: Aug 01 2002 Posts: 3614 Location: Las Vegas Offline
|
Posted: Sat Jun 28, 2003 1:35 pm Post subject: |
|
|
|
|
Thats something that bothers me still. Why didn't Jeff just make the spec ship always be 0, instead of keeping it the highest number?
When i made my own bot core (which did fail, too unstable at times, didn't have time to re-write it), i liked the idea of specs being 0, ships being numbers. But when your working with the server, which keeps everything like the packets, i'm unsure if you should switch it around. Most of the sysops of zones will think like the client (1-8 = ships), but the programmers will think like the server (0-7 = ships).
By the way, you going to try to make this as advanced as like it is with Starcraft/Warcraft? To include other triggers, such as deaths, flags, etc?
Could i recommend you using a linked list, so you can have unlimited triggers? Plus, it keeps memory sizes smaller when you only use like 2 triggers.
|
|
Back to top |
|
|
Smong Server Help Squatter
Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Sun Jun 29, 2003 12:44 pm Post subject: |
|
|
|
|
Unlimited triggers is possible (100 per arena ATM), but it checks every 80ms for player positions so I don't think you would get away with no lag (unless you have a really fast computer, but that's cheating).
I've never played Starcraft/Warcraft so I wouldn't know about their triggers. I think triggers on flags really deserves its own flag gametype. Triggers on deaths would require extra code so they only occur after the respawn delay. What I would really like is a non-repeating trigger that doesn't require a warp.
I would imagine less than half the allocated space for each trigger is being used. I thought using a struct with all the trigger's data would make it easy to add new actions and to cleanup afterwards.
If you can explain your linked list method a bit more I will probably add it in at some point. Maybe a callback would be better so that people can easily add their own actions?
typedef void (*TriggerFunc)(Player *p, int trigger);
|
|
Back to top |
|
|
Mine GO BOOM Hunch Hunch What What
Age:40 Gender: Joined: Aug 01 2002 Posts: 3614 Location: Las Vegas Offline
|
Posted: Sun Jun 29, 2003 5:56 pm Post subject: |
|
|
|
|
Correct me if i'm wrong, but i believe most collision detection systems in games work by splitting walls into groups, so it would be like a sparse array. So instead of checking every trigger for every position, you would do a bit of work before hand. Say you divide the map into a 10x10 block, and when loading arrays, you load them into linked lists inside each block. So that way, whenever you need to check a person's triggers, you can first do a simple check to see if that one block out of the 100 has any data in it. If so, can check those (or make another sparse array under that to check) to see if any of them match. Better than having 100 triggers all over the map, and check them vs every player every 80 ms. I believe the current method for storing map tiles is setup like this, can take a look at that.
As for linked lists, its pretty simple, since Grelminar set it up already inside the util.c for anyone to use. Most of the modules use them heavily to store data, take a look around it for some good examples.
|
|
Back to top |
|
|
Smong Server Help Squatter
Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Tue Oct 14, 2003 1:18 pm Post subject: |
|
|
|
|
I've been working on a better version of my trigger module, but it's not doing what it should do. My test code is supposed to say in the chat the name of the sector you are in (assigned from .conf).
I can enter the arena with the module attached, then when I type stuff or try to change ship it appears in the server console, but nothing happens in game. After a little while ctm says disconnected (no data). Can someone please look at the code and try to figure it out?
I would consider using the already existing region code in ASSS, but I am unsure of it's real purpose (soccer goals?) and of the file format.
source and sample map/triggers.conf
sector_names.zip - 7.3 KB
File downloaded or viewed 53 time(s)
|
|
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: 880 page(s) served in previous 5 minutes.
|