![]() |
Re: [CZ] Changing model directory "on the fly"?
Okay. Thanks for going to all this trouble, it's much appreciated :)
|
Re: [CZ] Changing model directory "on the fly"?
Np, though hl is fighting me along the way though lol.
I have it at the point where it should work but then I get a "bad character in client command" error when I join my server. That makes absolutely no sense at all, the path only gets the mapname added to the start :/ What goes in: weapons/emp_1.wav What comes out: 2fort/weapons/emp_1.wav All is good, no precache errors, the file was checked to exist and I even unhooked EmitSound to be sure. Heres it so far, I did some re-designing so only the sound stuff is in right now. The plugin framework is turning out nice too, so much easier now :) Code:
#include <stdio.h> I put a breakpoint just before PrecacheSound returns, the updated path is normal with no unusual characters of any kind. That is whats bothering me so much. Only a small delay though, this will get fixed. |
Re: [CZ] Changing model directory "on the fly"?
Hmm.. not being knowledgable about these things I had a look at Steampowered about this...and there was a particular support query about this...
Does this help? http://steampowered.custhelp.com/cgi...i=&p_topview=1 |
Re: [CZ] Changing model directory "on the fly"?
Thanks but the server is running on the same machine I play/develop on and the problem goes away when my code is disabled.
I'm going to take another look at it now but I can't see anything wrong. |
Re: [CZ] Changing model directory "on the fly"?
Lazy, for the player models, you will certainly need to set them in the client's key/value data.
Another tip, don't bother converting forward slashes to backwards slashes, even on Windows. Always use forward slashes, everywhere. And at least one big mistake: define your local character arrays as static if you return pointers to them, else they are deallocated when the function exits. |
Re: [CZ] Changing model directory "on the fly"?
I never return pointers to local variables, what I did is make the caller pass a pointer to it's own local variable which gets the new string copied into it.
And the only time I convert to backslashes is when I use fopen to check if the file exists or not, but I still have no idea why I'm getting this error. OR, is hl keeping a pointer to szNewpath when I call PRECACHE_SOUND? That would explain a lot but I'd assume it makes a copy first. [Added] Well, it looks like HL needs a copy of the string. The problem was solved by changing szNewpath to STRING( ALLOC_STRING( szNewpath ) ). Bah, I would never keep a string pointer like that. Thanks PMB, now I can get back to finishing this thing http://forums.bots-united.org/images...es/biggrin.gif |
Re: [CZ] Changing model directory "on the fly"?
...And dont worry about register thingy. c & cpp copilers are "smart" enough to do it automaticaly. Check youreself by compiling & re-engeneering the output code. Btw why dont make those lil func's inline or macros?
|
Re: [CZ] Changing model directory "on the fly"?
The only time I read code output was when I was trying to make my function hooking class, took me a long time to get it right but I finally got that JMP instruction to work :)
Anyway, which functions are you talking about? The BEGIN_xxx functions are just macros that handle setting up the dll automatically and hooking various APIs. |
Re: [CZ] Changing model directory "on the fly"?
Quote:
Having the directory structure like this will mean that your mod root directory will be rather full of "extra" entries... Would it be better to have a new directory to dump your map specific models/sounds into? Something like "MOD ROOT / lazy / %s / weapons / ..." etc or is that a different kettle of fish entirely? Cheers for now |
Re: [CZ] Changing model directory "on the fly"?
I don't think its possible for sounds since hl will only play whats inside the sound directory and its subdirectories.
It used to be possible under won, in tfc I would have it speak sounds from cs under tfc by using something like ../../../../cstrike/sound/terwin and it worked for those who had cs installed. But since steam that sort of thing wont work, which is why I chose that layout. |
All times are GMT +2. The time now is 02:46. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.