General > Developers Corner

Model not showing for OSX users *only on a dedicated*

(1/2) > >>

krooks:
Hey everyone, this is not my code, but it is a long abandoned project, Pyroteknix, or "Skyrocket"
I use it on my server (as far as I know I'm the only server that uses it lol).

First of all, server is Linux, with fast DL's enabled. All files download correctly.

Symptoms:
OSX users cannot see the skyrocket model when spawned through the skyrocket tool *however* the model CAN be spawned from the Q menu, and it is visible.
When spawned with the tool the user sees nothing, not even an error, so it knows you have it, it's just invisible for some reason.

I have tried adding the addon to clientside addons folder with the same results, but interestingly it worked in single player.

Windows users have no issue with this.
I tracked down a file called sv_resources.lua where it looks like the developer was a little confused, could this be the issue?

--- Code: ---// this entire file sucks and i dont even know if it works!



// do I even need to do all this?

local function addmodel( f )

    resource.AddFile( f.. '.mdl' );

    resource.AddFile( f.. '.phy' );

    resource.AddFile( f.. '.dx80.vtx' );

    resource.AddFile( f.. '.dx90.vtx' );

    resource.AddFile( f.. '.sw.vtx' );

    resource.AddFile( f.. '.vvd' );

end



// attempt to add the model.

addmodel( 'addons/pyroteknix/models/pyroteknix/skyrocket' );

addmodel( 'models/pyroteknix/skyrocket' );



// material.

resource.AddFile( 'addons/pyroteknix/materials/pyroteknix/skyrocket.vmt' );

resource.AddFile( 'materials/pyroteknix/skyrocket.vmt' );

resource.AddFile( 'addons/pyroteknix/materials/pyroteknix/skyrocket.vtf' );

resource.AddFile( 'materials/pyroteknix/skyrocket.vtf' );



// sounds.

resource.AddFile( 'addons/pyroteknix/sound/pyroteknix/skyrocket_explode.mp3' );

resource.AddFile( 'sound/pyroteknix/skyrocket_explode.mp3' );

resource.AddFile( 'addons/pyroteknix/sound/pyroteknix/skyrocket_launch.wav' );

resource.AddFile( 'sound/pyroteknix/skyrocket_launch.wav' );
--- End code ---

If not, does anyone know where I might start to track down this problem?
Thank you

JamminR:
Well, I'm reasonably sure the problem doesn't lie in that file if Windows can see it but not OSX.
However, you can clean it up considerably by removing all the lines where the original author tried to point to /addons folders.
Unless Garry changed something (and, its quite possible he has since I last worked with other addons myself), addons is a virtual folder.
addons/mymod/materials/mymod would look like <gmod root>/materials/mymod/* to the game, so paths would be 'materials/mymod/blah'

As for the OSX not seeing it, look in your actual skyrocket tool files, I'd bet (a little) money there's a capital letter somewhere in the model/texture name setup somewhere.

Megiddo:
As JamminR said, your problem doesn't lie in that file. Since you say they can spawn the model from the spawn menu just fine, they do have the model.

JamminR:
OH oh oh! Ding ding ding ding!
I just remembered also; .VMT files are basic text files describing folder and lighting/texture settings of models.
If you can't find any of the tools lua code that refers to one of the models with a capital/mixed case letter, try looking in the .vmt files.
(Or, maybe, have you checked that all the actual file names are in lower case?)

EDIT - After re-reading above posts, Q wouldn't work either if it were a mixed case issue of a file name or in the vmt.
Ignore this post (other than learning about the vmt)

krooks:
Thanks for the quick replies.
I cleaned up that file as you suggested, JamminR, then had a look at every lua file and VMT files, I saw no capitals, although i found two files that are nearly identical which both mention skyrocket.mdl, both with the same (correct) path.

I think the whole plugin may be really sloppy with redundant code, could this cause a problem?

I then went back to the code I posted before, and noticed this:

--- Code: ---addmodel( 'models/pyroteknix/skyrocket' );
--- End code ---
Thought I struck gold! Added .mdl to the end of skyrocket and... no luck :*( lol

As you can probably tell already I am completely new to this.

I'll go ahead and post the only code that mentions the model... Interestingly it is not mentioned once within the tool file itself. The tool must call it from these files?

Pyroteknix/lua/components/entities/shared.lua

--- Code: ---// basic .

ENT.Type             = 'anim';

ENT.Base             = 'base_wire_entity';

ENT.PrintName        = '';

ENT.Author            = '';

ENT.Contact            = '';

ENT.Spawnable        = false;

ENT.AdminSpawnable    = false;



// model.

ENT.model = 'models/pyroteknix/skyrocket.mdl';

util.PrecacheModel( ENT.model );





// think.

function ENT:Think( )

    // fast!

    self.Entity:NextThink( CurTime( ) + 0.01 );

   

    local rocket = self.Entity.rocket;

   

    if ( rocket && !rocket:think( ) ) then

        if ( SERVER ) then

            if ( !self.Entity.detonated ) then

                self.Entity.detonated = true;

               

                // fireworky goes 'asplody!

                local fxdata = EffectData( );

                fxdata:SetOrigin( self.Entity:GetPos( ) );

                util.Effect( 'skyrocket_pop' , fxdata );

       

                // hide.

                self.Entity:SetNotSolid( true );

                self.Entity:SetMoveType( MOVETYPE_NONE );

                self.Entity:SetNoDraw( true );

               

                rocket:load_stars( self.Entity.stars );

            else

                if ( !rocket:stars_think( ) ) then

                    self.Entity:Remove( );

                end

            end

        end

    end

end
--- End code ---

Pyroteknix/lua/components/entities/skyrocket/shared.lua

--- Code: ---// basic .

ENT.Type             = 'anim';

ENT.Base             = 'base_gmodentity';

ENT.PrintName        = '';

ENT.Author            = '';

ENT.Contact            = '';

ENT.Spawnable        = false;

ENT.AdminSpawnable    = false;



// model.

ENT.model = 'models/pyroteknix/skyrocket.mdl';

util.PrecacheModel( ENT.model );
--- End code ---

Is it even necessary to have this twice like this?

Navigation

[0] Message Index

[#] Next page

Go to full version