objectiver / trigger dropped


(Zer0Cool) #1

Hi,

when my objective is dropped, because the catcher died somehow, i want it to dissappear and to get immediately, so without getting returned by enemy, back to where it was stolen from. Is this possible?

Zer0


(Flippy) #2

There is one way you can ‘fake’ this, but afaik you can only use it in areas where players can’t get without dying, for example in a death pit or something like that.

To avoid the obj staying at the bottom of the pit for 30 seconds, where nobody can get it, you need to create another trigger_flagonly_multiple entity at the bottom of the pit, but before the place where the players get killed.
You will also need to set the ‘count’ of the objective entity to a large number.

When a player with the obj runs into the death pit, before they die, they ‘score’ the objective in the second goal. However, in the script for that second goal, you don’t reward any points or whatever, but instead, you play a voicemessage saying that the objective has been returned.
This will not end the round, not complete the obj or anything, it will just ‘destroy’ the objective, and create a new one at the starting point.

As long as the count in the obj entity is high enough so you won’t run out of objectives, nobody should notice.

Troy and I used this in our map, CTF_Face_b1. If you fall off the comet, the objective is returned instantly without rewarding points.

But this will obviously not work for an entire map, since you need to be able to place the goal somewhere players don’t usually get to. If you are going to put it around your map you can’t even pick up any objectives since they will be returned instantly.


(kamikazee) #3

I remember the discussion from ctf_face, but I can’t recall why the common
odrop texture didn’t work…


(Zer0Cool) #4

Thank you for the fast reply. It should be for the entire map so it wouldnt work :slight_smile:
One point that i didnt get is how do you control when the objective spawns?
when I use the count function the next objective spawns imediately when i steal one, so it cant be used as “being” the same objective because i would have a lot of them at the same time in the map.

Zer0


(kamikazee) #5

I believe you can set the flag count to 1 and then use setstate to hide the objective spawner when no more items should be spawned (this can be controlled from the “item captured” part of your script).

Now I only wonder if objectives automatically respawn when the count is set to “1”. Maybe you might need to trigger the spawner in that case using the alertentity command.

At any rate, don’t feel intimidated by scrolling through someone else’s map scripts to know how they did it. Learning from someone else’s work is not illegal, only making a copy is.


(Flippy) #6

This is the ‘fake goals’ part of the script from ctf_face:

// FAKE GOALS - to return flag when someone falls of map
alflag_fakegoal
{
	death
	{
		setstate allied_flag default
		setstate allies_cap_flag default
		wm_teamvoiceannounce 0 "ctf_face_blueflagreturned"
		wm_teamvoiceannounce 1 "ctf_face_blueflagreturned"
		wm_announce "^4Blue flag returned!"
	}
}

So as soon as a ‘fake goal’ has been scored (flag dropped into space), the ‘allied_flag’ (the actual obj entity) and ‘allies_cap_flag’ (the trigger_flagonly_multiple where allies must score) are set to ‘default’.
As soon as a flag is stolen, they are set to invisible, so you can’t take two objectives at the same time.

I’m pretty sure the count was 99999 or something like that. It is all controlled via the setstate commands.


(Zer0Cool) #7

I will test it out, thanks.
I read in another topic that in Ifurita’s map “Tactical” is a object that disappears very fast. Anyone knows where I can find this map? All sites I found were down. :S

Edit: setsate invisible doesnt work. It doesnt matter in what part of script I try, i cant set the team_CTF_red/blueflag invisible. You are sure i can setstate the flags?

@ Flippy why do you set the trigger_flagonly_multiply default? why should it be invisible before?
and in what part do you set the flag invisible?

… ok ok :slight_smile: i had a look on your script. if I understand right, you just can capture the flag when the other team has none. thats the reaso for the setting default. and the setstate works now … i forgot the wait at the beginning of my spawn part :S


(Wezelkrozum) #8

Zer0Cool. There are 2 ways to make something invisible/visible:

  • use the setstate command ( setstate <targetname> invisible/default )
  • use the alertentity command ( alertentity <targetname> )(if a thing is visible it become invisible and if it
    was invisible it become visible)

Not every entity allows these 2 commands. It could be that it only listen to the alertentity command. Or that it listen to the setstate command. So experiment with it on several entities. I can say you that the triggers and the team_CTF_red/blueflag listen to the alertentity-command.

You can activate the speakers with the alertentity-command. Like if you alertentity a speaker it will play a sound (not looped. It loops when you say that in a entity).


(Flippy) #9

[QUOTE=wezelkrozum;174514]Zer0Cool. There are 2 ways to make something invisible/visible:

  • use the setstate command ( setstate <targetname> invisible/default )
  • use the alertentity command ( alertentity <targetname> )(if a thing is visible it become invisible and if it
    was invisible it become visible)

Not every entity allows these 2 commands. It could be that it only listen to the alertentity command. Or that it listen to the setstate command. So experiment with it on several entities. I can say you that the triggers and the team_CTF_red/blueflag listen to the alertentity-command.

You can activate the speakers with the alertentity-command. Like if you alertentity a speaker it will play a sound (not looped. It loops when you say that in a entity).[/QUOTE]

Actually you are not completely right.

The flag entities listen to the ‘setstate’ command, as you can see in the ctf_face script.
BUT because of some bug in the game, the flag entities do not show up in your map if you give them a targetname.
Now, to be able to ‘setstate’ an entity, you need to call it’s targetname (‘setstate <targetname>’) so you need to give your flag entity a targetname, making it invisible in the map.
However, due to a little trick, by using the ‘alertentity <targetname>’ command just once, in the spawn of your game_manager scriptblock, this bug is no longer present and your flag entity behaves normal.

So to make the flag entity invisible, you need to setstate it, not alertentity it. You only need to alertentity it once, at the start, so it shows up in your map.

@Zerocool,
That’s right, the setstating of the ‘goal’ entities is to hide them when a flag has been captured. This simulates the ctf gameplay style of most games, like unreal tournament.

So as long as you are using the alertentity command, possibly after a short wait, you should be alright.
Is it working for you now?


(Wezelkrozum) #10

aha. thanx flippy. I always used that alertentity. I still can learn here something XD


(Zer0Cool) #11

Thank you for the informative replies :slight_smile:
the setstate and the alertentity works fine now … but now i have a new problem ( I started a new topic :S didnt thought about it to add it here)