Thread: Portal Spawner

Page 1 of 2 12 LastLast
Results 1 to 25 of 32
  1. #1
    func_vehicle enthusiaist w00tguy123's Avatar
    Join Date
    Dec 2006
    Location
    U.S. West
    Posts
    1,598

    Portal Spawner

    Woooooooo portals!



    Overview:

    The original purpose of this plugin is to bypass buggy map sections, or to create shortcuts in maps that need them. It's also good for lulz.

    Pretty much every possible entity you can think of will be able to go through portals, including weapon projectiles (grenades, hornets, displacers, etc.) and func_pushable.

    Portals can be saved and loaded. The data files can be found in your /svencoop/scripts/plugins/store/ folder. If you create a "PortalSpawner" folder inside /store/ then the files will be written there instead (keeps your /store/ folder clean).

    Usage:

    Say .ps or type .ps in console to open the menu. The menu will stay open until you explicitly "Exit" it or if you die. Admin rights are required to use this.

    There are three types of portals you can spawn:

    1) Portal entrance (orange)
    2) Portal exit (green)
    3) Bidirectional portal (white-ish)

    To spawn a portal without using the menu, use the following commands:

    .ps en = spawns a portal entrance
    .ps ex = spawns a portal exit
    .ps bi = spawns a bidirectional portal
    You can type out ".ps enter" or ".ps exit" or ".ps bidirectional" etc. if you really want to.

    Portal entrances can only be linked to portal exits, and bidirectional portals can only be linked to other bidirectional portals. By default, portals will choose random destinations. You can link portals and change properties in the portal edit menu.

    Portal edit menu options:

    1) Target - Choose a portal to link with (default is "Random")
    2) Update Position - Press this to move the portal to your current position
    3) Update Angles - The direction you want entities to be launched out
    4) Exit speed - The speed you want entities to launch out of the portal (Default is "Same as input", which means no launching)
    5) Rotate entities (Yes/No/Yaw only) - Whether to rotate entity look direction and velocity

    CVars:
    Code:
    as_command ps.autoload 1
    ps.autoload disables auto-loading on map start if set to 0.

    Server Impact:

    This plugin uses an inefficient method for detecting entities near portals. As you add more portals, you may notice an FPS drop or higher CPU usage. I'm planning to improve this if we ever get anything like an EntityCreated hook for AngelScript.

    The maximum portals allowed (for now) is 32. Each teleport event creates 2 beam entitites that exist for half a second. The worst case scenario is that 96 extra entities exist at one time, which shouldn't be a problem unless a map is near 2000 entities (use cl_entitycount to check this).

    4 sprites and 2 sounds are precached.
    Attached Files Attached Files
    Last edited by w00tguy123; 07-11-2018 at 11:49 PM.
    Love,
    w00tguy

  2. #2
    Banned CryoKeen's Avatar
    Join Date
    Aug 2001
    Location
    United States
    Posts
    4,455

    Re: Portal Spawner

    praise allah and woot and all the hues

  3. #3
    Not in the circlejerk S. H. Lynx's Avatar
    Join Date
    Sep 2009
    Location
    Santiago, Chile
    Posts
    186

    Re: Portal Spawner

    The portals stay on mapchange?

    Servidor Hispano de Sven Co-op

    Current HN: Luces en Babel / Babylon (Steam) - I no longer use S. H. Lynx on my work.
    SteamID

  4. #4
    func_vehicle enthusiaist w00tguy123's Avatar
    Join Date
    Dec 2006
    Location
    U.S. West
    Posts
    1,598

    Re: Portal Spawner

    ^ Nope. When we get persistent file storage I'll add a save function. Temporary files are deleted when the server stops.
    Love,
    w00tguy

  5. #5
    Registered User
    Join Date
    Jan 2016
    Posts
    11

    Re: Portal Spawner

    Very handy, thanks.
    And nice example of how to use the textmenu capabilities of Angelscript.

  6. #6
    Mapper Nih's Avatar  
    Manager
    Join Date
    Dec 2002
    Location
    Denmark
    Posts
    5,484

    Re: Portal Spawner

    Quote Originally Posted by w00tguy123 View Post
    ^ Nope. When we get persistent file storage I'll add a save function. Temporary files are deleted when the server stops.
    Trigger_save and trigger_load can't be used?

  7. #7
    func_vehicle enthusiaist w00tguy123's Avatar
    Join Date
    Dec 2006
    Location
    U.S. West
    Posts
    1,598

    Re: Portal Spawner

    Quote Originally Posted by Nih View Post
    Trigger_save and trigger_load can't be used?
    Wow, that never crossed my mind. I'm going to try this.
    Last edited by w00tguy123; 15-02-2016 at 03:22 PM. Reason: stopped overthinking
    Love,
    w00tguy

  8. #8
    Mapper Nih's Avatar  
    Manager
    Join Date
    Dec 2002
    Location
    Denmark
    Posts
    5,484

    Re: Portal Spawner

    Quote Originally Posted by w00tguy123 View Post
    Wow, that never crossed my mind. I'm going to try this.
    Glad I could be of use

  9. #9
    func_vehicle enthusiaist w00tguy123's Avatar
    Join Date
    Dec 2006
    Location
    U.S. West
    Posts
    1,598

    Re: Portal Spawner

    Download v2 and you'll be able to save/load portals for each map! The trigger_save/load idea worked out great.

    Tips for anyone that wants to save persistent map data with trigger_save:
    - Save multiple keyvalues in one "label" by concatenating them and using quotes ( " ) or \ as a delimiter (because player names can't contain these). Max length of a value is about 1000 characters.
    - Do not use a delay between multiple trigger_saves, you will run the risk of corrupting the map save file. Use a chain of trigger_saves connected with "Trigger after saving" if you need to save multiple values at once.
    Love,
    w00tguy

  10. #10
    func_vehicle enthusiaist w00tguy123's Avatar
    Join Date
    Dec 2006
    Location
    U.S. West
    Posts
    1,598

    Re: Portal Spawner

    Uploaded v3 to fix plugin not working with SC 5.0.2
    Love,
    w00tguy

  11. #11
    Ain't no moebuta tenyuhuang's Avatar
    Join Date
    Jan 2016
    Location
    China
    Posts
    69

    Re: Portal Spawner

    I don't know if it is too much to ask, can we get a function to directly create a portal through chat, without the menu?

  12. #12
    func_vehicle enthusiaist w00tguy123's Avatar
    Join Date
    Dec 2006
    Location
    U.S. West
    Posts
    1,598

    Re: Portal Spawner

    Quote Originally Posted by tenyuhuang View Post
    can we get a function to directly create a portal through chat, without the menu?
    Congratulations, download v4 and you can do the following:

    .ps en = spawns a portal entrance
    .ps ex = spawns a portal exit
    .ps bi = spawns a bidirectional portal

    The portal menu command has also been changed to ".ps" to reduce typing strain.
    Love,
    w00tguy

  13. #13
    Ain't no moebuta tenyuhuang's Avatar
    Join Date
    Jan 2016
    Location
    China
    Posts
    69

    Re: Portal Spawner

    Quote Originally Posted by w00tguy123 View Post
    Congratulations, download v4 and you can do the following:

    .ps en = spawns a portal entrance
    .ps ex = spawns a portal exit
    .ps bi = spawns a bidirectional portal

    The portal menu command has also been changed to ".ps" to reduce typing strain.
    Thanks for the update, this is definitely a lot more convenient than its AMXX counterpart now!

    All I need is learn how to write a simple text menu out of AS, then I can almost kiss AMXX goodbye

  14. #14
    ℍ𝕖𝕝𝕡 Cadaver's Avatar
    Join Date
    Mar 2016
    Location
    Argentina
    Posts
    86

    Re: Portal Spawner

    I love this script, it's very useful, but isn't working any more in 5.04



  15. #15
    func_vehicle enthusiaist w00tguy123's Avatar
    Join Date
    Dec 2006
    Location
    U.S. West
    Posts
    1,598

    Re: Portal Spawner

    I'll try to get this fixed today. The same thing happened with the voice commands plugin.
    Love,
    w00tguy

  16. #16
    func_vehicle enthusiaist w00tguy123's Avatar
    Join Date
    Dec 2006
    Location
    U.S. West
    Posts
    1,598

    Re: Portal Spawner

    Uploaded v5 to fix plugin not working with SC 5.04
    Love,
    w00tguy

  17. #17
    Registered User
    Join Date
    Apr 2016
    Posts
    77

    Re: Portal Spawner

    w00tguy123, very fast Fix thx!

  18. #18
    ℍ𝕖𝕝𝕡 Cadaver's Avatar
    Join Date
    Mar 2016
    Location
    Argentina
    Posts
    86

    Re: Portal Spawner

    Thank you so much for this <3



  19. #19
    incognico nico's Avatar
    Join Date
    Aug 2015
    Posts
    447

    Re: Portal Spawner

    Requests:
    Let us save portals (svencoop/scripts/plugins/store)
    Add a cvar which allows autoloading of saved portals when a map is loaded and there are saved portals for it

  20. #20
    func_vehicle enthusiaist w00tguy123's Avatar
    Join Date
    Dec 2006
    Location
    U.S. West
    Posts
    1,598

    Re: Portal Spawner

    Portals can already be saved to mapname.save in svencoop/maps/ and are autoloaded if the data exists. I should start using /plugins/store though. I'll add the cvar too when I get around to it.
    Love,
    w00tguy

  21. #21
    incognico nico's Avatar
    Join Date
    Aug 2015
    Posts
    447

    Re: Portal Spawner

    Quote Originally Posted by w00tguy123 View Post
    Portals can already be saved to mapname.save in svencoop/maps/ and are autoloaded if the data exists. I should start using /plugins/store though. I'll add the cvar too when I get around to it.
    I've tried that and it didn't work. No .save file was there. IIRC you can't even write anything via AS outside from plugins/store :o

  22. #22
    func_vehicle enthusiaist w00tguy123's Avatar
    Join Date
    Dec 2006
    Location
    U.S. West
    Posts
    1,598

    Re: Portal Spawner

    I just tested and it's working for me on a listen or dedicated server (Windows). You are explicitly saving the portals through the menu right? There isn't an autosave feature. Maybe save files don't work on Linux?

    Quote Originally Posted by nico View Post
    IIRC you can't even write anything via AS outside from plugins/store :o
    AS can't, but trigger_save can (but only to mapname.save).
    Love,
    w00tguy

  23. #23
    incognico nico's Avatar
    Join Date
    Aug 2015
    Posts
    447

    Re: Portal Spawner

    Quote Originally Posted by w00tguy123 View Post
    I just tested and it's working for me on a listen or dedicated server (Windows). You are explicitly saving the portals through the menu right? There isn't an autosave feature. Maybe save files don't work on Linux?



    AS can't, but trigger_save can (but only to mapname.save).
    Explicitly via the menu, twice to be sure lol. So maybe trigger_save does not work on Linux.

  24. #24
    func_vehicle enthusiaist w00tguy123's Avatar
    Join Date
    Dec 2006
    Location
    U.S. West
    Posts
    1,598

    Re: Portal Spawner

    Updated to v6:

    - Added ps.autoload cvar (0/1) for disabling auto-loading of portals.
    - Portal data saved to the /store/ folder.
    - Portals load instantly, quietly, and reload after doing as_reloadplugins.

    There's another step to setting up this plugin now. Create a folder named "PortalSpawner" in /svencoop/scripts/plugins/store/. The plugin will save data files in there to keep your /store/ folder clean.

    Saving will still work if you don't make the folder, but you'll end up with hundreds of files in /store/ if you use this plugin a lot.
    Last edited by w00tguy123; 03-08-2017 at 04:27 AM.
    Love,
    w00tguy

  25. #25
    Registered User
    Join Date
    Jul 2005
    Posts
    35

    Re: Portal Spawner

    Quote Originally Posted by w00tguy123 View Post
    Updated to v6:

    - Added ps.autoload cvar (0/1) for disabling auto-loading of portals.
    - Portal data saved to the /store/ folder.
    - Portals load instantly, quietly, and reload after doing as_reloadplugins.

    There's another step to setting up this plugin now. Create a folder named "PortalSpawner" in /svencoop/scripts/plugins/store/. The plugin will save data files in there to keep your /store/ folder clean.

    Saving will still work if you don't make the folder, but you'll end up with hundreds of files in /store/ if you use this plugin a lot.
    I have all flags as admin, but when I type .ps, it says "You don't have access to that command, peasant"

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •