Eraser wrote:Ahh, you've run into a bug (or rather, an oversight). The "deathtarget" key only triggers entities with a similar "targetname" key and not those with a similar "targetname2" key. This is an error and I will correct it. For now you could try swapping all the targetname and targetname2 values on the speakers.
I see.
I did not know it was specific like that; that "targetname2" can only work from a "target2" and not "target" or "target3", etc. etc.
Eraser wrote:This is an error and I will correct it.
Is it really an error though?
From what I've learned recently, I would now say that technically "deathtarget" should target a specific targetname--just like the "target" and "target2" do.), therefore the deathtarget's targetname would perhaps be called something like "deathtargetname" for example. Right?
From a programming perspective, perhaps it's easier for you to link "deathtarget" to "targetname" or "targetname2" on a mass scale for many entities, rather adding a new key "deathtargetname" on a mass scale to many entities. I'm not sure.
deqer wrote:---
With my recent understanding of all this, I attempted to fix my issue. I changed my target_speakers and botspawn targets/targetnames, etc.
It worked--the music and the door were triggered again. But, an error happened where the target_botspawn would target itself. Error screen/console message: "WARNING: Entity used itself."
Here is what I have now:
The Button:
// wait -2 = does not return.
{
"classname" "func_button"
"target" "room1"
"wait" "-2"
{ ... }
}
The Door
// spawnflags 1 = starts open.
{
"classname" "func_door"
"targetname" "room1"
"spawnflags" "1"
{ ... }
}
The Bot:
{
"classname" "target_botspawn"
"deathtarget" "room1"
"targetname" "room1"
}
The Speakers:
// spawnflags 2 = looped_off
{
"classname" "target_speaker"
"targetname" "room1"
"spawnflags" "2"
"noise" "sound/krep01/combat_2_loop.wav"
}
I was lucky that the bot did not execute itself again after it dies. So, I do indeed understand that the logic I used is kind of wrong, where I set target and targetname to the same value, on target_botspawn.
I feel as though I need a deathtarget2 for trigger_botspawn. Yes, yes, can I have deathtarget2/deathtargetname2 for all entities?
deqer wrote:---
So, I tried changing it around a bit in order to avoid that conflict "Entity used itself.", but then I ran into another issue where target2/targetname2 does not work from func_button to target_speaker
Here is what it looks like:
The Button:
// wait -2 = does not return.
{
"classname" "func_button"
"target" "room1"
"target2" "room1door"
"wait" "-2"
{ ... }
}
The Door
// spawnflags 1 = starts open.
{
"classname" "func_door"
"targetname" "room1"
"targetname2" "room1door"
"spawnflags" "1"
{ ... }
}
The Bot:
{
"classname" "target_botspawn"
"deathtarget" "room1"
"targetname2" "room1door"
}
The Speakers:
// spawnflags 2 = looped_off
{
"classname" "target_speaker"
"targetname" "room1"
"targetname2" "room1door"
"spawnflags" "2"
"noise" "sound/krep01/combat_2_loop.wav"
}
The func_button "target2" did not trigger the target_speaker, or func_door. it did (worked correctly) the trigger_botspawn though.
The trigger_botspawn "deathtarget" worked correctly for the target_speaker, and func_door. But, since the "target2" did not work initially, then the music and door were opposite sync (music turned on; door opened, instead of closing, etc.), blah blah.
So, it seems that "targetname2" does not work at all, for target_speaker for example. Is that another bug?
deqer wrote:---
TLDR:
The button will trigger the bot, and music. But, killing the bot must trigger the music again, therefore we need some target/target2 functionality--associated with deathtarget functionality.
Assuming my correct understanding of the standard convention used, then I recommend that we add "deathtargetname" to all entities, and associate "deathtargetname" with "deathtarget" only. "deathtarget" must not target "targetname" or "targetname2", because that becomes complex in programming/logic for some scenarios.
I request a "deathtarget"/"deathtargetname2" system on all entities, so that I can trigger the same music (to stop it) again but not trigger the same bot again because the same targetname is being used for the bot and the music.
---