How to hide team_ctf_*team*flag? *solved*


(-SSF-Sage) #1

I have this problem hiding team ctf teamflags. I can’t use the setstate targetname invisible, because can’t add targetname to it. :frowning: I also tried gotomarker and put it go to some box outside of the “map” to hide it, but I wasnt able to get it appearing at all, as with the targetname issue. So what to do to hide the thing? Or if i just could set it not cappable for the while? How it would work then? I would rather have it hidden tho. :frowning: The thing is i have three objective, and want only one being able to capture at the time and when you secure it, next will “spawn”. So any help is appreciated! :´(


(.Chris.) #2

You could try blocking access to the other 2 objectives using a script mover and changing the setstate when one has been capped so you can then captured the next one. For example you got objective A, B and C, to begin with you have objective A out in the open but have maybe some kind of ‘force field’ around objectives B and C, when objective A is capped the force field around objective B is removed via setstate in script, once objective B been capped then the force field around objective C is removed.

The force field idea is only an example, you could make it a steel box or something.


(-SSF-Sage) #3

I had something like that in my mind thx. :slight_smile: But im still looking for the invisible thing. :slight_smile: Thanks anyway.

Edit i could use that perhaps, but im still curios to know this thing too. :wink: I think i still prefer the “hard” way.


(RayBan) #4

to make a team_CTF_blueflag or team_CTF_redflag be controllable with
setstate invisible/default, you would need to give them targetnames.

once they have a targetname they will not be visible/usable when the game
starts, so you need to alertentity them in the game_manager spawn.

once thats done, the setstate invisible and default will work on them.


(-SSF-Sage) #5

I know that but there is one but! You can not give them targetnames! Otherwise they will not spawn. That is the reason I posted here. :frowning:


(S14Y3R) #6

Give it a targetname just like anything else…

i just tested this out of curiosity. It does work. in your game_manager spawn use alertentity ctf_flagname(after wait 250) it then becomes visible, and setstates work properly.

-is tested, confirmed to work, try it.


(RayBan) #7

"once they have a targetname they will not be visible/usable when the game
starts, so you need to alertentity them in the game_manager spawn. "

i guess i could have said spawn… but i was hoping that would cover the
reason as to why you give it a targetname.

try it out and see, they will work fine after you alterentity to spawn them.


(-SSF-Sage) #8

Thx!! I guess that might be it! I go and have a try! I can go to fishing just 15 mins later :P. Thanks againg!


(-SSF-Sage) #9

Alertentity doesnt have a “use” function??? I setted them at game_manager. (After wait ofcourse)


(S14Y3R) #10

lol, sry. i meant “to use” alertentity, not a “use alertentity” command.


game_manager
{
	spawn
	{
		wm_axis_respawntime	2
		wm_allied_respawntime	2
		wm_number_of_objectives 1
		wm_set_round_timelimit	30

		wait 250
		alertentity team_ctf_flagname
	}	
}

(-SSF-Sage) #11

I did exactly like that! :S I have another look on it when i come from work. But do i have to set the numbers of objectives? I havent got it setted (im working with accums) on my script and it works (rest of it, obj etc. but not hiding). I might post the whole script if i am not able to get it work. Thanks for the help guys. I appreciate it!

Edit. Hmm I didn’t use 250 for wait, I used 50, but I think it wouldn’t matter that much. I will see that when i get to my own computer.

Edit2 well I think you got it. :stuck_out_tongue: First I say it works but next i say it doesn’t lol. :smiley:


(-SSF-Sage) #12

WOOOT!!! Thank you everyone for help! You were right ppl. I added 200 more wait and it worked like a dream! I see it has to have atleast 250 wait before it’s spawn! Thank you again. :slight_smile:


(Yatta) #13

Hello there !
I have the same problem and was relieved to find a solution in this thread.

However, I read and re-read the messages and there is something I dont get (and the game dont get it either) :

  • Rule 1 : team_ctf_xxxxflag wont appear if it have a targetname
  • Rule 2 : alertentity the team_ctf_xxxxxflag to make it work

Seems simple, but doesnt work for me :
I have 2 team_ctf_blueflag targetnamed “obj_real_ammo” - they dont appear if I do nothing, and the game crashes if I try to alertentity them (“alertentity cannot find targetname”) …

I’ve put the wait 200 thingie in the game_manager script, and thats the first thing to happen in it (wait, then alertentity).

Help ?

:oops:


(-SSF-Sage) #14

If I remember right, I was doing tests back then. I think it didn’t work if it was under 250, won’t swear anything though. I see you have wait 200, maybe try to put wait 250. It doesn’t sound logical that this small change would affect but however if it makes it working (hopefully does…) it doesn’t need to be logical. :slight_smile:


(RayBan) #15

try giving yourself a decent wait of around 1000, and for the ctf entitys, did
you give both of them different targetnames? or they share the same one?

if you gave them both the same targetname, it could cause an issue…
(now i havent tested that theory… but if i squeeze my eyes shut tight and
think about it, i can imagine an issue popping up later on… just cant put
my finger on it at this moment )

so its best to have seperate targetnames and alertentity them
in the game_manager spawn to… well, spawn them.


  spawn
 {
    blah
    blah
    blah

    wait 1000
    
    alertentity my_ctf_obj1
    alterentity my_ctf_obj2

    blah
    blah


(Yatta) #16

Mah …
I tried doing the alertentity after more than 250ms in the script (even 1s) while giving distinct targetnames to the 2 objs, but no luck …

The problem was that the obj are on a table under a cage, and the cage is lifted up at a certain point so the players can take the objs. However since the obj is on the table, you cant take it by touching it, you have to do ‘use’ on it because its too far from the player. If I try to get the objs closer to the edge of the table they stick out of the cage and players can take those even when the cage is down.

I think Ill solve that be modifying this place, with foot access to the obj behind a moving door/grate, and keep this simple … thats nothing major in the end.

Thanks for the help anyways : )


(-SSF-Sage) #17

Or then you could make an invisible box around it, so it is sealed from every side. You could use clipweap for the texture. If you use clip, then it will not block bullets, but I’m not sure if it blocks the obj being taken.