City scanner with mounted camera problem

So, I’ve been working on my first map for about a week now, and despite it being far from finished, I decided to play around with some of the tools.

I have made a city scanner spawn from a npc_template_maker along with an aiscripted_schedule, it spawns 1 scanner which then follows a path until someone decides to shoot it, when it dies, another spawns. This all works fine.

As I had this, I had a brilliant idea to see if I could mount a point_camera on the front of the spawned scanners which showed what it was seeing on a screen func_monitor.

Here is the scanner and the screen.

http://puu.sh/7ec3a.jpg

This works fine as well except after the first scanner is killed, the camera will stop in the death position and not re-parent with a newly spawned scanner.

So, why won’t the camera re-parent with the second scanner even when the output should apply. The output is for the camera to parent with the scanner that spawns:
CScanner_Cam = point_camera

http://puu.sh/7ebAj.png

I asked a friend who seemed to think this was a bug, but I don’t know…
Just ask if you wish to see anything else.

Any thoughts? :smile:

Well first problem is looking at your input is that it doesn’t Parent it to anything. You need to put the name of the NPC in the parameter override field.

You’re also going to want to teleport the CScanner_Cam back to the original spawn as well, otherwise it’s going to parent itself from it’s current location to the new scanner which is far away.

I have parented it to the npc_template_maker and the City Scanner template but it never seems to connect.

How would I go about teleporting it to the original location?

You don’t want to parent it to the template maker you want to parent it to the entity name that the template is generating.

Basically you have your **npc_scanner **lets call its scanner.
You have an npc_template_maker, well call it Template.
You have a **camera **named Camera.
AND you have a point_template named Spawn

Set up Spawn (or the point_template) for template 1 being the npc_template_maker (Template)
For Spawn, set up the outputs like this

OnEntitySpawned|Template|Spawn

Now you set up the params for scanner, camera, and Template.

Afterwords, you want to go into the outputs of Template.
OnSpawnNPC|Camera|SetParent|Scanner|<delay amount>

Outputs for Scanner
OnDeath|Camera|Kill|
OnDeath|Tempalte|Kill|

[editline]1st March 2014[/editline]

Just activate the point_template when you want to spawn the camera.

OnDeath|Camera|Kill|

I don’t get the option to Kill for the camera, should it be to Setoff?

Now I haven’t actually tested this, go ahead and setoff.

Also though, with the scanner go ahead and add an output saying

OnDeath|Scanner|KillHierachy|
this output should kill the camera because its parented. I’m just worried that it won’t switch cameras.

OK, so I have it now so it spawns with the camera attached, when it’s killed it does the same thing and doesn’t re-spawn a new scanner.

Will I need to teleport the camera back to the spawn location?

Either that, or you can spawn a new one along with the scanner (provided you kill the old one, of course).

Would that be done with a point_teleport?

What can be used to spawn in a new camera with the same parameters an infinite number of times? (or like 1000)

point_template

an npc_template_maker doesn’t spawn point_templates?

npc_template_maker, npc_maker and point_template are all used to spawn entities. The first two are exclusively used for NPCs and have the ability to automatically spawn them if set to do so, whereas point_templates can be used to spawn multiple entities at once, and not just NPCs, but any entities at all.

Also don’t forget about env_entity_maker, which can spawn instances of point_templates.