SRB2 Message Board  

Go Back   SRB2 Message Board > Sonic Robo Blast 2 > Editing > Editing Help

Reply
 
Thread Tools Search this Thread
Old 07-09-2016   #1
its a small world
Permanently Banned
Default Tails or Knuckles skin replace?

Is there a way to change Tails and Knuckles sprites in a custom wad? Like overwrite the default ones? I know how to do it with Sonic, but I want to do Tails/Knuckles too. Also would lua be needed? How would I do it if I needed lua?
its a small world is offline   Reply With Quote
Old 07-09-2016   #2
Sapheros
Permanently Banned
Default

Technically you can't replace Tails or Knux's sprites, but you can auto change their skin through lua using R_SetPlayerSkin.

Code:
if(player.mo.skin == "tails")
                R_SetPlayerSkin(player, "tailscd")
            end
Sapheros is offline   Reply With Quote
Old 07-09-2016   #3
Jimita
Developer
 
Jimita's Avatar
Default

Quote:
Originally Posted by Duon the Adventurer View Post
you can't replace Tails or Knux's sprites
Code:
freeslot("SPR_TAI2")

if (player.mo.skin == "tails")
        player.mo.sprite = SPR_TAI2         
end

if (player.mo.skin ~= "tails")
and (player.mo.sprite == SPR_TAI2)       
        player.mo.sprite = SPR_PLAY   
end
What you mean?

Last edited by Jimita; 07-10-2016 at 12:04 AM.
Jimita is offline   Reply With Quote
Old 07-09-2016   #4
Sapheros
Permanently Banned
Default

Yeah um... that doesn't actually work.

WARNING: wat.lua:4: bad argument #3 to '?' (number expected, got nil)

Code:
    addHook("ThinkFrame", do
        for player in players.iterate
            if (player.mo.skin == "tails")
Line 4:          player.mo.sprite = SPR_TAI2
            end

            if (player.mo.skin ~= "tails")
            and (player.mo.sprite == SPR_TAI2)
                player.mo.sprite = SPR_PLAY
            end
        end
    end)
Sapheros is offline   Reply With Quote
Old 07-09-2016   #5
its a small world
Permanently Banned
Default

I got that too Duon. except I think it has something to do with MAINCFG maybe?
its a small world is offline   Reply With Quote
Old 07-10-2016   #6
Jimita
Developer
 
Jimita's Avatar
Default

Quote:
Originally Posted by Duon the Adventurer View Post
WARNING: wat.lua:4: bad argument #3 to '?' (number expected, got nil)

Code:
Line 4:          player.mo.sprite = SPR_TAI2
SPR_TAI2 needs to be the new sprites (that replaces Tails'), obviously.

Last edited by Jimita; 07-10-2016 at 12:03 AM.
Jimita is offline   Reply With Quote
Old 07-10-2016   #7
its a small world
Permanently Banned
Default

I'm still not getting it... Example wad? Do I need to call the sprite SPR_TAI2?
its a small world is offline   Reply With Quote
Old 07-10-2016   #8
Jimita
Developer
 
Jimita's Avatar
Default

Quote:
Originally Posted by its a small world View Post
Do I need to call the sprite SPR_TAI2?
Not necessarily SPR_TAI2, anything you want, but you'll need to change the SPR_TAI2 in the code to the name you gave.
Jimita is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


All times are GMT. The time now is 09:33 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.