trigger a sprite to appear and disappear Created 2 years ago2022-02-04 19:09:23 UTC by DocRox DocRox

Created 2 years ago2022-02-04 19:09:23 UTC by DocRox DocRox

Posted 2 years ago2022-02-04 19:09:23 UTC Post #346247
Hi, I have a hldm server which runs the crossfire map 24/7 mostly. I have used bsp.edit to put a sprite on the map and I have change the siren sound (when the button is pushed) to the usa national anthem. Anyway I want the sprite to only appear when the bomb button is pushed and remain visible until the bomb explodes and then disappear until the bomb button is triggered again. Can someone please tell me what to enter in bsp.edit for this effect. Thanks in advance if you can help me. Server location is 192.223.26.108:27015 THE BASTARDS OF HALFLIFE <-RAPIDFIRE->
Posted 2 years ago2022-02-04 23:44:54 UTC Post #346248
It looks like the 'strike_mm' multi_manager is what orchestrates the whole airstrike sequence. It immediately activates the sirens and disables them after 45 seconds, and after 20 seconds it closes the main door and opens it again after 64 seconds, among other things.

There are several things you can do. The easiest approach is to give your sprite the same name as the sirens ('strike_siren') or as the bunker door ('bunker_maindoor'), so it will be triggered alongside the sirens or the bunker door. But that depends on whether you're happy with those timings.

If you want a different timing for your sprite, then you'll have to add some entries to the 'strike_mm' multi_manager. The problem is that a multi_manager can only trigger up to 16 targets, and this one is already triggering 15, so you can only add one entry. So you'll need to create a new multi_manager, and either make 'strike_mm' trigger it, or give it the same name as 'strike_mm', so it gets triggered at the same time. You can then add two entries to this new multi_manager, for enabling and disabling your sprite.
Posted 2 years ago2022-02-05 17:09:51 UTC Post #346249
Thankyou for responding so quickly, I really appreciate it. I'm sorry but I'm having trouble, how do i go about renaming it? do you mean rename the sprite itself? here is what i got in the bsp file. the timing of the siren is what i want. I want the sprite only to be visible while the siren is going.
{
"origin" "1 -949 -1440"
"scale" "1.0"
"model" "sprites/usaflagdoc.spr"
"rendercolor" "255 255 255"
"renderamt" "255"
"rendermode" "4"
"renderfx" "14"
"framerate" "20"
"classname" "env_glow"
}
Posted 2 years ago2022-02-05 18:46:36 UTC Post #346250
You can make that sprite get triggered at the same time as the sirens by adding the following line to it:
"targetname" "strike_siren"
Or if you prefer the bunker door timing:
"targetname" "bunker_maindoor"
For custom timings, you could add a new multi_manager with the same name as the multi_manager that's handling the whole sequence, so they get activated at the same time:
{
"classname" "multi_manager"
"targetname" "strike_mm"
"your_sprite_targetname" "0"
"your_sprite_targetname#1" "10"
}
You can adjust the 0 and 10 to whatever times (in seconds) that you like. Just as with the siren or main door timings, this also requires your sprite to have a name, but now you should use a name that isn't used anywhere else, to ensure that your multi_manager will be the only entity that's triggering your sprite:
"targetname" "your_sprite_targetname"
Posted 2 years ago2022-02-05 20:02:39 UTC Post #346251
*EDITED THE ANIMATED SPRITE IS NOT FROZEN
*Again I thankyou for your help but still not working and still visible when I join the server. When I push the button the sprite does nothing but the airstrike and sound work. Heres what I put in the BSPEdit. Keep in mind I do not want the sprite visible until when the button is pushed and I want it to become invisible right after the strike occurs.

{
"classname" "multi_manager"
"targetname" "strike_mm"
"your_sprite_usaflagdoc" "0"
"your_sprite_usaflagdoc#1" "45"
}
{
"origin" "1 -949 -1440"
"targetname" "usaflagdoc"
"scale" "1.0"
"model" "sprites/usaflagdoc.spr"
"rendercolor" "255 255 255"
"renderamt" "255"
"rendermode" "4"
"renderfx" "14"
"framerate" "20"
"classname" "env_glow"
}
Posted 2 years ago2022-02-05 20:55:09 UTC Post #346253
tried this as well

{
"classname" "multi_manager"
"targetname" "flag"
"usaflagdoc" "0"
"usaflagdoc#1" "45"
}
{
"origin" "1 -949 -1440"
"targetname" "flag"
"scale" "1.0"
"model" "sprites/usaflagdoc.spr"
"rendercolor" "255 255 255"
"renderamt" "255"
"rendermode" "4"
"renderfx" "14"
"framerate" "20"
"classname" "env_glow"
}
Posted 2 years ago2022-02-05 21:21:40 UTC Post #346254
Ah, I see. Well, the first problem is that the names that you're using in your multi_manager do not match the targetname of your sprite. If your sprite contains "targetname" "usaflagdoc", then your multi_manager should contain "usaflagdoc" "0" and "usaflagdoc#1" "45".

But the second problem is that an env_glow cannot be enabled/disabled... so you'll have to use an env_sprite instead. Just change "classname" "env_glow" to "classname" "env_sprite". An env_sprite with a targetname will initially be disabled, and it will become visible when triggered (and invisible when triggered again).

While we're at it, sprites are only updated 10 times per second, so with a framerate of 20, every second sprite frame will be skipped.
Posted 2 years ago2022-02-05 21:45:28 UTC Post #346255
Thank you so much! Half way there.
now when i join the flag is not there and does appear when i push the air strike button but it does not go away after the strike is over. here is what i have in the bspedit

{
"origin" "1 -949 -1440"
"targetname" "strike_mm"
"scale" "1.0"
"model" "sprites/usaflagdoc.spr"
"rendercolor" "255 255 255"
"renderamt" "255"
"rendermode" "4"
"renderfx" "14"
"framerate" "20"
"classname" "env_sprite"
}
Posted 2 years ago2022-02-05 22:09:37 UTC Post #346256
Your sprite now has the same name as the multi_manager that handles the airstrike sequence, so its visibility will only be toggled each time the airstrike sequence starts. So when the airstrike is started for the first time, your sprite will become visible, and will remain so. When the airstrike is started a second time, your sprite will become invisible. The third airstrike will make it visible again, and so on.

That's why you need to add a new multi_manager (with the same name as the airstrike multi_manager, so it will start at the same time):
{
"classname" "multi_manager"
"targetname" "strike_mm"
"usaflagdoc" "0"
"usaflagdoc#1" "45"
}
And this is how your sprite entity should look like:
{
"origin" "1 -949 -1440"
"scale" "1.0"
"model" "sprites/usaflagdoc.spr"
"rendercolor" "255 255 255"
"renderamt" "255"
"rendermode" "4"
"renderfx" "14"
"framerate" "20"
"classname" "env_sprite"
"targetname" "usaflagdoc"
}
Posted 2 years ago2022-02-05 22:37:10 UTC Post #346257
Absolutely brilliant and I thank you from the bottom of my heart. It works 100%. I have a question. Can I set up other sprites throughout the map the same way?
Posted 2 years ago2022-02-05 23:00:15 UTC Post #346258
Sure, just duplicate your env_sprite and adjust the origin of each copy. As long as they all have the same targetname, they'll all be triggered at the same time.
Posted 2 years ago2022-02-05 23:03:36 UTC Post #346259
Thanks again! How could I make it so that when the airstrike occurs that the frag points will be given to the player who pushed the button?
Posted 2 years ago2022-02-05 23:57:17 UTC Post #346260
I'm not quite sure, but you could try adding a game_score entity, again with the same targetname as the airstrike multi_manager:
{
"classname" "game_score"
"targetname" "strike_mm"
"points" "1"
}
Posted 2 years ago2022-02-06 01:34:32 UTC Post #346261
No it didn't work. You have helped me tremendously and I thank you very much. Like you I love the game very much and I am always trying to improve my server for the players out there. If you can help me figure this other thing out sometime I would appreciate it.
Posted 2 years ago2022-02-14 15:11:25 UTC Post #346283
Try bspguy. It lets you see the entity activator/target relationship in the map visually in 3D. You can add and edit entities there too!

There will be some set-up required. Particularly you'd need the FGD file for Half-Life for the program to understand what there is to Half-Life entities but you can get it by downloading Half-Life's SDK from Steam. It says that it's for svencoop, but if you're just looking to edit existing maps' entities and not doing the map merging thing, it works on any goldsrc game/map.

Hopefully once you get a grasp of what the program can do you'd be able to do way more bespoke things for your server. :P
Posted 2 years ago2022-02-16 14:41:48 UTC Post #346284
thanks, i have downloaded and it will take me a while to figure it out.
Posted 2 years ago2022-03-01 16:18:06 UTC Post #346304
I couldn't figure the program out but thank you I appreciate your time.
You must be logged in to post a response.