Anyone been able to add functional staff?
Moderator: NBJeff
Re: Anyone been able to add functional staff?
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.
Re: Anyone been able to add functional staff?
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
Re: Anyone been able to add functional staff?
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?
Re: Anyone been able to add functional staff?
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
Re: Anyone been able to add functional staff?
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.
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.
Re: Anyone been able to add functional staff?
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.
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.
Re: Anyone been able to add functional staff?
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.
Edit: Totally didn't see your post before mine. Sorry about that.
Re: Anyone been able to add functional staff?
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 Snippet from production.txt
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
Who is online
Users browsing this forum: No registered users and 8 guests