Server Help

ASSS Custom Projects - regiontriggers

Smong - Tue Apr 10, 2007 5:58 pm
Post subject: regiontriggers
Latest version 1.1a:

I've made a new trigger module using regions (old one).

This module will perform certain actions when players enter and leave regions. Actions include: messages, sounds, shipreset, prizing, warping and object toggling. Actions can be targeted at: player, arena, player team, enemy teams.

There is also an option to toggle objects on when players enter the arena, this can be used to initialise "roof lvz" to be on or for something as simple as a newsbox/help.

Some of you may notice this sort of module will become redundant when asss supports python embedded in maps.

Code: Show/Hide
; set this as low as 20 to get better response times
RegionCheckInterval = 50

TriggerN-RegionName = regionname

; the following are all optional
TriggerN-EnterMessage = enter
TriggerN-LeaveMessage = leave
TriggerN-EnterSound = 0
TriggerN-LeaveSound = 0
TriggerN-EnterShipReset = 0
TriggerN-LeaveShipReset = 0
TriggerN-EnterPrize = prize [, count]
TriggerN-LeavePrize = prize [, count]
TriggerN-EnterWarpTo = x, y
TriggerN-LeaveWarpTo = x, y
TriggerN-EnterObjon = 0
TriggerN-LeaveObjon = 0
TriggerN-EnterObjoff = 0
TriggerN-LeaveObjoff = 0
TriggerN-Target = 0 (0=player, 1=arena, 2=player team, 3=enemy teams)

; use this to toggle ServerControlled objects on when a player enters an arena
; this is useful if you are simulating roofs of buildings
InitialN-Objon = 0

There is a sample arena in the package.

It would be nice to expand on this and also provide a GUI to make editing the settings easier. Something like the starcraft triggers explained here:
tcsoccerman - Tue Apr 10, 2007 6:38 pm
Post subject:
For some reason it isn't working for me, it being the aexample arena...

It loads the map, but not any lvz..
Smong - Tue Apr 10, 2007 6:47 pm
Post subject:
Ok, to test the arena copy the folder called "arena" to asss's arenas directory. Then rename it to something like "demo". Then copy the dll to the bin directory, add "regiontriggers:regiontriggers" to the bottom of modules.conf and restart the server.

Assuming you've done all that when you enter the arena you should see 1 lvz saying "can't touch this". This lvz disappears when you fly into a certain box. Another lvz will only appear if fly into another certain box.
tcsoccerman - Tue Apr 10, 2007 7:27 pm
Post subject:
i got the sounds and prize and warp working at least...lvz aren't showing up though. that's nothing i have to worry about, cause i can do lvz right anyways. great , great, great, great, module icon_smile.gif
Smong - Tue Apr 10, 2007 8:14 pm
Post subject:
I just remembered, the objects module isn't listed in modules.conf by default. You need to add it in. My module should have printed a warning message that it couldn't find the objects module.
tcsoccerman - Wed Apr 11, 2007 9:33 pm
Post subject:
When using this module, can the regions you use be made through dcme? or must they be custom? i know it's working because on asss.exe(or asss.bat, what ever it is), it says

W <regiontriggers> {0} region missing: sound
D <regiontriggers> {0} 1 triggers read

but i made a region in dcme called sound. any ideas?
Smong - Thu Apr 12, 2007 2:46 pm
Post subject:
Interesting, I actually used DCME 3.1.1 to make the demo map so it should work.

- Either you edited the wrong file (easy mistake in dcme with all those autosave options).
- You saved it to the maps folder, but asss is still using the one in arenas/demo folder.
- You forgot to copy the edited file back to the arena's folder (only happens if you save your maps to a different directory before editing them).
tcsoccerman - Thu Apr 12, 2007 6:56 pm
Post subject:
i didn't do any of the above. i also made a new map, maybe the elvl in the map was corrupt. still got that problem. i am using 3.1.3..... i'll try to find 3.1.1, but be best if it was compatible with .3 too..

Edit: ok, i attemted to make "setship" trigger. Here i'll post it.[/i]
Samapico - Thu Apr 12, 2007 7:35 pm
Post subject:
I don't think 3.1.1 and 3.1.3 are any different eLVL-wise... To know if your elvl data is corrupt, just save it, close the map, reopen it, everything should still be in place
Smong - Thu Apr 12, 2007 9:03 pm
Post subject:
That's an amazing attempt at editing my module, only thing you need to do is add "short setship;" to the end of "struct action_t" which is near the top of the file. After that fix your compile errors and it might just work.

Hint: game->SetShip uses 0-7, but in the .conf file they will be 1-8 so you need to add -1 somewhere.
Animate Dreams - Thu Apr 12, 2007 11:18 pm
Post subject:
Actually, doesn't SetShip use 0-8, 8 being the spec ship?

And instead of using the actual number, I suggest checking out defs.h(in include), and looking at the enums. You just use something like SHIP_WARBIRD in place of the actual ship number.
Smong - Fri Apr 13, 2007 7:49 am
Post subject:
Don't confuse him! One step at a time.
tcsoccerman - Sat Apr 14, 2007 12:44 am
Post subject:
i get it icon_surprised.gif

smong:can you fix my "amazing attempt" with what you said. it seems like you could do that easily, and i can't.

btw, my elvl isn't corrupt. so, none of you help has worked yet :\.
tcsoccerman - Sat Apr 14, 2007 1:04 am
Post subject:
Code: Show/Hide
RegionCheckInterval = 20

Trigger0-RegionName = ship
Trigger0-EnterMessage = You now are in the shark!
Trigger0-EnterSound = 34
Trigger0-EnterSetShip = 7
Trigger0-Target = 0

there's some more to work with..not nothing i see though. added target thing because it wasn't working normally. i'm guesing default is 0 but you never know.
Smong - Sat Apr 14, 2007 9:45 am
Post subject:
Ok here's an update with SetShip and IncShip actions.
Code: Show/Hide
; SetShip: use 1-8 (wb-shark), 9=spec
TriggerN-EnterSetShip = 0
TriggerN-LeaveSetShip = 0
; IncShip: if positive, ship will be incremented
; example: IncShip=1, warbird enters and gets set to javelin, javelin enters and gets set to spider, etc
; example2: IncShip=2, warbird -> spider, javelin -> leviathan, etc
; if negative ship is decremented, shark -> lancaster, etc
; this will not spec players and you can't decrement less than warbird
TriggerN-EnterIncShip = 0
TriggerN-LeaveIncShip= 0

tcsoccerman - Sat Apr 14, 2007 10:33 am
Post subject:
Since i can't get it to work, see if you can. I'll post the map and you just make a region, and a region trigger.conf data, and give it back. plz of course.
Smong - Sat Apr 14, 2007 2:11 pm
Post subject:
Ah ok I think the problem may be because you have a 24bit tileset. The public version of asss doesn't support that yet. I'm uploading a fixed version of the mapdata module so you can continue to use your tileset.

Update regiontriggers.dll then look for "mapdata" in modules.conf and change it to "regiontriggers:mapdata".

Edit: Yes 0 is the default target, it doesn't matter if you write it into the conf or not.
tcsoccerman - Sat Apr 14, 2007 2:23 pm
Post subject:
Bravo!BRavo!did you make that mapdata.c thing? it looks complicated. anyway, last problem. have them change ships, but keep their position, or maybe be able to change position. nvm, i can do this with autowarp thing. ty gj. no more problems.
tcsoccerman - Sat Apr 14, 2007 3:31 pm
Post subject:
I found an improvement icon_smile.gif. lol, anyways, a way to record what ship they have, the enter a region and change ships, they leave the region and get back in the ship they wre in before. possible?
tcsoccerman - Sat Apr 14, 2007 4:11 pm
Post subject:
when you have you're prizing triggers, with #'s, what is that going by, what does each # correspond with(what prize) ty.
Smong - Sat Apr 14, 2007 4:12 pm
Post subject:
Putting players in the ship they last used, hmm. I think this might be taking a general module too far. It can still be done but you might want to think about making a module just for what you want to do.

And I didn't write the mapdata module, it comes with asss.
Bak - Sat Apr 14, 2007 4:25 pm
Post subject:
prize numbers are here:
Animate Dreams - Sat Apr 14, 2007 8:37 pm
Post subject:
tcsoccerman wrote:
I found an improvement icon_smile.gif. lol, anyways, a way to record what ship they have, the enter a region and change ships, they leave the region and get back in the ship they wre in before. possible?

I'd suggest using playerdata. Here's an example:
Code: Show/Hide
typedef struct ShipData
    int previousShip;
    int currentShip;
} ShipData;

local int playerKey;

When they enter the region, you just take previousShip, and set it equal to currentShip. Then you change their ship, and whatever ship you change it to, you put that value in currentShip. When they leave, change their ship to previousShip, put previousShip equal to currentShip, then update currentShip to whatever you changed their ship to.

tcsoccerman wrote:
when you have you're prizing triggers, with #'s, what is that going by, what does each # correspond with(what prize) ty.

Lol, just check defs.h(in with the other includes), you don't even have to use prize numbers. just use PRIZE_ROCKET or stuff like that. It's very simple. ^^
tcsoccerman - Sat Apr 14, 2007 9:29 pm
Post subject:
what file are those values under?
Animate Dreams - Sat Apr 14, 2007 10:00 pm
Post subject:
Animate Dreams wrote:

Lol, just check defs.h(in with the other includes),

Smong - Sun Apr 15, 2007 6:50 am
Post subject:
I've been holding back on commenting on defs.h, but I just double checked my suspicions and I was right. They don't work inside .conf files. Even when asss-1.3.2 came with conf/defs.h that didn't even mention the PRIZE_* and SOUND_* constants.

I also tried:
Code: Show/Hide
#define PRIZE_BOUNCE 10

; no bouncing bullets inside region (prize 10)
Trigger5-RegionName = prize1
Trigger5-EnterPrize = -10
Trigger5-LeavePrize = $(PRIZE_BOUNCE)
And it only deprizes, never reprizes the bounce. So maybe defines are broken?

After briefly looking at app.c my conclusion is that #define's can only be used with #ifdef's or #ifndef's:
Code: Show/Hide
#define WEEKEND

Kill:JackpotBountyPercent = 1000

#ifdef $WEEKEND
Kill:JackpotBountyPercent = 2000

Edit: This is a known bug: Just got to wait for the cfg overhaul to come.
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group