[Solved] (not) Detecting Disabled Portals
I got a question about VScripts 'n' Stuff. Right now I have a script that checks in a specific radius for some entities - playet, cubes and also portals. I don't have any problems with cubes and the player, but I have a little problem with portals after they got fizzled through a trigger_portal_cleanser. The script still detects that there is a portal, because, in fact, the prop_portal is still there. Its active state was just set to '0'.
Now I could put an output to every fizzler and place portals at the world origin and close them again so they are no more near the area the script checks for entites. But maybe someone here have a better idea, like reading the active state of the portal (is that possible?) or add an output to every fizzler onMapSpawn so I don't have to do it manually for every one.
So... any ideas? 
couldn't you just exclude the entries based off of their 'active' property though?
. Because I don't know that function and I couldn't even find it on the function list on the VDC. Maybe I oversee it.
I talked with Felix about this and he said that this isn't possible. Now I'm curious who's right
.
The script is basicly that + sime functions after that which do some stuff with the entites it did find. I don't want to spoil everything here because I want to use it in my next maps.
If you find a way please post it, it would be immensely helpful.
Man I really thought there would be a more automatic way.
Well, thanks anyway guys
.
There is a slightly easier way. Try this in a precache or OnMapSpawn script.
ent <- null;
do{
ent = Entities.FindByClassname("trigger_portal_cleanser");
if(ent == null) break;
EntFireByHandle(ent,"AddOutput","OnFizzle prop_portal:FireUser1::0:-1",0.0,null,null);
}while(true);
Then make a box with the inactive portals in it at the start so you can give them outputs. Add to each one:
OnUser1 > !self > RunScriptCode > self.SetOrigin(0,0,0)
logic_auto:
OnMapSpawn > trigger_portal_cleanser > AddOutput > OnFizzle FizzlePortalRelay:Trigger::0
FizzlePortalRelay (logic_relay):
OnTrigger > BluePortal > FireUser 1
OnTrigger > OrangePortal > FireUser 1
OnTrigger > self > Disable
BluePortal / OrangePortal (prop_portal):
OnUser 1 > NewLocation > 0 0 0 0 0 0
OnUser 1 > SetActivatedState > 0
OnPlacedSuccessfully > FizzlePortalRelay > Enable
Bugfree and easy, just as it should be
.
Thanks Felix