Synergy

Synergy

View Stats:
Nebula Oct 28, 2017 @ 2:12pm
Many custom maps don't spawn the player with suit/hud
Hi,

So I managed to start my own server with custom maps (I use FastDL with sv_downladurl) and there are many maps that I change to where the player spawns with no "suit" or the hud (can't sprint, can't change weapons, etc.) and I can't figure this out. There are some custom maps that spawn me with the suit/hud. I actually tried many of these in a singleplayer (listen server) and the same thing happens.

What's the big idea? I go through the trouble of getting my webhost to work for like 2 weeks and once I finally solve that problem now I gotta deal with this.

If you need more information about the problem just let me know. Any help or suggestions I appreciate and I'll try.

Thank you.
< >
Showing 1-3 of 3 comments
Balim Oct 28, 2017 @ 10:45pm 
Many custom maps require an edt to edit how it functions, including what weapons to spawn with, and weather picking up a weapon should give to all players and allow players to respawn with said weapon.
Try creating a text document, rename it to "mapname.edt" and make sure full file extensions are shown, or it could be adding a hidden .txt to the end of the file name, which would make it not work.
Inside the edt put in something along the lines of:
"mapname" { entity { create {classname "info_player_equip" values { targetname "syn_equipment_base" startdisabled "0" item_suit "1" weapon_crowbar "1" weapon_physcannon "1" } } //To allow all players to get the pistol when the first one is picked up: create {classname "logic_auto" values { spawnflags "1" OnMapSpawn "weapon_pistol,AddOutput,OnPlayerPickup ppickup:Enable::0:-1,0,-1" OnMapSpawn "weapon_pistol,AddOutput,OnPlayerPickup ppickup:EquipAllPlayers::0.1:1,0,-1" } } create {classname "info_player_equip" values { targetname "ppickup" startdisabled "1" weapon_pistol "1" ammo_pistol "36" } } } }
You can add any other weapons to that list as well.
Edit: You must put this edt file in the same folder as the map, on the server, not the client.
You can also configure SourceMod to automate most of this for all maps, but sometimes you will need more configurations for certain sequences, which would be easier to do in an edt.
Last edited by Balim; Oct 28, 2017 @ 10:50pm
Nebula Oct 29, 2017 @ 6:46am 
So before I begin doing the edt files, I have some questions:

Do I have to do this for all maps that don't spawn the player with the suit?

You mentioned doing this with sourcemod. If I chose to pursue that method, how would I go about doing it? (I'll still try manually creating the edt file, I just want to try both methods)

I'm assuming instead of putting "mapname" I'm actually putting the name of the map right? You just used "mapname" in your example as some sort of template to help me get started?

You mentioned things about some maps having "specific events" or something of the sort. I wouldn't know which of these maps something like that would happen. Could you describe what some of these would be?


Sorry for so many questions but it does help me out knowing this information. I just want to make sure I execute all of this properly (my goal is to get these maps working properly on the first try).

Thank you for your help though I do appreciate it.
Balim Oct 29, 2017 @ 6:56pm 
You would have to do it for each map, and yes, the mapname is to be replaced by the map name.
Specific events would be things like going in to a cutscene, or having spawn points that have to change when you get to a new part of the map.
It could also be sequences when weapons or the suit are stripped from the players.
These can also be sequences which use give commands to give weapons to players, which won't trigger the OnPlayerPickup output. It is a bit hard to describe, most of the time you would need to either get the original vmf, or decompile the map to figure out how to work the sequence with multiple players.

As for SourceMod, you would have to write a plugin that essentially just gives all players suits on spawn, and runs through active weapons which would be hooked OnPlayerPickup on map start. Or possibly creating an info_player_equip with the weapon/ammo of said weapon, as an example:
public void OnMapStart() { int suitspawn = CreateEntityByName("info_player_equip"); DispatchKeyValue(suitspawn, "item_suit","1"); DispatchSpawn(suitspawn); ActivateEntity(suitspawn); HookEntityOutput("weapon_pistol","OnPlayerPickup",EntityOutput:weappickup); HookEntityOutput("weapon_smg1","OnPlayerPickup",EntityOutput:weappickup); } public void weappickup(const char[] output, int caller, int activator, float delay) { char weapname[64]; GetEntityClassname(caller,weapname,sizeof(weapname)); UnhookEntityOutput(weapname,"OnPlayerPickup",EntityOutput:weappickup); int weapspawn = CreateEntityByName("info_player_equip"); DispatchKeyValue(weapspawn, weapname,"1"); ReplaceString(weapname,sizeof(weapname),"weapon_","ammo_"); if (StrEqual(weapname,"ammo_rpg",false)) Format(weapname,sizeof(weapname),"ammo_rpg_round"); else if (StrEqual(weapname,"ammo_crossbow",false)) Format(weapname,sizeof(weapname),"ammo_xbowbolt"); else if (StrEqual(weapname,"ammo_frag",false)) Format(weapname,sizeof(weapname),"ammo_grenade"); else if (StrEqual(weapname,"ammo_shotgun",false)) Format(weapname,sizeof(weapname),"ammo_buckshot"); //This will only give you as much as the sk_max_ variable will allow, so you can safely leave this at a big number DispatchKeyValue(weapspawn, weapname,"500"); DispatchSpawn(weapspawn); ActivateEntity(weapspawn); AcceptEntityInput(weapspawn,"EquipAllPlayers",activator); }
This would work for any weapon, just duplicate the HookEntityOutput line and replace the weapon_pistol with which ever weapon.
Last edited by Balim; Oct 31, 2017 @ 2:37pm
< >
Showing 1-3 of 3 comments
Per page: 1530 50