1. Post #1
    Gold Member
    The Best's Avatar
    August 2005
    1,085 Posts
    I have 2 problems with my model, first of all, it's a player model, and the first problem is that I am able to see it in the player model selection menu, but when I select it, my model doesn't change to it. I have to run a lua command in the console for it to work properly.

    Next, how can I skin it? I've applied only a basic material onto it, my model is a cactus that is supposed to look rather similar to cactuar in terms of it's textures, so it's sorta cartoony. However, my hand-drawn skins in Photoshop look outright horrible, so I was wondering how do /you/ do it?

  2. Post #2
    Silver Spirit's Avatar
    July 2009
    4,870 Posts
    It doesn't automatically switch your model when you click it you have to select it then kill yourself for it to change (or do what you did).

    Also have you got a screenshot of it? so I can see what your on about.

  3. Post #3
    Gold Member
    The Best's Avatar
    August 2005
    1,085 Posts
    I have killed myself. No dice.

    The unwrap or the model?

  4. Post #4
    Silver Spirit's Avatar
    July 2009
    4,870 Posts
    I have killed myself. No dice.
    Not sure whats up with that.

    The unwrap or the model?
    Either or both (probberly both, then I can see what it looks like in both ways).

  5. Post #5
    Gold Member
    The Best's Avatar
    August 2005
    1,085 Posts
    Isn't there supposed to be a lua file that sets your model in the player selection menu? I might have typed wrong.

  6. Post #6
    Silver Spirit's Avatar
    July 2009
    4,870 Posts
    are you not even selecting it from the menu, I thought from what you said you were.

    Code:
     if ( SERVER ) then
    player_manager.AddValidModel( "Name", "models/Name.mdl" );
    
    AddCSLuaFile( 'assassin.lua' ) ;
    end
    
    list.Set( "PlayerOptionsModel", "Name", "models/Name.mdl" );
    Should look exactly like that with Name subsituted with the name of your model.

  7. Post #7
    Gold Member
    The Best's Avatar
    August 2005
    1,085 Posts
    I selected it from the menu, killed myself, my model didn't change. Also, thanks.

  8. Post #8
    Gold Member
    smallfry's Avatar
    January 2007
    1,103 Posts
    I think your problem is that player_manager.AddValidModel() isn't being run during a singleplayer game.
    The problem should go away when you set "maxplayers" to something higher than 1, then load a map. If it doesn't, then I'm wrong. Try changing the first line of Silver Spirit's script to this:
    if ( SERVER ) or ( SinglePlayer() ) then
    
    By the way, semicolons are unnecessary and are ignored by GMod Lua.

  9. Post #9
    Silver Spirit's Avatar
    July 2009
    4,870 Posts
    All I put up there is the basic script I use when applying a player model to the list (which is taken from many ones i've downloaded). Didn't know about the semicolon thing at all :)

    The player_manager.AddValidModel() is on all the playermodel lua scripts i've got and theres no issues with it being there (though even with my limited lua knowledge I didn't think that line made any sense being there).

  10. Post #10
    Gold Member
    The Best's Avatar
    August 2005
    1,085 Posts
    Didn't work... even if I add "if ( SERVER ) or ( SinglePlayer() ) then".

    Here's what I have so far.
    Code:
    if ( SERVER ) or ( SinglePlayer() ) then 
    	player_manager.AddValidModel( "cactus", "models/player/cactus.mdl" )
    	AddCSLuaFile( "autorun/cactus.lua" )
    end
    
    list.Set( "PlayerOptionsModel", "Cactus", "models/player/cactus.mdl" )

  11. Post #11
    Gold Member
    Omolong's Avatar
    December 2007
    7,582 Posts
    Change it to:
    player_manager.AddValidModel( "Cactus", "models/player/cactus.mdl" )
    list.Set( "PlayerOptionsModel", "Cactus", "models/player/cactus.mdl" )

    And make sure the file is called something like cactus_player_model.lua.

  12. Post #12
    Gold Member
    The Best's Avatar
    August 2005
    1,085 Posts
    Oh hey! That worked! What makes it different?

  13. Post #13
    Gold Member
    Omolong's Avatar
    December 2007
    7,582 Posts
    Well, there was "cactus" and "Cactus", which conflict and have to be the same to work.

    And all the other stuff you had in there was useless.