zombie_989
  • zombie_989
  • 57.5% (Neutral)
  • Private Topic Starter
17 years ago
i've been having issues with a "capture the flag" map i created...

the "flags" are trucks on either end of the map. hijackers are offensive, terrorists are defensive.

if terrorists cross the blue line, they die (and so does anyone on the line, which is fine. i'd change that if i felt a need).

if a hijacker makes it to the "jail" (a parking lot marked by a tiny hijacker) he dies and two hijackers spawn at his base (so long as the player has less than ten hijackers).

after testing, a buddy of mine borrowed and changed it... i didn't save a copy before we played his modified map. i've re-simplified the terrain.

we hadn't had issues before he borrowed it, and i can't seem to find the issues in the script.

decidedly, i need fresh eyes on it. some of the script notes are out of date. for this, i apologize, but i'm not so sorry that i'm going to fix it. (i know, i should be nicer)

i don't remember, but i think he de-selected the initial spawn disable, so the jails may be useless right now.

also, the game was set to keep units from being stealth, but it's been turned off, as the game is considerably more tactical with stealth.

the issues are:

players starting at position0 can capture their own flag.

if a flag has been captured and then stopped, the next time it is captured, it cannot become unmanned when stopped again. (i have my suspicions, but i'll wait for confirmation on these.)

if either player leaves before a winner has been determined, spawn fills the screen...

Any help would be appreciated. Also if you find more issues, pointing these out would be helpful.

P.S. it's a zero hour map, and not for use with AI. (i hope i haven't left out more...)   Capture the Flag.zip (8kb) downloaded 23 time(s).
Sponsor
Drummin
17 years ago
Sorry, I'm trying to follow your logic.

You start with indestructible flags belonging to PlyrCivilian and then you make them unmanned. OK. I will assume you're putting a unit in the vehicle to capture it. So I assume you are to capture your own flag and then guard it because if the enemy attacks the flag, the flag/unit becomes unmanned and you have to start over. This though was one of the issues you mentioned in that you can capture your own flag. So maybe instead of making the flag unmanned, you should transfer the flag to the player. Otherwise where in your scripting are you transferring the flags to the player?

I'd rethink your flag scripts altogether and Instead of activating your flag scripts with the default "activateSides" script, you might make an ownership check script that would say, IF flag1 belongs to player0, activate the Attacked flag script you have for player0 (FlagStop1.2C). You would then ping between this ownership script and the attacked script saying, IF flag1 has been attacked by player1, then make unmanned etc and enable ownership check script. This way these scripts will be active over and over again.

Other things noted:
Script "KillerWater" has a condition of True and a unit check. This should be one or the other.

At this point there are no teams set besides the default teams. I would suggest spawning Named units to teamPlyrCivilian then on the next script line transfer the unit to the same player you are using in the condition check. Just creating teams called "teamplayer1" for example won't transfer the unit to that player. I also don't think you can spawn a unit to a team that doesn't exist or at least I don't think so.

I believe this had been experimented with and you could spawn to teamplayer0 as this is the default player in the game, but other team/players (teamplayer1, teamplayer2 etc) didn't work. If you're sure you've got units spawning to and belonging to players other than player0 correctly using this method, we'd like to know about it.

You could try creating teams under PlyrCivilian called "teamplayer0" and "teamplayer1" and have a script to transfer this team to the player. But really I don't have any idea if that will work without further testing.

I really think the overall concept of capturing the flag vehicle taking it across the "state line" is cool.
zombie_989
  • zombie_989
  • 57.5% (Neutral)
  • Private Topic Starter
17 years ago
sorry about that, drummin...

the logic is this:

your terrorists are to guard a stationary flag. you cannot own it.
it becomes owned by the player who captures it with their hijacker, but because it is to remain immovable by the team on whose side it originates, i have scripted the unmanning and transfer back to playercivilian.

this is why it is a problem that the player starting on 0 can own it.

i've made the flags indestructible because i'm using terrorists to un-capture it, and wish for it to remain at the furthest place to which the capturing player was able to take it.

please run the game. you will see that teamplayerX DOES exist and is used to spawn unnamed units on players0-3. (it's like the player0, not an available option, but it does the job.) the unit spawn isn't listed as an issue, as we've been playing the game successfully...

the whole intent behind the activateSides script is to determine which flag is capturable by whom, which jails may be activated by whom, and in which zones the terrorists must remain (though i will admit, the last one was sheer laziness, as i should have created a trigger zone called something like "no-go zone" or "line" or something).

i guess another way to have done it is to have the activatesides script spawn a flag by name on the side of the appropriate player (reducing the need for maybe four scripts), having a trigger zone maybe called "line" (reducing the need for two winner determining scripts and two terrorist scripts) and then activating the jail behavior scripts... i guess in retrospect, that's the way i SHOULD have done it... but it was my first script in a long long time...

i should maybe also mention this map will cause a crash when played against AI...

thanks, Drummin, for calling my attention to a few of these...

but yeah, i've been successfully using teamplayer1, teamplayer2, and teamplayer3 for a while now to spawn and transfer.

Drummin
17 years ago

i've been successfully using teamplayer1, teamplayer2, and teamplayer3 for a while now to spawn and transfer.


For AI players?
I tried playing the map with an AI player and it crashed. I will test on a new map so there isn't any other complications to see.
zombie_989
  • zombie_989
  • 57.5% (Neutral)
  • Private Topic Starter
17 years ago
sorry, i forgot to mention in the original post that this map is for multiplayer non-AI only... as it causes crashes with AI...

i've had the teamplayer1 work with AI early on in this script, but i made a bunch of changes all at once, and didn't know what started causing crashes...
Drummin
17 years ago
Yes, I've found this type of spawning to crash the game as well and because I want any map I make to work in all modes of play, I've opted not to use this method. BUT it is good to know that you could use this type of scripting for human only maps. Thanks for bringing this to our attention!
zombie_989
  • zombie_989
  • 57.5% (Neutral)
  • Private Topic Starter
17 years ago
Success!

I've revamped my CTF map to be playable in skirmish mode. It's been re-attached on the original post of this thread.

Now i just have to figure out how to impress upon AI the importance of capturing the flag, and the strategy by which it may be done... guess i'll have to use named units. (i've been avoiding it, actually. could you tell?)

I still have an issue, though:

If a flag has been captured and then attacked, the next time it becomes captured by the team that's supposed to be trying to capture it is the final time (that is, it won't unman). Any ideas? i'm thinking that maybe a terrorist exploding on or in the vicinity of the flag doesn't count as an "attack..." (it seems as though the only reason it's unmanning is that it's being *entered* by a terrorist. what do you think?)
Drummin
17 years ago
I think instead of having your flags scripts set to No Deactivation you should ping one script to the next. So on the action side of FlagStop1.1, this script would also activate FlagStop1.2. And then again, FlagStop1.2 would reactivate FlagStop1.1. So on the ActivateSides Script, I'd just activate the first script then ping from then on, with each script deactivating when the condition is met.
zombie_989
  • zombie_989
  • 57.5% (Neutral)
  • Private Topic Starter
17 years ago
ohhh, yeah... sorry, didn't catch that the first time...

i'll re-upload when i've got that worked out. might set named hijackers & terrorists so AI can have a bit more "i."