.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > SDK Programming discussions > Half-Life 1 SDK
Half-Life 1 SDK For developments focused around Half-Life (and its mods) Half-Life

Reply
 
Thread Tools
[CZ] Changing model directory "on the fly"?
Old
  (#1)
Rusty Le Cyborg
Complete Amateur
 
Rusty Le Cyborg's Avatar
 
Status: Offline
Posts: 52
Join Date: May 2005
Default [CZ] Changing model directory "on the fly"? - 28-06-2005

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?
  
Reply With Quote
Re: [CZ] Changing model directory "on the fly"?
Old
  (#2)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: [CZ] Changing model directory "on the fly"? - 28-06-2005

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?



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: [CZ] Changing model directory "on the fly"?
Old
  (#3)
Rusty Le Cyborg
Complete Amateur
 
Rusty Le Cyborg's Avatar
 
Status: Offline
Posts: 52
Join Date: May 2005
Default Re: [CZ] Changing model directory "on the fly"? - 28-06-2005

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?

Last edited by Rusty Le Cyborg; 28-06-2005 at 23:06..
  
Reply With Quote
Re: [CZ] Changing model directory "on the fly"?
Old
  (#4)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: [CZ] Changing model directory "on the fly"? - 29-06-2005

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.



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: [CZ] Changing model directory "on the fly"?
Old
  (#5)
Rusty Le Cyborg
Complete Amateur
 
Rusty Le Cyborg's Avatar
 
Status: Offline
Posts: 52
Join Date: May 2005
Default Re: [CZ] Changing model directory "on the fly"? - 29-06-2005

So it would have to be part of Meta Mod?

Could it not be done with the original dll files or something similar?
  
Reply With Quote
Re: [CZ] Changing model directory "on the fly"?
Old
  (#6)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: [CZ] Changing model directory "on the fly"? - 29-06-2005

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.



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: [CZ] Changing model directory "on the fly"?
Old
  (#7)
Rusty Le Cyborg
Complete Amateur
 
Rusty Le Cyborg's Avatar
 
Status: Offline
Posts: 52
Join Date: May 2005
Default Re: [CZ] Changing model directory "on the fly"? - 29-06-2005

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
  
Reply With Quote
Re: [CZ] Changing model directory "on the fly"?
Old
  (#8)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: [CZ] Changing model directory "on the fly"? - 29-06-2005

Download a simple metamod plugin from our filebase that comes with source code, and use it as an example on how to build yours



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: [CZ] Changing model directory "on the fly"?
Old
  (#9)
Rusty Le Cyborg
Complete Amateur
 
Rusty Le Cyborg's Avatar
 
Status: Offline
Posts: 52
Join Date: May 2005
Default Re: [CZ] Changing model directory "on the fly"? - 01-07-2005

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
  
Reply With Quote
Re: [CZ] Changing model directory "on the fly"?
Old
  (#10)
Lazy
Member
 
Lazy's Avatar
 
Status: Offline
Posts: 236
Join Date: Jan 2004
Location: Toronto, Ontario, Canada
Default Re: [CZ] Changing model directory "on the fly"? - 02-07-2005

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

Last edited by Lazy; 02-07-2005 at 07:58..
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com