![]() |
Server Commands
How do you get a map to run a cfg file running server commands? (Special rules for the map)
|
Re: Server Commands
i dont believe you can make a MAP exec a .cfg file on your server.
just make the cfg, get in the map, open console and do: exec myspecialcfg.cfg i am not aware of a map being able to control server commands or execute external files for server commands anyone else? |
Re: Server Commands
A very simple metamod plugin can be written that would do what you want. It's a matter of 5 minutes, possibly even less. I'm sure Mark would love writing something like this :)
|
Re: Server Commands
Is there any way to hack a map file's entities to run a server command without using metamod, like bot_add or mp_hostagepenalty 0. Like in a .res, .ent, .wad, .pak, or whatever. This will be used in a Single Player Game, so I dont even think metamod will work even if I wanted to use it.
|
Re: Server Commands
Go to www.metamod.org and look for the single player version of MetaMod.
Than go to www.amxmod.net and search for the plugin map_cfg... From your signature I assume you know how to get and install AMX ;). |
Re: Server Commands
The thing is:
I don't want to use metamod! Im working on a project for czero and I dont want to include metamod in the project. If there's no other way, I'll have to drop the idea... Would it be possible to create a simple plugin (non-metamod) that would only use the required functions to run a cfg file for a map of the same name? ie: have the plugin run de_dust.cfg when starting de_dust.bsp |
Re: Server Commands
Well, you could do it the hard way:
- grap the HPB Bot source code - remove the bot specific part leaving only the hooking stuff (or is this already available somewhere?) - add some code to load map specific configs This is like reinventing the wheel... |
Re: Server Commands
Quote:
Are there any whole files that can be removed? And this is for making a non-metamod plugin correct? Like I'd load it up in the target line or something like that? |
Re: Server Commands
You would use it instead of metamod or a bot with all implications this will produce.
|
Re: Server Commands
The only way to do this, as Terran says, is to create a hook DLL (like a bot, like metamod). That is, a DLL that you will specify in the liblist.gam instead of the czero DLL. That would require a minimum of coding skill, though.
In the HPB_bot template, for example, you need to keep engine.cpp, dll.cpp, linkfunc.cpp ; then you need to remove all third party code from all the functions in dll.cpp and engine.cpp and only let the engine calls happen, and add your config file parsing code in ServerActivate(). |
Re: Server Commands
the hpb source (and the 3-in1 pack sdk-metamod-hpb source) does not include a file named linkfunc.cpp
Also, it looks as though the HPB source from the 3-in-1 source pack hooks into metamod? What would be an appropiate source to use for a non metamod hook? (non metamod bot source) |
Re: Server Commands
download hpbbot 3.0 source.
it's not a metamod plugin. |
Re: Server Commands
ok this looks much better
can i delete all the header files too? |
Re: Server Commands
maybe you should look through it first.
|
Re: Server Commands
well, since I have no coding experience and lack the patience for a forum walkthrough, if ne1 is willing to create this thingy, they will get full credit for the design/coding of the thing, to be used in a new mod. PM me if ne1's interested! It's not an esential part of the mod, but it sure would make a nice feature!
|
Re: Server Commands
You're writing about a new mod but have no coding experience? Than I assume you assist somebody else who is actually programming the mod? If it's a real mod like DOD, CS etc. with a new client.dll than you should integrate this feature directly into the mod...
|
Re: Server Commands
he was trying to make a metamod plugin but now has given up due to no coding experience and is asking someone else to make it for him.
|
Re: Server Commands
actually if you just install HPB_bot version 3.0 and set it to not actually load any bots you can use HPB_bots map specific config stuff to exec server commands. This was really intended to have diff bot settings for each map but can also be used to exec other server commands. So you probably wouldn't need to write any code at all. Assuming you can get HPB_bot to load under czero.
There are other utilities around that already allow you to have map specific configs. One is halfd I can think of top my head but it is linux only. |
Re: Server Commands
He wants that feature for a single player game therefore halfd isn't an option.
|
Re: Server Commands
meanmod has scenario files for every map, but i think he wants something a little less full featured
|
Re: Server Commands
Yes, I can't wait for mean source to be released so i can try to add czero support too. I have MUCH to learn in coding tho...
|
Re: Server Commands
you could try to write it in perl :P (just a weird idea crossed my mind)
|
All times are GMT +2. The time now is 15:19. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.