Raised This Month: $51 Target: $400
 12% 

Door issues


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Scag
AlliedModders Donor
Join Date: May 2017
Location: Crashing Hale
Old 03-31-2018 , 15:02   Door issues
Reply With Quote #1

Trying to open all of the doors in a map, Jailbreak maps to be exact. For some reason with the below code, some either don't open at all or close automatically after a time.

PHP Code:
stock char sDoorsList[][] =  { "func_door""func_door_rotating""func_movelinear""prop_door_rotating" };

public 
void OpenAllDoors()
{
    
int ent;
    for (
int i 0sizeof(sDoorsList); i++)
    {
        
ent = -1;
        while ((
ent FindEntityByClassname(entsDoorsList[i])) != -1)
        {
            if (
IsValidEntity(ent))
            {
                
AcceptEntityInput(ent"Unlock");
                
AcceptEntityInput(ent"Open");
            }
        }
    }

My plan B is to just AEI "Kill" them, but is there another way? And would they come back next round if I did that?
__________________
Over-engineering is underrated.

GitHub
BTC
ETH

Retired
Scag is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 03-31-2018 , 15:37   Re: Door issues
Reply With Quote #2

Quote:
Originally Posted by Ragenewb View Post
Trying to open all of the doors in a map, Jailbreak maps to be exact. For some reason with the below code, some either don't open at all or close automatically after a time.

PHP Code:
stock char sDoorsList[][] =  { "func_door""func_door_rotating""func_movelinear""prop_door_rotating" };

public 
void OpenAllDoors()
{
    
int ent;
    for (
int i 0sizeof(sDoorsList); i++)
    {
        
ent = -1;
        while ((
ent FindEntityByClassname(entsDoorsList[i])) != -1)
        {
            if (
IsValidEntity(ent))
            {
                
AcceptEntityInput(ent"Unlock");
                
AcceptEntityInput(ent"Open");
            }
        }
    }

My plan B is to just AEI "Kill" them, but is there another way? And would they come back next round if I did that?
Just teleport them to infinity and beyond with TeleportEntity and bring them back to the same origin in the end of the round.

new FloatoorsOrigin[50][3];

GetEntPropVector(Door, "m_vecOrigin", DoorsOrigin[x]);


TeleportEntity(Door, DoorsOrigin[x], NULL_VECTOR, NULL_VECTOR);
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
blacklagoon
Senior Member
Join Date: Jun 2012
Old 03-31-2018 , 15:40   Re: Door issues
Reply With Quote #3

you could try to use stripper source to set their flags open but honestly, it would be already done if you used entspy and opened the map to modify these doors
https://developer.valvesoftware.com/wiki/Entspy

Last edited by blacklagoon; 03-31-2018 at 15:45.
blacklagoon is offline
Scag
AlliedModders Donor
Join Date: May 2017
Location: Crashing Hale
Old 03-31-2018 , 15:57   Re: Door issues
Reply With Quote #4

Quote:
Just teleport them to infinity and beyond with TeleportEntity and bring them back to the same origin in the end of the round.

new FloatoorsOrigin[50][3];

GetEntPropVector(Door, "m_vecOrigin", DoorsOrigin[x]);


TeleportEntity(Door, DoorsOrigin[x], NULL_VECTOR, NULL_VECTOR);
Seems odd but a possibility.

Quote:
you could try to use stripper source to set their flags open but honestly, it would be already done if you used entspy and opened the map to modify these doors
https://developer.valvesoftware.com/wiki/Entspy
I'm pretty sure stripper doesn't do round-specific exceptions. And I'm not trying to do this for a single map either, this code is a part of an entire plugin. Therefore Entspy wouldn't do me much good on a global level.
__________________
Over-engineering is underrated.

GitHub
BTC
ETH

Retired
Scag is offline
blacklagoon
Senior Member
Join Date: Jun 2012
Old 03-31-2018 , 16:08   Re: Door issues
Reply With Quote #5

i've never read anything about round specific exceptions in OP's thread?
Just him trying to open them all in a map, or i'm very tired if i didn't understand...

Last edited by blacklagoon; 03-31-2018 at 16:08.
blacklagoon is offline
cravenge
Veteran Member
Join Date: Nov 2015
Location: Chocolate Factory
Old 04-01-2018 , 07:16   Re: Door issues
Reply With Quote #6

You didn't do a check on how they were spawned. I'm talking about if they were spawned already open or closed.

But the problem of them not opening still stands depending on various scenarios... (i.e diff. plugin codes conflicting, the way this function is being called, possibility of some of these entities have been spawned with triggers that interferes with the function, etc.)

PHP Code:
// "m_eSpawnPosition" netprop:
// 0 = closed
// 1 = open

stock char sDoorsList[][] =  { "func_door""func_door_rotating""func_movelinear""prop_door_rotating" };

public 
void OpenAllDoors()
{
    
int ent;
    for (
int i 0sizeof(sDoorsList); i++)
    {
        
ent = -1;
        while ((
ent FindEntityByClassname(entsDoorsList[i])) != -1)
        {
            if (
IsValidEntity(ent))
            {
                if (
GetEntProp(entProp_Data"m_eSpawnPosition") == 1)
                {
                    continue;
                }
                
                
/* if you want them to be forever opened and */
                /* cannot be closed again, add this... */
                // SetVariantString("spawnflags 32768"); /* 32768 - Ignores player +USE */
                // AcceptEntityInput(ent, "AddOutput");
                
                
AcceptEntityInput(ent"Unlock");
                
AcceptEntityInput(ent"Open");
            }
        }
    }


Last edited by cravenge; 04-01-2018 at 07:33.
cravenge is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:29.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode