Sprites aren't loading...

Discussion about Mods for Prison Architect

Moderator: NBJeff

Rufus
level1
level1
Posts: 25
Joined: Wed Oct 10, 2012 5:39 pm

Sprites aren't loading...

Postby Rufus » Sat Sep 06, 2014 9:33 pm

Okay, so I'm making a mod - of course - and I've hit a bump. The textures I'm loading in sprites.png do not load in game. The object (undisclosed) simply is built invisible. Here's the contents of materials.txt

Code: Select all

BEGIN Object     
    Name                 SHHH SECRET 
    ConstructionTime     5.00000 
    MoveSpeedFactor      0.700000 
    Toughness            5.0000 
    Price                -10 
    NumSlots             1 
    AttachToWall         true 
    Group                StaticObject 
    BlockedBy            Wall 
    BlockedBy            StaticObject 
    BlockedBy            UtilityStation 
    BEGIN Sprite
   x 0
   y 0
   w 2
   h 2
   RotateType 4
    END
    MadeOf               Wood
    Properties           StaticObject   
END


Anyone got any ideas? By the way, sprites.png is 256 by 64 pixels large - incase that's a query.
User avatar
knoest26
level5
level5
Posts: 1380
Joined: Thu Jul 11, 2013 6:55 pm
Location: The Netherlands
Contact:

Re: Sprites aren't loading...

Postby knoest26 » Sat Sep 06, 2014 11:50 pm

You wouldn't happen to be loading two custom sprite files at the same time, would you?
Rufus
level1
level1
Posts: 25
Joined: Wed Oct 10, 2012 5:39 pm

Re: Sprites aren't loading...

Postby Rufus » Sat Sep 06, 2014 11:59 pm

I have the veg patch mod, but not active. Otherwise, no.
User avatar
knoest26
level5
level5
Posts: 1380
Joined: Thu Jul 11, 2013 6:55 pm
Location: The Netherlands
Contact:

Re: Sprites aren't loading...

Postby knoest26 » Sun Sep 07, 2014 12:15 am

Just read the part about the 256 by 64 pixel;

Each 'unit' is 32 pixels so your height and width should be 8 by 2
Suthek
level1
level1
Posts: 29
Joined: Mon Sep 01, 2014 5:23 pm

Re: Sprites aren't loading...

Postby Suthek » Sun Sep 07, 2014 12:22 am

knoest26 wrote:Just read the part about the 256 by 64 pixel;

Each 'unit' is 32 pixels so your height and width should be 8 by 2


It was just the size of the sprites.png. Doesn't necessarily mean that the sprite he used takes up the whole picture.
(if it does, then he's right). Other than that, I don't really see anything wrong in the code, apart from not knowing what RotateType 4 does. (I only know 0, 1 and 2)
So unless I've really overlooked something, the problem would have to be with the sprites.png, starting with the name. Is it called 'sprites.png', lowercase?
User avatar
knoest26
level5
level5
Posts: 1380
Joined: Thu Jul 11, 2013 6:55 pm
Location: The Netherlands
Contact:

Re: Sprites aren't loading...

Postby knoest26 » Sun Sep 07, 2014 12:25 am

Suthek wrote:apart from not knowing what RotateType 4 does. (I only know 0, 1 and 2)

RotateType 4 means an object isn't rotatable
Rufus
level1
level1
Posts: 25
Joined: Wed Oct 10, 2012 5:39 pm

Re: Sprites aren't loading...

Postby Rufus » Sun Sep 07, 2014 8:00 am

Knoest I see your point however there are 4 2by2 sprites - all the same object, just different rotations. However for now I'd rather fix the problem at hand.
Rufus
level1
level1
Posts: 25
Joined: Wed Oct 10, 2012 5:39 pm

Re: Sprites aren't loading...

Postby Rufus » Sun Sep 07, 2014 8:01 am

However, after we HAVE fixed that problem can one of you either point me in the direction of how rotatetype works.
heyjude2001
level0
Posts: 1
Joined: Wed Jul 30, 2014 10:01 am

Re: Sprites aren't loading...

Postby heyjude2001 » Sun Sep 07, 2014 10:23 am

I'm having a problem sort of like this and I believe it is due to using older mods as well for if I'm to use the alpha 21 realistic textures mod it bugs my sprites around and I end up with trucks as tables and bleach as weired electronics .
Rufus
level1
level1
Posts: 25
Joined: Wed Oct 10, 2012 5:39 pm

Re: Sprites aren't loading...

Postby Rufus » Sun Sep 07, 2014 10:37 am

Ah, I've found the problem! Well, solved it - not found. Basically, I added another sprite to sprites.txt making it 256 by 128 big and for some reason now the textures work.
Suthek
level1
level1
Posts: 29
Joined: Mon Sep 01, 2014 5:23 pm

Re: Sprites aren't loading...

Postby Suthek » Sun Sep 07, 2014 1:18 pm

Rufus wrote:However, after we HAVE fixed that problem can one of you either point me in the direction of how rotatetype works.

I'm still looking into all the works myself currently, here's what I have so far:

RotateType 1 indicates that the object is going to be rotatable in 4 directions. It will take the sprite indicated by the coordinates and the 2 sprites to the right of it. The first sprite is the object in its original position, the 2nd sprite is the 180° rotated view (upside down) of the object, and the third sprite is the 90° (clockwise) rotated view. (The 270° rotation is created by the game automatically by mirroring the 90° version.) If the object is not square (so the height and width differ from each other), the third sprite will have to have its width and height swapped accordingly. Commonly used for entities (people) as well.

RotateType 2 on the other hand would indicate that the object is switchable between horizontal and vertical state (e.g. the prison windows, that only have a front and side view). If you select this, the game will only pick the indicated sprite and the one to the right of it, with the original being the horizontal view and the 2nd being the vertical view.

According to knoest, then RotateType 4 indicates a non-rotating object, so only the indicated sprite will be taken.

I'm not sure about RotateType 0 and 3 yet. From what I see in the spritebank, RotateType 0 seems most prevalently used for tooltip icons and sprites of equippable icons, like contraband or weapons. I believe it would indicate a fluid rotation ability (like contraband rotating slightly on the floor when taken from a prisoner), but that's just speculation.

RotateType 3, though, I cannot say, for it seems to do the same as RotateType 1, at least from looking at the sprites and judging from the objects it's used on.
Rufus
level1
level1
Posts: 25
Joined: Wed Oct 10, 2012 5:39 pm

Re: Sprites aren't loading...

Postby Rufus » Sun Sep 07, 2014 5:27 pm

Ah, I use rotate type 0. This uses the main sprite then the three to the right. Toilets and stuff like that.
Suthek
level1
level1
Posts: 29
Joined: Mon Sep 01, 2014 5:23 pm

Re: Sprites aren't loading...

Postby Suthek » Sun Sep 07, 2014 8:32 pm

Rufus wrote:Ah, I use rotate type 0. This uses the main sprite then the three to the right. Toilets and stuff like that.


Toilet uses RotateType 1. I believe none of the RotateTypes use 4 sprites. (Maybe the entitites, but those are also RotateType 1)

Return to “Modding”

Who is online

Users browsing this forum: No registered users and 2 guests