AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D2] Objects Spawner [2.0 Reloaded] v2.0.6 (Save Objects Supported) (https://forums.alliedmods.net/showthread.php?t=127418)

honorcode23 05-20-2010 22:24

[L4D2] Objects Spawner [2.0 Reloaded] v2.0.6 (Save Objects Supported)
 
21 Attachment(s)
[L4D2] Objects Spawner 2.0
Version 2.0.6

Update of models list: [15/10/2010]
Update of Convars:[15/10/2010]

Description:
The plugin has been completely re-written to add models faster.

This plugin allow administrators with 'Slay' access to spawn different kind of objects trough the admin menu. It will create a new category named 'Spawn Objects' which will contain a few options for the spawning method and render mode. You will be able to spawn Static (Solid), Dynamic (Non-solid) and Physics (Moves and collides with the world) objects which are ordered in a few categories for better navigation.

The plugin cannot guarantee that all the objects will spawn using the 'Physics' method, because not all the models available in-game have Physics information stored on their model files, leaving the engine unable to create them.

*New*
-The plugin is now able to save all the objects into .cfg files as 'Stripper' files base which can be used for the [L4D2] Routing (Dynamic Paths)
plugin.

-To save the objects simply selected the 'Save Objects' option in the menu, or type !savemap in the chat.

-The plugin will save all spawned object's angles, origin and models, includign the solid properties to the file.

-With some knownledge, you can spawn your own 'Hard path' and save it, then delete all spawned objects and proceed with a new path and so on. You can add relays and the object's names at your will.

Video:

http://www.youtube.com/watch?v=6rEponriV_0

*Thanks to superbunny :)

Installation
-Copy the l4d2_spawn_props_2_0.smx file into the sourcemod/plugins folder.
-Copy the l4d2_spawn_props_models.txt file into the sourcemod/data foler.
-DELETE l4d2_spawn_props.smx file if you had a previus version
-Create a new folder name "maps" at sourcemod/data and then inside create three new folders named "stripper", "routing" and "plugin_cache". The plugin is not able to create those folders by itself.

-Restart your server to complete the installation. Note that if you don't restart it, the new category won't appear on the admin menu, but the plugin will be loaded. You can also type !sprefresh to refresh the admin menu.

Both files are required to make the plugin work.

Commands:
There is only two commands right now:

"sm_spawnprop"

Syntax:
Code:

Usage: sm_spawnprop <model> [static | dynamic | physics] [cursor | origin]
-static: Static or solid render mode.
-dynamic: Dynamic or non-solid render mode.
-physics: Physics or moveable render mode.

-cursor: Spawn on cursor.
-origin: Spawn on current position (Stucks players if the model is solid).

Example: !spawnprop models/prop_interiors/toaster.mdl physics cursor

Action: Spawn a <static> (solid) object on <cursor> using model <models/prop_interiors/toaster.mdl>.

RESTRICTION: You cannot use "\" when you define the model path. Use "/" instead.

"sm_sprefresh": Refresh the admin menu if it isnt being showed up.

"sm_prop_rotate"

Syntax:
Code:

Usage: sm_prop_rotate <axys> <angles>

Example: !prop_rotate x 45
Action: Rotates the last object around the 'X' axys 45 degrees.

"sm_prop_removelast": Removes last object.

"sm_prop_removelook": Removes looking object.

"sm_prop_removeall": Removes all Objects

"sm_prop_move": Moves an object within the desired axys

Syntax:
Code:

Usage: sm_prop_move <axys> <distance>

Example: !prop_move x 45
Action: Moves the last spawned object 45 Hammer Units within the X axys.

"sm_prop_setang": Sets the object angles

Syntax:
Code:

Usage: sm_prop_setang <X Y Z>

Example: !prop_setang 0 83 33
Action: Sets the last object angles to X: 0 Y:83 Z:33

"sm_prop_setpos": Sets the object Position

Syntax:
Code:

Usage: sm_prop_setpos <X Y Z>

Example: !prop_setpos 52 173 -43
Action: Sets the last object position to X: 52 Y:173 Z:-33

"sm_grabprop": "Grabs" and object to freely move it. Notice that the angles won't change, only the positiono f the object.

"sm_grablook": Same as "sm_grabprop" but you will grab the looking object instead.

ConVars

A config file will be generated at cfg/sourcemod.

Code:

//Enable the plugin to auto load the object cache?
// -
//Default: "0"
l4d2_spawn_props_autoload "0"

//Should the paths be different for the teams or not?
// -
//Default: "1"
l4d2_spawn_props_autoload_different "1"

// Enable the Decorative category
// -
// Default: "1"
l4d2_spawn_props_category_decorative "1"

// Enable the Exterior category
// -
// Default: "1"
l4d2_spawn_props_category_exterior "1"

// Enable the Foliage category
// -
// Default: "1"
l4d2_spawn_props_category_foliage "1"

// Enable the Interior category
// -
// Default: "1"
l4d2_spawn_props_category_interior "1"

// Enable the Misc category
// -
// Default: "1"
l4d2_spawn_props_category_misc "1"

// Enable the Vehicles category
// -
// Default: "1"
l4d2_spawn_props_category_vehicles "1"

// Enable the Dynamic (Non-solid) Objects in the menu
// -
// Default: "1"
l4d2_spawn_props_dynamic "1"

// Enable the Physics Objects in the menu
// -
// Default: "1"
l4d2_spawn_props_physics "1"

// Enable the Static (Solid) Objects in the menu
// -
// Default: "1"
l4d2_spawn_props_static "1"

Configuring the plugin cache
The plugin now supports auto-load of the objects on round starts. Acts like a basic routing plugin choosing random pre-defined roads. To set it up:

1)Spawn all the objects you want.

2)Save the objects using the 3rd save option. This will save each file with the following format: map_number.txt where map is the current map name (Ex: c5m2_park) and number is the current path number count (4-7-19). These files contain the objects information.

3)Save all the routhes you want (Maximum 20).

4)Go to sourcemod/data/maps/plugin_cache and look for the map you just save the objects for followed by the tag "init". (For example: "c5m2_park_init.txt");

5)Open it and configure the desired paths for each gamemode.

Code:

"PathInit"
{
    "coop"
    {
            "total"    "1"
            "path1"    "c5m2_park_1"
    }

    "versus"
    {
            "total"    "2"
            "path1"    "c5m2_park_6"
            "path2"    "c5m2_park_3"
    }
    "mutation9"
    {
            "total"    "1"
            "path1"  "c5m2_park_2"
    }
}

-Note that you can add any gamemode to the init file. mutation9, mutation3, versussurvival, anything.

-Also, you don't need to puth the map paths in order, for example, c5m2_park_6 can be first instead of c5m2_park_3. It won't matter.

6)Save the files and then reload a map. The objects will appear automatically on the map if the "l4d2_spawn_props_autoload" convar is set to 1

Note*: If the current gamemode is not found, coop pathing will be taken as default, so be carefull.

[Advanced] Editing Models List
To add a new model to the admin menu, add it in the l4d2_spawn_props_models.txt file following this format:
Code:

<model> TAG- <name in menu>

Example: models/mymodel.mdl TAG- My Model 1

Action: Will spawn an object with model 'models/mymodel.mdl' and will show it as 'My Model 1' in the admin menu. Choose the category available in the file (//Category Interior for example).

-To remove a model, simple look for it with any search engine (notepad) and look for the TAG- name, and then simply delete the entire line of that model

Additional Notes:

The code of this plugin has been based on 2 plugins, which are:

-[L4D2] Weapon/Zombie Spawner by Zuko
-[L4D2] Spawn uncommon Infected by AtomicStryker

*Never meant to steal their work, nor take credit from their plugins. I just wrote the plugin i have always wanted, and i just want to share it with you

TO DO:
-Increase Item List
-Create a non-admin version for all players. Objetive: Add support for Fortress servers.
-Add a new category to spawn particles.

Changelog:
Code:

2.0.6
-Added sm_grablook command which will allow you to grab the looking object, instead of the last one
-Fixed a few code bugs

2.0.5e
-Fixed the plugin not checking if the autoload was enabled.

2.0.5d
-Added sm_prop_move command.
-Added sm_prop_setang command.
-Added sm_prop_setpos command.
-Added sm_grabprop command.
-Added the l4d2_spawn_props_autoload_different ConVar.
-Fixed Delete Looking Entity code.

2.0.5c
-Fixed double load on map starts.

2.0.5b
-Added DieTeetasse's suggestion to skip replacing ' for ".

2.0.5a
-Fixed the angles not being loaded properly on autoload.

2.0.5
-Added the autoload feature
-Added some requested commands

2.0.4
-Reorganize the menu.
-Added the 'Load Objects' option.
-Added new ways to save the files.

2.0.3a
-Added 'Delete Last Object' option
-Plugin won't save anymore the deleted props on the file.

2.0.3
-Added the possibility to save the objects into stripper based files.

2.0.2
-Added a log feature to follow all the objects spawned
-Added a command to refresh the admin menu if it doesnt show up after plugin load-reload.

2.0.1a
-Fixed small (but not less important) code typo.

2.0.1
-Fixed the category not being visible on the admin menu.
-Added a new option to edit the last spawned prop (Move and Rotate).

2.0
-Completely re-written the plugin which contains all the bugs fixed and has a few other preventions.

1.1
-Added "Spawn On Cursor" function for Physics (AKA: Solids) spawns.
-Added Random Colors for cars, yellow for taxis and white for police cars
-Cleaned some code


1.0
- Initial Release

*If you find any bug, please make sure you post it here!

bao2012 05-21-2010 00:12

Re: [L4D2] Objects Spawner
 
could you give me name list of dynamic/physic?

alexip121093 05-21-2010 00:16

Re: [L4D2] Objects Spawner
 
Quote:

Originally Posted by bao2012 (Post 1186552)
could you give me name list of prop/physic?

3 ways

1: type listmodels in console
2: Use l4d2 authoring tools-- model viewer
3: use GCFScape to extract pak01_dir.vpk

mommafish 05-21-2010 00:46

Re: [L4D2] Objects Spawner
 
is this something like l4dBuilderEnabler that disables GIVE command?

NoPaSs[BG] 05-21-2010 02:13

Re: [L4D2] Objects Spawner
 
just tested and
not all props were spawned but i think you just need to fully full the plugin :)
Please make the spawn infront or in the side of crosshair for unsolid too
this is from me

crazydog 05-21-2010 07:34

Re: [L4D2] Objects Spawner
 
I also would like it if the props spawned at the crosshair instead of below the player.

Also, would there be a way to set the vehicle colors? Right now all you get is the white ones, and there's something unsettling about a white taxi. :P

honorcode23 05-21-2010 16:19

Re: [L4D2] Objects Spawner
 
Updated 1.1

-Added "Spawn On Cursor" function for Physics (AKA: Solids) spawns.
-Added Random Colors for cars, yellow for taxis and white for police cars
-Cleaned some code

No new Cvars, there is no need to delete the old CFG.

Open for more suggestions

Acecombat2 05-21-2010 20:22

Re: [L4D2] Objects Spawner
 
Spawn Fortification like barrice in menu list? lazy to find this god damn list.

delirium_trigger 05-22-2010 20:18

Re: [L4D2] Objects Spawner
 
Does this plugin in particular conflict with other plugins that make use of the give command?

Left Fort Dead
and
L4D Build Enabler

both of those plugins are similar to yours. However, they caused complications with plugins that spawned weapons (Tankbuster, L4D Points, etc)

Does this conflict with any other mods as well?

Spanner 05-23-2010 02:57

Re: [L4D2] Objects Spawner
 
Why not put the entities in the admin menu, yes it will be long but im sure overall it will be easier to use.


All times are GMT -4. The time now is 07:51.

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