CTF Flag behaviour and .script


(sdark) #1

Hi guys, I’ve been looking at the scripts and trying to find a way to change the flag behaviour, but I’m out of ideas.

Here’s what I want to do:

1st: Make a mutual objective - Both teams can grab the same goldbar and have to take them to different places.

I kinda solved this by placing two CTF flags (red and blue) on the same place, but this makes the gold weird, cause there’s always one gold left, for the first team. I thought of doing a script to disable the other team flag when one of the teams grabs the gold, but haven’t figured out how to do this. Still a bit of research to do…

2nd: Make the flag holdable by both teams - This should make the map more real.

Instead of automatically returning the flag to the original place, if the other team grabs a dropped bar, the player should grab it and return it to the original place or waiting a couple of seconds holding it, instead of “instant return” to the origin.
As an example, in radar, if allies drop a radar part, the axis have to return it to the radar, but in a time basis system, to prevent grabing the part and never return it to origin, or hold to it and hide (you get the picture). If the defending team holds the bar for more than like 30 sec and never return it, then it would be automatically returned to the origin.

3rd: Is there any way to make a trigger change environmental behaviour?

Example a switch or trigger to change the speed or gravity of the game or other variables that would affect directly the gameplay, kinda like the recharge_time and game_time we often see with comand posts, and objectives.

Any tips would be appreciated.


(nUllSkillZ) #2

Theoretically it should be possible to set the state of every entity that has a scriptname wit the “setstate”-scriptaction:


ENTITY_SCIPTNAME
{
	// ...

	trigger default
	{
		setstate default
	}

	trigger underconstruction
	{
		setstate underconstruction
	}

	trigger invisible
	{
		setstate invisible
	}

	// ...
}

  1. [li]You could add an additional “misc_model”- or “misc_gamemodel”-entity of the goldbar.
    [/li]Set the state of this model to default and the state of the “team_CTF”-flag entities to invisible.
    Then add two “trigger_multiple”-entities (one for each team).
    Should be small.
    For example if a player of the allied team enters the “trigger_multiple”-entity set the state of the “model”-entity to invisible and the state of the appropriate “team_CTF”-flag-entity to default.
    In addition you could set the state of the other “trigger_multiple”-entity also to invisible.
    So only one team can take the golbar (the team that enters the trigger zone as first team).
    If the goldbar is returned or captured set the state of the needed entites (model, trigger_multiples) to default and of the not needed entites (team_CTF-flags) to invisible.

    Another additional idea:
    Add a visual indication to the goldbar.
    For example take the underconstruction texture and color it blue / red.
    Copy the underconstruction-shader and change it according to your new texture.
    Make two brushes (scriptmover) around the goldbar.
    Color one red the other one blue.
    And set the state of these scriptmovers also through the “trigger_multiple”-entites.
    [li]
    [/li][li][script] event- / action-list
    [/li]
    //================= cvar <cvarName> <operation> <value> // Operation can be any of: // inc // abort_if_less_than // abort_if_greater_than // abort_if_not_equal // abort_if_not_equals // abort_if_equal // abort_if_equals // bitset // bitreset // abort_if_bitset // abort_if_not_bitset // set // random // trigger_if_equal // wait_while_equal //=================

    You have to know the cvar you want to change.
    Not sure if all of the above actions are working.
    I think the playtime of a map can only be changed by increasing the time with 1 minute steps.
    For example if you want to increase the time by 5 Minutes you would have to add 5 lines of:

    cvar <cvarname> inc 1

(Jaquboss) #3

for example gold crates or radar parts are using same code as Q3 Flags … However there isnt CTF gametype …
And while mappers will not be interested it is useless to code it…


(nUllSkillZ) #4

?

Loffy has created a CTF-ET map ( Darji 2 (Final)).
And Shuster_Lang also as far as I remember (not sure about the name of the map in the moment).
And all the “steal the objective” maps are in some case CTF maps (one sided).


(Loffy) #5

Yeah ctf maps rock. Hey, sdark, great ideas. Hope you get the chance to develop something cool!
When you place team_ctf_redflag (or team_ctf_blueflag) in a map, remember that that entity should not have a targetname. Only a scriptname.
The 1st team_ctf_redflag in my map Loffys_ctf_prefab has only the key scriptname and the value axis_1nd_flag, no targetname. If you use a targetname, the entity will not work properly. This is a well known and annoying feature. It is discusses by, among others, the mapper Drakir in this forum somewhere.

I recommend that you take a look at my Loffys_ctf_prefab, since it is a CTF prefab with .map file and all. It is a playable map, but I put it together primarely as a ctf prefab for other mappers to use when making new ctf maps. You will find the map here:
http://www.acc.umu.se/~loffy/mapping/maps/loffysctfprefab/loffysctfprefab.htm

Good luck!
//Loffy


(Jaquboss) #6

Yeah m but do you really think that anyone will create maps for only mod ?


(nUllSkillZ) #7

You don’t need a mod.
It’s in the stock game already.
You only need some mapping skills to create CTF-type maps.


(Jaquboss) #8

Well like for variable score ( some scorelimit cvar ) , and having real CTF , with own ui and so ? That needs mod , like powerball…


(sdark) #9

Yeah m but do you really think that anyone will create maps for only mod ?[/quote]

Actually I don’t think that is a problem. There are a couple of maps that were initially designed for CTF and were adapted for mods. I remember the map Silly_CTF that was modified for Powerball mod.

But the main Ideia of CTF, as stated by nUllSkillZ, all the objective style maps, are actually CTF maps, the main difference is that you have different goals instead of point-score type. You score, you advance the “next level” of the map.

nUllSkillZ about that time thing, I think there are other ways of doing it, I’ve seen it on the map fun-fortress. You advance and receive time awards, but haven’t looked at the script file yet. That cvar thing helps a lot :slight_smile: I’ll be playing around with those in my freetime :clap:

Thanks for all the tips, I’m still at noob mapping :stuck_out_tongue: but I try to mess around a bit in my freetime. Hopefully I’ll finish the mini map I’m developing, just for kicks :stuck_out_tongue: and add a couple of features stated here.

About the 2nd thing, any ideas? or isn’t doable without using mods?


(Lanz) #10

Well like for variable score ( some scorelimit cvar ) , and having real CTF , with own ui and so ? That needs mod , like powerball…[/quote]

Erhm /me steps in for some pimpage…

My mod ET Domination (old name was Powerball) now have a CTF mod fully functioning with assist scores etc working as a normal ctf mod should. And of course an improved Powerball gametype. Soon to be released… :slight_smile:


(Jaquboss) #11

Oh so good luck , lets see if mappers will hear it …


(Lanz) #12

Doesnt matter to me, I make my own ones for it anyway. :slight_smile: And with the etpro like entity create script command I’ve implemented it’s damn easy to just make a script for any custom map. But ofc I welcome anyone to make a map for the mod, some has already done a couple of powerball maps so it’s not that hard to get people to map for mods.

edit:
“Actually I don’t think that is a problem. There are a couple of maps that were initially designed for CTF and were adapted for mods. I remember the map Silly_CTF that was modified for Powerball mod.”

Well since Silly_CTF is my map, and Powerball is my mod, it might not be the best example in this case, but I get your point. :slight_smile:


(Jaquboss) #13

hmm I am also preparing a little mod which will be succesful if anyone will make maps… ( Because there is only 1 map ever which fit it a bit from all existing maps )


(Bondo) #14

Deleted by Bondo

Sorry, been working on my new acrylic case and not looking at web posts.

Sorry, this is from my wonderful 28.8k connection that went nutz trying to post this.

Very sorry for the inconvienence!


(Bondo) #15

Deleted by Bondo

Sorry, been working on my new acrylic case and not looking at web posts.

Sorry, this is from my wonderful 28.8k connection that went nutz trying to post this.

Very sorry for the inconvienence!


(Bondo) #16

Deleted by Bondo

Sorry, been working on my new acrylic case and not looking at web posts.

Sorry, this is from my wonderful 28.8k connection that went nutz trying to post this.

Very sorry for the inconvienence!


(sdark) #17

Didn’t knew it was your map :), anyway the idea is there, only needs a bit of inspiration :clap:

I’ll be around trying to solve the mysterys of mapping :D, who know’s if I get an idea for something playable.

PS: Glad to hear your mod is back, it’s probably the best team-mod I’ve ever played, it was fun like hell :P.
PS2: I was wondering, if the ball in this new version can interact with other entities, like to make cannons, send it in a pipe and get it on the other side, things like that…


(Lanz) #18

Hmm, you actually gaved me an idea there, thanks again… :slight_smile:

But no, nothing fancy like that atm, but it is affected by grenades, artillery and airstrikes.

And Bono you bonehead, posting a raw map file straight in the forum wasnt the best idea I’ve seen… :angry:


(Ifurita) #19

well, two people quoting it didn’t really help either.


(Lanz) #20

No one quoted it? It’s bondo posting it three times, which I didn’t notice until you mentioned quoting. And it didn’t get worse after we posted here either if that’s what you meant.