.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   Half-Life 1 SDK (http://forums.bots-united.com/forumdisplay.php?f=33)
-   -   [CZ] Changing model directory "on the fly"? (http://forums.bots-united.com/showthread.php?t=4158)

Rusty Le Cyborg 28-06-2005 20:33

[CZ] Changing model directory "on the fly"?
 
Hi there

Just a quick question for those more knowledgable than I :)

Is it possible to make a dll which will change CS or CZ's default model directory?

Now.. the explanation...

A while ago "PAF" released the Hostitron which is a plugin for Meta Mod which changes the Hostage models dependant on which map is loaded.

Last year sometime (with help from these forums) Dead_Bwoy released Environskin for CZ which, using a new botprofile.db file, allowed you to choose map specific skins for player models after running a server cfg file.

What I want to know is, rather than using Botprofile.db etc, is it not possible to tell the CZ executable that the default model directory is "czero/models/player/cs_downed_cz/" rather than "czero/models/player"?

This would just be for offline play, so any "hooking" would not interfere with VAC2.

Can anyone help with this?

Pierre-Marie Baty 28-06-2005 21:16

Re: [CZ] Changing model directory "on the fly"?
 
Perhaps yes, if you hook pfnSetModel(), when you detect that the model being passed is something like "*/*/player" just concatenate the map name
Code:

sprintf (model_name, "old_model_base_path/%s/player/etc.", STRING (gpGlobals->mapname));
You see the idea?

Rusty Le Cyborg 28-06-2005 21:55

Re: [CZ] Changing model directory "on the fly"?
 
Hmm.. I see what you mean, and that is how I envisaged it (I think!) but i truly have no idea how to achieve this...

Ideally it would look for a "map/player/whatever..." models. I had thought it would be easier with cl_minmodels set to 1 so you would only need two models per map (i.e. Leet and GIGN).

If it does not find the correct map folder, then perhaps it would default to the original model directories... not sure how this would work though.

Is this a big thing for a knowledgable person to achieve? (i.e.... not me! ???:( )

<edit>

If this IS possible, I presume it would only be a matter of adding a new directory for hostages to be map specific too?

Pierre-Marie Baty 29-06-2005 00:54

Re: [CZ] Changing model directory "on the fly"?
 
It should be very simple to do, at least in the form of a metamod plugin. It could be a matter of 20 minutes.

Yes you can start writing it yourself and post here when you get into trouble, we'll gladly help you out.

Rusty Le Cyborg 29-06-2005 01:24

Re: [CZ] Changing model directory "on the fly"?
 
So it would have to be part of Meta Mod?

Could it not be done with the original dll files or something similar?

Pierre-Marie Baty 29-06-2005 06:07

Re: [CZ] Changing model directory "on the fly"?
 
You have to program it somehow. There are two ways: either you do a metamod plugin that does that, either you do the same thing with a hook DLL, that is, a DLL that will sit between the engine and the game DLL (like the early HPB_bot did). This will be a server-side thingy, anyway.

Rusty Le Cyborg 29-06-2005 19:50

Re: [CZ] Changing model directory "on the fly"?
 
Looks like I'm going to have to do a lot of reading up :)

..any pointers to a good place to start?

Cheers for now

Pierre-Marie Baty 29-06-2005 21:03

Re: [CZ] Changing model directory "on the fly"?
 
Download a simple metamod plugin from our filebase that comes with source code, and use it as an example on how to build yours :)

Rusty Le Cyborg 01-07-2005 02:02

Re: [CZ] Changing model directory "on the fly"?
 
Now then... after much discussion with PM it seems that I would need a basic knowledge of programming to understand the plug-in concept... and I am completely lost now :)

I wonder if anybody here might like to assist me by writing a plug-in for me?

Basically, what it should do is -

On map load... check map name... then make the default player model and hostage model directory used for that map something like "%s/player" or "%s/hostage", if there is no directory like that then it should use defaults...

Meta Mod would be good, but I was wondering about some kind of modified dll file. Though I guess Meta Mod is safer as far as VAC2 goes...

If anyone is able to help I'd be much obliged.

Cheers for now

PS - Thanks to PM for all his help/explanations so far :)

Lazy 02-07-2005 06:56

Re: [CZ] Changing model directory "on the fly"?
 
So basically you want it to change models/player/terrorist/terrorist.mdl to models/mapname/terrorist/terrorist.mdl?

It may be possible but an inconvenience if you don't have a fast download server, I don't have CS installed anymore so I have no idea how many models there are to change.

If you can be very specific on what you want to happen I will write a plugin to do this for you.
I gotta write a team balancer for someone anyway so might aswell grab some coffee and work on both.

*goes off to write new mm plugin framework*

[Added]
Damn, I read the z backwards.
I don't have CZ but that shouldn't be a problem, I'll test it on another mod but you'd have to let me know how it works.
There shouldn't be any problems though :)


All times are GMT +2. The time now is 18:33.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.