Requesting a CTF Script and Model/Entity/Trigger Prefabs


(shdizzy) #1

Hi, I have recently completed a beta version of my ctf map. I have been looking for resources/tutorials online on how to script the ctf aspect of the map and I have tried (Ifurita’s returnable objectives, for example) but I was unclear on how make the CTF I’m looking for exactly. If anyone who know about scripting can please help me with this or actually script this for me, I’d greatly appreciate it:

3 ‘flags’ on each side. The flag model itself can be whatever really, preferably gold (as seen in goldrush). 1, or 3 (whichever is easier), return sites on each side for the 3 golds. I would like for each team to be possible to only steal one gold at a time, but if this hard or not possible, it can be more than one at a time. Finally, first team to cap 3 golds wins. So, total: 6 golds, 2 (or 6) return sites, and the script.

I hate to come off as someone who is looking for the easy way out, but I’ve looked around for how to do this and I truly feel it is beyond me to construct that CTF script, entities, etc. If someone thinks otherwise, please redirect me to the resources/tutorials I need. Thanks a lot in advance.


(stealth6) #2

just an idea, but why dont you start off with three gold crates in a line, but 2 are inside a glass case, if the other team successdully captures 1 gold crate then the glass box disappears on the next one… so then they can only catch 1 at a time.

if you do it like that I think there is a prefab out there that works similar but then with flags

EDIT: found the link to that prefab here:
http://www.splashdamage.com/forums/viewtopic.php?t=8335&highlight=ctf+prefab


(shdizzy) #3

Thanks for link. Loffy was actually helpful enough to contact me about that prefab as well. I had actually downloaded it before and looked around, but I wasn’t sure how to translate it to my map. I really do like your idea, which is similar to Loffy’s map, of having only one doc available at a time by basically caging up the others. I imagine that might be easier to script (?) than having them all out in the open but only allowing the capture of one at a time. I will try to work off of that prefab, but I suspect I will be back for help. Thanks again, any more input appreciated.


(-SSF-Sage) #4

I made once a ctf map with 3 grates per team, and only one can be taken at a time. They were done by setsating them invisible, so basicly they weren’t exist until wanted to. Next box pop up when one was captured. I can give you more info if you want to. It’s really sucky map tho but it works. Pm me if you want some stuff.


(Flippy) #5

The basic underlying technique for CTF maps is that you simply use two returnable objectives (like the gold in goldrush) and set the ‘count’ to 3 (or how many flags you want).

This should give you a triple capturable objective, again, the same as in goldrush (only think of 3 crates instead of 2).

Then, the next problem usually is that one team can capture multiple flags at the same time, eg, the second flag is already present as soon as the first flag is taken. To solve this problem, you could ‘setstate’ the capturable entity to ‘invisible’. However, this does not normally work, it messes up and does not show the entity at all.

There is a trick though, which overcomes this problem: When you start your map, in the game_manager spawn event, you have to ‘alertentity’ the capturable entity. From then on, ‘setstate’ will work.


(-SSF-Sage) #6

That’s right what flippy says, that’s how it is in my map. Remember to have atleast 250 wait before alertentity tho!


(shdizzy) #7

Thanks for the input so far. I’m using a modified version of Loffy’s ctf script from his prefab map. I set it up so both transmitters are open at the begining of the map, but they become enclosed in a glass tube if the enemy steals your gold, and the tube disappears if the gold is returned. Their are 4 golds on each side, only one of which is available at a given time. I don’t recall seeing any alertentity feature however. There are simply 3 boxes that seal of the golds that aren’t available and they disappear one by one by the securing of the former gold. So technically they are always there, but you can’t physically touch them since the boxes are in the way.

As a side note, I ran into an issue while beta testing 1v1 with a friend. We were both carrying gold and he killed me, but he couldn’t return the gold that I had just dropped apparently because he was carrying my gold. This never happened if he (or I) was not carrying gold. Is this default to the ctf trigger return (that only a player without gold can trigger this)? If not, any idea if this is a script issue or perhaps something with the map. Any help appreciated.


(-SSF-Sage) #8

I tested it out and I have the same thing. You can’t return an obj if you are carrying one, just like you can’t take another. I guess that’s the way it is. I think it requires a change of code (modders attention) to fix it. Or is there a mapper-friendly way?