ULX

Author Topic: Model not showing for OSX users *only on a dedicated*  (Read 4619 times)

0 Members and 1 Guest are viewing this topic.

Offline krooks

  • Sr. Member
  • ****
  • Posts: 382
  • Karma: 32
  • I don't like video games.
    • Diamond Krooks
Model not showing for OSX users *only on a dedicated*
« on: January 07, 2011, 05:24:22 PM »
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: [Select]
// 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' );

If not, does anyone know where I might start to track down this problem?
Thank you
« Last Edit: January 07, 2011, 05:35:00 PM by krooks »
My TTT server. Join the fun!

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Model not showing for OSX users *only on a dedicated*
« Reply #1 on: January 07, 2011, 05:46:55 PM »
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.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Model not showing for OSX users *only on a dedicated*
« Reply #2 on: January 07, 2011, 05:49:33 PM »
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.
Experiencing God's grace one day at a time.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Model not showing for OSX users *only on a dedicated*
« Reply #3 on: January 07, 2011, 09:13:30 PM »
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)
« Last Edit: January 07, 2011, 09:16:27 PM by JamminR »
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline krooks

  • Sr. Member
  • ****
  • Posts: 382
  • Karma: 32
  • I don't like video games.
    • Diamond Krooks
Re: Model not showing for OSX users *only on a dedicated*
« Reply #4 on: January 07, 2011, 10:43:54 PM »
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: [Select]
addmodel( 'models/pyroteknix/skyrocket' );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: [Select]
// 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

Pyroteknix/lua/components/entities/skyrocket/shared.lua
Code: [Select]
// 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 );

Is it even necessary to have this twice like this?
« Last Edit: January 07, 2011, 11:04:46 PM by krooks »
My TTT server. Join the fun!

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Model not showing for OSX users *only on a dedicated*
« Reply #5 on: January 08, 2011, 12:10:34 AM »
There's probably more files than that, I don't see any spawn code in there. Can you share the other files included in the addon with us?
Experiencing God's grace one day at a time.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Model not showing for OSX users *only on a dedicated*
« Reply #6 on: January 08, 2011, 09:49:35 AM »
Krooks, how big is the addon zipped?
If it's large, try zipping it without the models and attach it to a post.
If it's not too big, zip it all and attach it.

If you're attempting to learn how to do it without us doing all the work, we'll be more than happy to look and say something like "check out the area of line <#> of file <z>.
If you really don't care, well, it's distraction from our normal routine and an interesting challenge.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline krooks

  • Sr. Member
  • ****
  • Posts: 382
  • Karma: 32
  • I don't like video games.
    • Diamond Krooks
Re: Model not showing for OSX users *only on a dedicated*
« Reply #7 on: January 09, 2011, 02:02:26 AM »
Thanks again for all of the replies and willingness to help, ulysses must be the mature gmod hangout LOL
I'm sort of in learning mode right now, but I will zip it and get you guys a copy so that we can all be on the same page.

Something interesting happend just now, though.
I deleted wire svn and the wire model pack (client side), and now it's visible!
(which makes me wonder if wire also conflicts with windows users as well... I will test it when I have time and will report back).

(my) Pyroteknix
« Last Edit: January 09, 2011, 02:08:49 AM by krooks »
My TTT server. Join the fun!

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Model not showing for OSX users *only on a dedicated*
« Reply #8 on: January 09, 2011, 10:47:01 AM »
the mature gmod hangout LOL
I'm sort of in learning mode right now

Thanks!
We like to think so, and like to help those who are mature enough to look before leaping (ie, search/read our forums before just asking a question that's already been asked), and ask valid questions/provide valid information about errors they are getting (ie, "it don't work" provides no useful information)

Well, then, if it works, doesn't sound like I need to take a look at it.
Lots of ideas of why/where conflicts could be occurring.
Primary -
Wire is huge. They may have had to work around quirks of Gmod that modify some spawn behavior. Old Pyro code may not handle it well.
Wire has had many authors. One of its bits could cause conflict.
Pyro may just have a function due to global use of a variable that wire does too, bad function use, something due to it's age/author's uncertainty.
Any mix of above.

EDIT - Took a quick look.
I don't know tools well, only bits I've ever dealt with was my Prop Balloon maker. It never made it to release more than from here.
(In other words, I never really finished it, and it's current quality isn't worth Facepunch/gmod.org)
Two things I see off hand
1) He uses umsg in the actual tool. (That may not be bad, but Megiddo found some type of flaw recently), wire's use of them may conflict
2) He add's wire support in line 18 of lua\components\entities\init.lua . It's possible that format is old, no longer used.
May check for other 'wire support' within the files using your operating systems text finder. Comment it out, add wire back, see if it fixes it.
« Last Edit: January 09, 2011, 11:06:33 AM by JamminR »
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline krooks

  • Sr. Member
  • ****
  • Posts: 382
  • Karma: 32
  • I don't like video games.
    • Diamond Krooks
Re: Model not showing for OSX users *only on a dedicated*
« Reply #9 on: January 10, 2011, 11:47:44 PM »
Alright so I've done some messing around just to get a better idea of exactly where the problem is stemming from, and heres what I've found.
Windows, no problems.
OSX problems:
•Single player, no problems with or without wire.
•On a server, with client wire, invisible rockets.
•On a server, without client wire, visible rockets.
•On a server that does not have wire, but client has wire, invisible.

So, from this we see that the problem has to do with clientside wire, and the fact that the client is connected to a server, Otherwise it is fine.

I commented out the wire bits in all of the pyroteknix lua files on the server, and got rid of my client side pyroteknix addon (so that I knew i was using the servers version), and still had problems with wire installed on client.
My TTT server. Join the fun!