func_door issue


(morphdoc) #1

Hi guys,

I am trying to create door triggered by button using func_door and func_invisible_user (or smth like that) function.

in Func_door, it says that if targetname has been assigned, no touch field will be spawned and a remote button or trigger field activates the door.

So I put targetname, I linked it to the button (func_invisible_user) but the “touch field” is still there and the door can be opened using just the door, and not the button. Please, help!


(ailmanki) #2

Try with the entity func_door_rotating
http://games.chruker.dk/enemy_territory/entities.php?action=show_entity&entity_name=func_door_rotating

But I don’t really know.


(morphdoc) #3

Hi ailmanki,

But I want sliding doors, not rotating :frowning:


(ailmanki) #4

Did you double check the connection between the button and the door? I mean that the button points to the door - and not the other way around?
Else search this forum for func_door, there is plenty of results - maybe it helps.


(morphdoc) #5

Ok, I found a different solution for my problem, but a new problem came up…

Is is possible to remove a certain brush after one of the objectives is completed? I.e. it would make doors accessible only after the objective is completed as I put an invisible wall in front of the doors:p


(twt_thunder) #6

Entity handling
alertentity <targetname>
Uses the entity ‘targetname’.

kill <targetname>
Kill all entities with targetname set to ‘targetname’.

remove
Schedule this entity to be freed on the next serverframe.

EDIT:
the main problem with the door I think is that we’re missing
FUNC_BUTTON


(morphdoc) #7

yea, this is what I thought so re. FUNC_BUTTON

As to kill <targetname>…works perfectly! Thanks!!


(morphdoc) #8

One more question:

Is it possible to have BRUSH (not a model) appearing after the script is triggered? I.e. it is invisible, once the script is triggered it appears? I tried setstate, but did not work… :confused:

EDIT: setstate actually worked…


(morphdoc) #9

But another question…

How to script for explosion with script_mover? I have a rocket that plummets into the building and I would like to create a blast upon contact with the floor.

Any ideas? I have tried to look for answers, but failed to.


(FAQIS) #10

Target explosion may be right?

target_explosion triggered with “alertentity”

I dont know if it works but it may work…

Just a tip but the speed is inches/second and not kilomaters/second…
So you missile should move over 1000 inches/second


(stealth6) #11

target_explosion iirc there are 2 types big & small and you trigger them with alertentity. So FAQIS was right :slight_smile:


(morphdoc) #12

Thanks, but what I meant by ‘explosion’ is that it kills people around it:P

I have tried doing this with trigger_hurt, and alertentity in the script. Works fine as long as someone is around the site of explosion. But if not, then whoever goes there after the explosion gets killed. This is because the script makes the trigger_hurt APPEAR, but then someone must be there to activate it.

Anyway of going around it?

rocket
{
spawn
{
wait 200
gotomarker rocket_pc3 1000
}

trigger move
{
wait 5000

  playsound sound/weapons/rocket/rocket_fly.wav looping forever
  gotomarker rocket_pc2 1000 wait
  alertentity roofexplosion
  gotomarker rocket_pc1 1000 wait
  stopsound
  playsound sound/weapons/rocket/rocket_expl.wav
  setstate rocket invisible
  alertentity blast

}

}

roofexplosion
{
spawn
{
wait 7000
}
death
{
wait 200
}
}

blast
{
spawn
{
wait 200
}
trigger
{
wait 200
}
}


(stealth6) #13

Well goldrush has an example of what you want. When the tank fires a trigger_hurt is activated in front of the tank for a few milliseconds. I think you need to use setstate instead of alertentity.
something like
setstate hurt_trigger default
wait 500
setstate hurt_trigger invisible


(morphdoc) #14

heh, funny, I acutally thought the same on my way back home! To use setstate. Well, worked fine!

But a new problem occur!

As before, I did “kill rocket” to remove the rocket from the map after it hit its target, but it no longer works…any idea why?

new script

rocket
{
spawn
{
wait 200
gotomarker rocket_pc2 1000
}

trigger move
{
wait 5000

  playsound sound/weapons/rocket/rocket_fly.wav looping forever
  gotomarker rocket_pc1 1000 
  wait 1600
  alertentity roofexplosion
  stopsound
  playsound sound/weapons/rocket/rocket_expl.wav
  kill rocket
  alertentity blast
  wait 500
  setstate blast invisible

}

}

roofexplosion
{
spawn
{
wait 7000
}
death
{
wait 200
}
}

blast
{
spawn
{
wait 200
}
trigger
{
wait 200
}
}


(stealth6) #15

First off you should use

 tags for our script, then it keeps indentation.

what's going on here:

alertentity blast
wait 500
setstate blast invisible



Afaik an entity either works with setstate OR alertentity? I could be wrong though... Maybe try:

setstate blast default
wait 500
setstate blast invisible



I'm not sure how kill <entity> works, but I don't see "death" defined for rocket. I think kill triggers death? I'll take a stab at it:

rocket
{
spawn
{
wait 200
gotomarker rocket_pc2 1000
}

trigger move
{
	wait 5000

	playsound sound/weapons/rocket/rocket_fly.wav looping forever
	gotomarker rocket_pc1 1000 
	wait 1600
	alertentity roofexplosion
	stopsound
	playsound sound/weapons/rocket/rocket_expl.wav
	kill rocket
	alertentity blast
	wait 500
	setstate blast invisible
}

death
{
	setstate rocket invisible
}

}


(morphdoc) #16

[QUOTE=stealth6;505345]First off you should use

 tags for our script, then it keeps indentation.

what's going on here:

alertentity blast
wait 500
setstate blast invisible



Afaik an entity either works with setstate OR alertentity? I could be wrong though... Maybe try:

setstate blast default
wait 500
setstate blast invisible


[/quote]

When I did that, the trigger_hurt did not work when the rocket landed in the building. The reason is that the trigger had "start_off" flag attached to it. But when I removed the "start_off" the trigger was visible even without the rocket. So what I did, I removed the start_off flag, and I added one line under game_manager i.e. setstate blast invisible. So now when the rocket lands, we have setstate blast default, wait 500 and invisible again. It works fine. 

It worked fine with both alertentity and setstate, but I guess it is better to keep things the same, rather than mixing stuff up.



> I'm not sure how kill <entity> works, but I don't see "death" defined for rocket. I think kill triggers death? I'll take a stab at it:

> ```

> rocket
> {
> 	spawn
> 	{
> 		wait 200
> 		gotomarker rocket_pc2 1000
> 	}

> 	trigger move
> 	{
> 		wait 5000

> 		playsound sound/weapons/rocket/rocket_fly.wav looping forever
> 		gotomarker rocket_pc1 1000 
> 		wait 1600
> 		alertentity roofexplosion
> 		stopsound
> 		playsound sound/weapons/rocket/rocket_expl.wav
> 		kill rocket
> 		alertentity blast
> 		wait 500
> 		setstate blast invisible
> 	}
> 	
> 	death
> 	{
> 		setstate rocket invisible
> 	}
> }

> ```



So I have kill &lt;entity&gt; somewhere in the map and it works fine...Also it worked for the rocket until I added extra lines to it....

The above code does not work either, agrh! :P

(morphdoc) #17

SORTED

setstate rocket invisible

setstate rocket default

setstate rocket invisible

Basically, I was missing setstate rocket default. The rocket appeared without it when the script was triggered so I thought I did not have to put “setstate rocket default”


(Mateos) #18

Or, if you are in a subtable of your entity, you can use the keyword remove to permanently remove the entity from the map.


(Teuthis) #19

[QUOTE=morphdoc;505200]Hi ailmanki,

But I want sliding doors, not rotating :([/QUOTE]

Tutorial on making a sliding door that opens via a button here:
http://www.level-designer.de/index.php?page=LexiconItem&id=114

Worked great for me


(morphdoc) #20

[QUOTE=Teuthis;505427]Tutorial on making a sliding door that opens via a button here:
http://www.level-designer.de/index.php?page=LexiconItem&id=114

Worked great for me[/QUOTE]

Unfortunately, there is no func_button in GTK radiant anymore.