PDA

View Full Version : Trigger load bug



pollo
12th November 2020, 23:38
Hi all! I come to you again to see if you can provide me with some light to this bug :)

I've been working in this zombies' map for the last months. It's detailed, with lots of sounds and cool stuff, but this "bug" kinda kills it: some triggers are not loaded (they are invisible) until the player is near it in a certain position, like I illustrate in the vid below (it just loads in the moment I crouch and go to that corner). I've done a rough count of trigs by doing
getent("classname", "trig...").size for each type of trigger, and it shows I have 53 triggers. I tried removing some triggers just in case I hit a limit or something, but the same problem occurs; and what kinda surprises me is that some new triggers I make, they work, but those ones that fail to load, keep like that :confused:

Any idea what this could be?

Thanks for reading!

PS1. Trig hurt - trig multiple (for minefield) mostly work good, I havent seen it happen for these ones; the problem are trig_dmg and trig_use_touch :confused:


https://www.youtube.com/watch?v=mwj_qOynZjI

voron00
13th November 2020, 00:59
yeah its some sort of engine bug, the only solution i could find is to switch team for a player, then trigger starts to work fine again.

Mitch
13th November 2020, 06:41
Maybe you can combine multiple triggers (with the same functionality) as one entity.

E.g. you have 3 minefields.
Remove all triggers, select all of them and create one trigger.

pollo
13th November 2020, 12:37
yeah its some sort of engine bug, the only solution i could find is to switch team for a player, then trigger starts to work fine again.
I'll try this workaround when I'll come home :)

Maybe you can combine multiple triggers (with the same functionality) as one entity.

E.g. you have 3 minefields.
Remove all triggers, select all of them and create one trigger.

Yeah that's what I normally do for triggers that can be combined like the minefield or separate triggers that have the same "action" so to speak (eg. I have some zones in which the player gets his ammo empty, all of them are the same trigger combined as u say) , but since the rest serve for different purposes I need them to be different entities (eg. I have a bunch of doors which consist of an array of triggers, all of them share the same targetname, but have different target, which is every single door).

Thx for the answers :) I'll keep this updated if somethin works

IzNoGoD
13th November 2020, 16:29
Try triggeroff() and triggeron() in _utility.gsc at map start and report back.

pollo
13th November 2020, 17:36
@voron00 unfortunately not working even after many team switches


Try triggeroff() and triggeron() in _utility.gsc at map start and report back.

Tried too, but they still don't seem to load :/

I just tried to remove misc_models that could collide with the triggers, as I saw in another thread on another forum, but got the same result even after removing all of them from the map.

Thing is, it's not like there are random triggers that are inactive on every map restart, but rather it's always the same ones; the rest work perfectly.

Another thing: got a trig_damage (bad) and a different trig_multiple (good). Trig_damage starts working only after doing any of these actions:
-Going "inside" it with /noclilp or positioning below it
-Touching (triggering) the trig_multiple which is completely unrelated
-Manually triggering by script (with trig notify("trigger", player) in a test function I called on player)

:confused:

Mitch
13th November 2020, 20:53
Thing is, it's not like there are random triggers that are inactive on every map restart, but rather it's always the same ones; the rest work perfectly.

When you check the open .map source with a text editor and search for all lines starting with: "classname" "trigger_
Are the triggers that don't work/inactive the last ones in the file?

Edit: Are you using portal textures to only render the parts of the map that are visible to the player?
If it is a limit, this might prevent the player from loading too many triggers at the same time.
Also, it will improve FPS.

https://wiki.zeroy.com/index.php?title=Call_of_Duty_2:_Portals
http://modsonline.com/Tutorials-read-427.html

pollo
13th November 2020, 21:20
When you check the open .map source with a text editor and search for all lines starting with: "classname" "trigger_
Are the triggers that don't work/inactive the last ones in the file?

Edit: Are you using portal textures to only render the parts of the map that are visible to the player?
If it is a limit, this might prevent the player from loading too many triggers at the same time.
Also, it will improve FPS.

https://wiki.zeroy.com/index.php?title=Call_of_Duty_2:_Portals
http://modsonline.com/Tutorials-read-427.html

Yes I just checked and all the buggy ones are at the very end :eek: could it mean something?

I'll see this about portalling, ty :)

Mitch
13th November 2020, 23:13
Yes I just checked and all the buggy ones are at the very end :eek: could it mean something?

I guess a trigger limit (all variants). After this limit you get undefined behaviour like in your video.
At how many triggers does this behaviour start?

pollo
14th November 2020, 01:22
I guess a trigger limit (all variants). After this limit you get undefined behaviour like in your video.
At how many triggers does this behaviour start?

I haven't got an exact number, but if there is, I assume is below 19 (I deleted 44; it's a bit a pain in the ass to remove trigs as I work mainly with prefabs and have to do edit them 1 by one lol). And that is weird and I believe impossible, because I'm sure that more than 19 work at the same time, as I've been testing pretty much everything everytime. The exceptions are those 3-4 rebel ones, which I also tried remaking from scratch, with same result:confused:

Tried deleting all of the models (800+) and a huge amount of prefabs (800+), but also nothing haha. Could be maybe script_brushmodels? I have around 30, but some of them are groups of much more brushes.

Guess I will have to rethink another workaround or idk :rolleyes:


Edit. brushmodels either, deleted those huge groups, same thing hahaha

IzNoGoD
15th November 2020, 08:33
Make your own trigger_use_touch by using a trigger_multiple with a hud element ("Press F to activate") and a custom script.

pollo
15th November 2020, 14:17
Make your own trigger_use_touch by using a trigger_multiple with a hud element ("Press F to activate") and a custom script.

Thx, will do this :)

Btw, is there any way to simulate a trig_damage as well by script? By libcod maybe? I thought to use setAlive but maybe there are other options. Will test this afternoon :)

IzNoGoD
15th November 2020, 19:24
Thx, will do this :)

Btw, is there any way to simulate a trig_damage as well by script? By libcod maybe? I thought to use setAlive but maybe there are other options. Will test this afternoon :)

Setalive() turns stuff (script_brushmodel for example) into a trigger_damage with a damage notify.

pollo
15th November 2020, 20:10
Setalive() turns stuff (script_brushmodel for example) into a trigger_damage with a damage notify.

That's perfect then :D I'll report back after testing it

pollo
16th November 2020, 01:57
Update on this:

I remade all of the buggy triggers from scratch, but now making sure they don't collide with any other brushes around (for doors that need the trigger to be at both sides, I did Mitch's technique; making 2 brushes, 1 per each side, and then making them a single entity). By doing this, the trigs from the jail were fixed, but there was another that still was bad (one of the doors). However, setting a different width/height for that trigger also fixed it. The only buggy one now is this trig_damage, that I'm gonna try to do through libcod.

So all in all, apparently this is fixed by trial and error :confused:

Last edit:

Trig dmg also fixed, I just moved and rotated it to a near position. All works now :D