Anyone been able to add functional staff?

Discussion about Mods for Prison Architect

Moderator: NBJeff

pcgrosen
level1
level1
Posts: 10
Joined: Tue Jun 11, 2013 5:20 am

Re: Anyone been able to add functional staff?

Postby pcgrosen » Fri Sep 05, 2014 2:04 am

May I see the code? I'd like to run your mod and look for a few things in the .prison file. If you could give me a copy, I could probably determine where things were going wrong.
User avatar
dsdude123
level2
level2
Posts: 77
Joined: Tue May 27, 2014 2:40 am
Location: Seattle,WA
Contact:

Re: Anyone been able to add functional staff?

Postby dsdude123 » Fri Sep 05, 2014 3:45 am

pcgrosen wrote:May I see the code? I'd like to run your mod and look for a few things in the .prison file. If you could give me a copy, I could probably determine where things were going wrong.


Here is the code for the job:

Code: Select all

BEGIN Job
    Name                    MaintainComputer
    JobTime                 30
    Tool                    CircuitBoard
    Worker                  SystemAdministrator
END


Here is the code for the System Administrator:

Code: Select all

BEGIN Object     
    Name                 SystemAdministrator 
    Toughness            5.0000
    Price                -1500 
   Wage             -500
    RenderDepth          2 
    ViewRange            3
   MoveCost             1.00000
    BlockedBy            Wall 
    BlockedBy            StaticObject 
    BlockedBy            UtilityStation 
    Properties           Entity
    Properties           Staff
   Equipment            Clipboard
   BEGIN   Sprite
        x 14
        y 0 
        w 2 
        h 2 
        RotateType 4
    END
    BEGIN   Sprite
        x 16
        y 0 
        w 2 
        h 2 
        RotateType 4
    END
    BEGIN   Sprite
        x 18
        y 0 
        w 2 
        h 2 
        RotateType 4
    END
    BEGIN   Sprite
        x 20
        y 0 
        w 2 
        h 2 
        RotateType 4
    END
END
pcgrosen
level1
level1
Posts: 10
Joined: Tue Jun 11, 2013 5:20 am

Re: Anyone been able to add functional staff?

Postby pcgrosen » Fri Sep 05, 2014 3:47 am

dsdude123 wrote:
pcgrosen wrote:May I see the code? I'd like to run your mod and look for a few things in the .prison file. If you could give me a copy, I could probably determine where things were going wrong.


Here is the code for the job:

Code: Select all

BEGIN Job
    Name                    MaintainComputer
    JobTime                 30
    Tool                    CircuitBoard
    Worker                  SystemAdministrator
END


Here is the code for the System Administrator:

Code: Select all

BEGIN Object     
    Name                 SystemAdministrator 
    Toughness            5.0000
    Price                -1500 
   Wage             -500
    RenderDepth          2 
    ViewRange            3
   MoveCost             1.00000
    BlockedBy            Wall 
    BlockedBy            StaticObject 
    BlockedBy            UtilityStation 
    Properties           Entity
    Properties           Staff
   Equipment            Clipboard
   BEGIN   Sprite
        x 14
        y 0 
        w 2 
        h 2 
        RotateType 4
    END
    BEGIN   Sprite
        x 16
        y 0 
        w 2 
        h 2 
        RotateType 4
    END
    BEGIN   Sprite
        x 18
        y 0 
        w 2 
        h 2 
        RotateType 4
    END
    BEGIN   Sprite
        x 20
        y 0 
        w 2 
        h 2 
        RotateType 4
    END
END


What about the script that creates the job?
User avatar
dsdude123
level2
level2
Posts: 77
Joined: Tue May 27, 2014 2:40 am
Location: Seattle,WA
Contact:

Re: Anyone been able to add functional staff?

Postby dsdude123 » Fri Sep 05, 2014 4:05 am

pcgrosen wrote:
dsdude123 wrote:
pcgrosen wrote:May I see the code? I'd like to run your mod and look for a few things in the .prison file. If you could give me a copy, I could probably determine where things were going wrong.


Here is the code for the job:

Code: Select all

BEGIN Job
    Name                    MaintainComputer
    JobTime                 30
    Tool                    CircuitBoard
    Worker                  SystemAdministrator
END


Here is the code for the System Administrator:

Code: Select all

BEGIN Object     
    Name                 SystemAdministrator 
    Toughness            5.0000
    Price                -1500 
   Wage             -500
    RenderDepth          2 
    ViewRange            3
   MoveCost             1.00000
    BlockedBy            Wall 
    BlockedBy            StaticObject 
    BlockedBy            UtilityStation 
    Properties           Entity
    Properties           Staff
   Equipment            Clipboard
   BEGIN   Sprite
        x 14
        y 0 
        w 2 
        h 2 
        RotateType 4
    END
    BEGIN   Sprite
        x 16
        y 0 
        w 2 
        h 2 
        RotateType 4
    END
    BEGIN   Sprite
        x 18
        y 0 
        w 2 
        h 2 
        RotateType 4
    END
    BEGIN   Sprite
        x 20
        y 0 
        w 2 
        h 2 
        RotateType 4
    END
END


What about the script that creates the job?


Here is the LUA script. When I run the mod the job is created however the system administrator doesn't do anything.

Code: Select all

function Create()


    Object.SetProperty("NeedsMaintenance", false);
   Object.CreateJob("MaintainComputer");
       
end


function Update( timePassed )

   if math.random(0,4) == 2 then
        NeedsMaintenance = true;
    end
   
    if Object.GetProperty("NeedsMaintenance") then       
        Object.CreateJob("MaintainComputer");
        return;
    end   
   
end



function JobComplete_MaintainComputer()
    Object.SetProperty("NeedsMaintenance", false);   
end
Squizzel
level1
level1
Posts: 50
Joined: Mon Apr 14, 2014 12:15 am

Re: Anyone been able to add functional staff?

Postby Squizzel » Sun Sep 07, 2014 9:24 am

Wage dosn't seem to work for me. Not sure why.

Edit:
And by that I mean the line of code wage. Will tweak with code, see if I can find out why, but looking at the soruce code it dosn't have that line for staff member

Edit#2:
My staff member (a lawyer) dose go to the office and paces around.
Kataan
level1
level1
Posts: 10
Joined: Tue Sep 23, 2014 6:27 am
Location: Brisbane, Australia

Re: Anyone been able to add functional staff?

Postby Kataan » Tue Sep 23, 2014 9:02 am

Did anyone have any luck with this, I've been trying as well and by sheer coincidence I've already tried the above on my own.

Can spawn the staff and create jobs for that type of staff, but they just sit there.

Anyone tried to tie a lau script to a custom staff member or any other form of work-around?

Edit: Just to clarify I'm talking about a custom worker or gardiner type, not someone who sits in the office.
elDiablo
level5
level5
Posts: 3111
Joined: Thu Mar 14, 2002 12:23 pm
Location: London, UK

Re: Anyone been able to add functional staff?

Postby elDiablo » Tue Sep 23, 2014 10:22 am

Can you post the entity description from your materials.txt for the SysAdmin please? Are you setting them to an entity?

Edit: Totally didn't see your post before mine. Sorry about that.
Kataan
level1
level1
Posts: 10
Joined: Tue Sep 23, 2014 6:27 am
Location: Brisbane, Australia

Re: Anyone been able to add functional staff?

Postby Kataan » Tue Sep 23, 2014 12:01 pm

So running off code similar to the farming mod example provided with the alpha #24 release. I can create an item that can get processed into another item by one of the existing staff (such as cooks) or prisoners, however when its set to a custom staff (in this instance a blacksmith) the custom staff member just doesn't respond and stands still where ever he was spawned. The custom staff member will train the prisoners. The custom staff member also gets tired, but will not move to staff room to sleep.

Code Snippet from materials.txt

Code: Select all

BEGIN Object     
    Name                 BlackSmith 
    Price                -50 
    Toughness            5
    RenderDepth          2 
    BlockedBy            Wall 
    BlockedBy            StaticObject 
    BlockedBy            UtilityStation 
    Research             BlackSmithing
    Sprite               Gardener 
    SpriteVariants       4 
    Properties           Entity
    Properties           Staff
END


BEGIN Object     
    Name                 Smelt
    Width                3 
    ConstructionTime     3.00000 
    MoveSpeedFactor      0.250000 
    Toughness            10.0000 
    Price                -100 
    NumSlots             3
    Group                StaticObject 
    BlockedBy            Wall 
    BlockedBy            StaticObject 
    BlockedBy            UtilityStation 
    MadeOf               Composite
    Properties           StaticObject
    Properties           Processor
    Properties           RoomSpecific
    WorkGroup            BlackSmithWorkshop
    BEGIN   Sprite
        x 0
        y 4 
        w 6 
        h 3 
        RotateType 4
        BEGIN Marker
           x             1.5
           y             1.0
           orientation.x 0.0
           orientation.y 0.0
           Index         0
        END
        BEGIN Marker
           x             3.1
           y             1.0
           Index         1
        END
        BEGIN Marker
           x             4.7
           y             1.0
           Index         2
        END
    END
END


Code Snippet from production.txt

Code: Select all

BEGIN ProductionRule       
    Rule                 Storage
    Material             IronOre 
    Container            Smelt
    Distribution         Random 
END

BEGIN Processor
    Processor           Smelt
    Input               IronOre
    Output              SheetMetal
    OperatingTime       15.0
    Properties          ShowDuringOperation
    Object              Smelt
    Worker              BlackSmith 
    Qualification       BlackSmithing
END

Return to “Modding”

Who is online

Users browsing this forum: No registered users and 1 guest