[Solved] (not) Detecting Disabled Portals

Avatar
Sprowl
97 Posts
Posted Apr 23, 2013
Heya guys,

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? :smile:

Advertisement
Registered users don’t see ads! Register now!
Avatar
BenVlodgi
633 Posts
Posted Apr 24, 2013
Replied 8 hours later
yah, you could place prop_portals in your map (at the origin if you please) and just turn them on and off, and they will move there
couldn't you just exclude the entries based off of their 'active' property though?
Avatar
Sprowl
97 Posts
Posted Apr 24, 2013
Replied 11 hours later
That's the problem: I don't know how I could detect the off-state. func_portal_detectors in the detectable area are buggy as hell so I can't and don't want to use them.
Avatar
josepezdj
2,386 Posts
Posted Apr 24, 2013
Replied 15 minutes later
I guess Ben meant in your script, it could be possible to filter your entry by that keyvalue "Activated" depending on its value "1" or "0". Make it to ignore the entities with value "1" for that keyvalue :wink:
Avatar
Sprowl
97 Posts
Posted Apr 24, 2013
Replied 1 hour later
Then tell me what function I need to write into my fancy editor to get the keyvalues of an entity :wink: . 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 :lol: .

Avatar
josepezdj
2,386 Posts
Posted Apr 24, 2013
Replied 31 minutes later
Sprowl, I'm only starting to learn basic scripting... so I don't really know exactly how to achieve it; I was saying that I think Ben meant that in his post. Maybe with the function "FindKey" (string) you can search the keyvalue 'Activated' and the value "1"... what is the content of your script so far?
Avatar
Sprowl
97 Posts
Posted Apr 24, 2013
Replied 15 minutes later
Allright, I'll try out the FindKey-Function.

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.

Avatar
josepezdj
2,386 Posts
Posted Apr 24, 2013
Replied 11 minutes later
There's also "GetKeyBool"... and since the keyvalues 'Activated' value in the prop_portal is a boolean, maybe this can work out better. It returns the boolean value associated to the Keyvalue.
Avatar
FelixGriffin
2,680 Posts
Posted Apr 24, 2013
Replied 3 hours later
The CScriptKeyValues functions would let you do that, but VALVe forgot one thing...there's no way to get the KeyValues root from an entity so you can use the functions on it. :sad:

If you find a way please post it, it would be immensely helpful.

Avatar
Sprowl
97 Posts
Posted Apr 26, 2013
Replied 1 day later
Hm I tried your functions jose, and they don't work. Just as Felix said. I also tried parenting a trigger_portal_detector to each portal but this doesn't help either. Seems like I have to do it manually with outputs to every fizzler.
Man I really thought there would be a more automatic way.

Well, thanks anyway guys :smile: .

Avatar
FelixGriffin
2,680 Posts
Posted Apr 26, 2013
Replied 2 hours later

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)
Advertisement
Registered users don’t see ads! Register now!
Avatar
Sprowl
97 Posts
Posted Apr 28, 2013
Replied 1 day later
Your script didn't work, but I used its idea and rebuild it with entites:

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 :biggrin: .
Thanks Felix