673fd9ef00070

Page: « 1 2 [3] 4 »
673fd9ef01063
2 Guests are here.
 

Topic: SS2 Repairman WIP/RC
Page: « 1 2 [3] 4 »
Read 13015 times  

673fd9ef01842voodoo47

673fd9ef018a6
no idea whether that can be done, and I certainly don't know how, even if. maybe ZB would know?

//nope, definitely not something simple as replacing ShockGame.AddTranslatableText("WrenchUnused", "misc", "Player"); with print("Whatever");

not having a coding background is really biting me in the ass lately.
« Last Edit: 22. September 2017, 10:31:34 by voodoo47 »

673fd9ef01c81unn_atropos

Acknowledged by 2 members: ThiefsieFool, JML

673fd9ef01db0voodoo47

673fd9ef01dfc
ohh, we are at that level already? well fine with me;

673fd9ef0211fZylonBane

673fd9ef02172
no idea whether that can be done, and I certainly don't know how, even if. maybe ZB would know?

//nope, definitely not something simple as replacing ShockGame.AddTranslatableText("WrenchUnused", "misc", "Player"); with print("Whatever");
Just do what I did in the new quest notifier mod for localizable text:
Code: [Select]
ShockGame.AddText(Data.GetString("misc", "NoteNew", "Note added to PDA."), null);GetString tries to get a string from a file, but uses the supplied text if it's not there.

Why not allow repairing robots?


673fd9ef02242voodoo47

673fd9ef0228d
if we allow hacking and repairing of robots, then why not, but I didn't manage to make that work in a satisfactory way.

will check he squirrel code in a moment.

673fd9ef0231bZylonBane

673fd9ef02365
No, not rebuilding robots. Just using the maint tool to increase their HP.

673fd9ef025fevoodoo47

673fd9ef02650
well sure, but they need to be hackable first if nothing else, and that is a really, really big addition, if we are talking SCP here.
Code: [Select]
ShockGame.AddText(Data.GetString("misc", "NoteNew", "Note added to PDA."), null);
that will not work without some additional trickery, because ShockGame.AddText(Data.GetString("misc", "WrenchTSkillReq", "Maintaining this device requires a skill of %d."), null); just prints the text (%d), without grabbing the value of the skill. I guess I could duct tape my way around by hard setting the reqs to 3 for all turrets, but that's kind of too patchy even for me.

673fd9ef02710ZylonBane

673fd9ef0275a
Oh yeah, in that case you'd need to do something like...

Code: [Select]
if (Data.GetString("misc", "WrenchTSkillReq")) {
     ShockGame.AddTranslatableTextInt("WrenchTSkillReq", "misc", "Player", skillRequired);
}
else {
     ShockGame.AddText("Maintaining this device requires a skill of " + skillRequired + ".", null);
}

673fd9ef02911voodoo47

673fd9ef02994
bit too much for my copy paste level of skill, I'm afraid (tried to replace ShockGame.AddText(Data.GetString("misc", "WrenchierSkillReq", "Maintaining this device requires a skill of %d."), null); with the new snippet, but something else is needed, it seems). this is the current nut;
Code: [Select]
class Wrenchier extends SqRootScript {
function OnFrobToolEnd() {
ShockGame.PreventSwap();
local fixObj = message().DstObjId;
local state, hp, maxHP;
local playerMaintSkill = Property.Get("Player", "BaseTechDesc", "Maintain");
local objSkillRequired = Property.Get(fixObj, "ReqTechDesc", "Maintain");
// enforce a minimum skill level
if (objSkillRequired == 0) {
objSkillRequired = 1;
}
// guns
if (ShockGame.ValidGun(fixObj)) {
state = Property.Get(fixObj, "ObjState");
hp = Property.Get(fixObj, "GunState", "Condition (%)");
if (state == eObjState.kObjStateUnresearched) {
// do nothing
}
else if (state == eObjState.kObjStateBroken) {
ShockGame.AddTranslatableText("WrenchOnBroken", "misc", "Player");
}
else if (playerMaintSkill < objSkillRequired) {
ShockGame.AddTranslatableTextInt("WrenchSkillReq", "misc", "Player", objSkillRequired);
}
else if (hp > 90) {
ShockGame.AddTranslatableText("WrenchUnused", "misc", "Player");
}
else if (state == eObjState.kObjStateNormal) {
// repair gun 10% per point of maint skill
hp += playerMaintSkill * 10.0;
if (hp > 100.0) {
hp = 100.0;
}
Property.Set(fixObj, "GunState", "Condition (%)", hp);
consumeTool();
}
}
// turrets
else if (Object.InheritsFrom(fixObj, "Turrets")) {
hp = Property.Get(fixObj, "HitPoints");
maxHP = Property.Get(fixObj, "MAX_HP");
if (playerMaintSkill < objSkillRequired) {
ShockGame.AddText(Data.GetString("misc", "WrenchierSkillReq", "Maintaining this device requires a skill of %d."), null);
}
else if (hp >= maxHP) {
ShockGame.AddText(Data.GetString("misc", "WrenchierUnused", "Device already in good condition."), null);
}
else {
// repair turret 5 HP per point of maint skill (default turrets have a max HP of 48)
hp += playerMaintSkill * 5;
if (hp > maxHP) {
hp = maxHP;
}
Property.SetSimple(fixObj, "HitPoints", hp);
consumeTool();
}
}
// non-repairable
else {
ShockGame.AddText(Data.GetString("misc", "WrenchierOnNonGun", "Drag tool to a compatible device to use."), null);
}
}

function OnFrobInvEnd() {
ShockGame.AddText(Data.GetString("misc", "HelpWrenchier", "Drag to a degraded device to improve condition."), null);
}

function consumeTool() {
// decrease stack count
Container.StackAdd(self, -1);
if (!GetProperty("StackCount")) {
ShockGame.DestroyInvObj(self);
}
// play success sound
Sound.PlayEnvSchema(self, "Event Activate", 0, 0, eEnvSoundLoc.kEnvSoundAmbient);
}
}

673fd9ef02b91ZylonBane

673fd9ef02bdc
All you had to do was replace this:
Code: [Select]
ShockGame.AddTranslatableTextInt("WrenchierSkillReq", "misc", "Player", objSkillRequired);with this:
Code: [Select]
if (Data.GetString("misc", "WrenchierSkillReq")) {
     ShockGame.AddTranslatableTextInt("WrenchierSkillReq, "misc", "Player", objSkillRequired);
}
else {
     ShockGame.AddText("Maintaining this device requires a skill of " + objSkillRequired + ".", null);
}
That being said, I went overboard and implemented a general-purpose text display helper function.
Code: [Select]
class Wrenchier extends SqRootScript {
function OnFrobToolEnd() {
ShockGame.PreventSwap();
local fixObj = message().DstObjId;
local state, hp, maxHP;
local playerMaintSkill = Property.Get("Player", "BaseTechDesc", "Maintain");
local objSkillRequired = Property.Get(fixObj, "ReqTechDesc", "Maintain");
// enforce a minimum skill level
if (objSkillRequired == 0) {
objSkillRequired = 1;
}
// guns
if (ShockGame.ValidGun(fixObj)) {
state = Property.Get(fixObj, "ObjState");
hp = Property.Get(fixObj, "GunState", "Condition (%)");
if (state == eObjState.kObjStateUnresearched) {
addMiscText("WrenchUnresearched", "Cannot maintain unresearched object.");
}
else if (state == eObjState.kObjStateBroken) {
addMiscText("WrenchOnBroken");
}
else if (playerMaintSkill < objSkillRequired) {
addMiscText("WrenchSkillReq", "", objSkillRequired);
}
else if (hp > 90) {
addMiscText("WrenchUnused");
}
else if (state == eObjState.kObjStateNormal) {
// repair gun 10% per point of maint skill
hp += playerMaintSkill * 10.0;
if (hp > 100.0) {
hp = 100.0;
}
Property.Set(fixObj, "GunState", "Condition (%)", hp);
consumeTool();
}
}
// turrets
else if (Object.InheritsFrom(fixObj, "Turrets")) {
hp = Property.Get(fixObj, "HitPoints");
maxHP = Property.Get(fixObj, "MAX_HP");
if (playerMaintSkill < objSkillRequired) {
addMiscText("WrenchierSkillReq", "Maintaining this device requires a skill of %d.", objSkillRequired);
}
else if (hp >= maxHP) {
addMiscText("WrenchierUnused", "Device already in good condition.");
}
else {
// repair turret 5 HP per point of maint skill (default turrets have a max HP of 48)
hp += playerMaintSkill * 5;
if (hp > maxHP) {
hp = maxHP;
}
Property.SetSimple(fixObj, "HitPoints", hp);
consumeTool();
}
}
// non-repairable
else {
addMiscText("WrenchierOnNonGun", "Drag tool to a compatible device to use.");
}
}

function OnFrobInvEnd() {
addMiscText("HelpWrenchier", "Drag to a degraded device to improve condition.");
}

function consumeTool() {
// decrease stack count
Container.StackAdd(self, -1);
if (!GetProperty("StackCount")) {
ShockGame.DestroyInvObj(self);
}
// play success sound
Sound.PlayEnvSchema(self, "Event Activate", 0, 0, eEnvSoundLoc.kEnvSoundAmbient);
}

function addMiscText(strID, strDefault = "", dVal = null) {
local strText = Data.GetString("misc", strID, strDefault);
if (dVal != null) {
local s = strText.find("%d");
strText = strText.slice(0, s) + dVal + strText.slice(s + 2);
}
ShockGame.AddText(strText, "Player");
}
}
BTW, I used the name "Wrenchier" in my first code sample as a joke. I had assumed you'd change it to something more dignified, like "rmanWrench" or "v47Wrench" or something like that.

Also, why does the turret text refer to devices instead of turrets?

673fd9ef02d31voodoo47

673fd9ef02d82
must have screwed something up when replacing then, because that's what I attempted to do (or did I? not sure now, but no matter). device is referred because of the help text, which can be only one, and then I wanted to be consistent. well, technically we could use ranged weapon or turret (and reference turrets then), but that's kind of too long.

also, I totally like wrenchier - it is an extension of the wrench script, so it does more wrenchy things, hence, it is wrenchier.


will test everything as soon as I'm done with all the hardware stuff planned for today.
« Last Edit: 23. September 2017, 07:52:33 by voodoo47 »

673fd9ef02e53voodoo47

673fd9ef02e9c
aand working perfectly. few more people doing squirrel stuff, and I'll be out of job here before I can say some nuts may be too hard to crack. attached rc3 to the first post.

anyway, will test with a bunch of FMs, and if no issues are found, off into Repairman it goes - for now.

673fd9ef02f27ZylonBane

673fd9ef02f70
If you include any documentation, you should mention which string IDs to add to misc for localization.

673fd9ef03004voodoo47

673fd9ef0304b
I should probably do that for the full release, yeah.

//looking good, the updated mod is now live.
« Last Edit: 24. September 2017, 12:54:02 by voodoo47 »

673fd9ef03114mireazma

673fd9ef03163
Thanks. It's jerky as I first enter a map like it's caching resources or something.. nevermind.
"d3d_disp_limit_gpu_frames 1 1" goes to Shock.cfg?
nVidia CP reads let application decide about 3D settings

I tried to edit "RepairDiff" i.e. any of "Success", "Critical Fail" and "Cost" but its edits are not applied. Why?
« Last Edit: 03. October 2017, 12:17:08 by mireazma »

673fd9ef031e9voodoo47

673fd9ef03231
I have no idea what are you trying to do.

673fd9ef03324mireazma

673fd9ef03374
Probably some nonsense :D
I'm trying to get my hands dirty experimenting with your mod. I went into .\DMM\SS2_Repairman_1.01\dbmods and there I found gamesys.dml and it has this:
Code: [Select]
+ObjProp -585 "RepairDiff"
{
"Success %" 20
"Critical Fail %" 0
"Cost" 50.00
}
So I assumed it was the turret repairing values. I even copied the file (modified) in the game dir but... no effect

EDIT:
I looked for a wiki of some sort to explain these variables but I couldn't find any on the web. It would rock if there were any.
« Last Edit: 03. October 2017, 12:31:09 by mireazma »

673fd9ef035b5voodoo47

673fd9ef03603
they are, but only for one type of turret (-585 is the slug turret, or rather, its top). success is difficulty of the repair (the lower the number, the more difficult it gets, and yes negative value is ok), critical fail will determine the number of ice nodes (0 means no ice nodes and no chance of critical fail, leave this alone), cost is the nanite cost.

also ye be warned - Repairman is pretty much at the peak of what I can currently do, that means some parts (while still safe) are pretty nuts. probably not the best example if you want to learn stuff.
Quote by  Minstrel dml:
//this dml shouldn't be used as a template for other dml mods - this is evil, evil stuff, and it only works properly because Minstrel is a one mission deal.
a lot of stuff is explained here, but not the SS2 exclusives.

673fd9ef036camireazma

673fd9ef03714
Wow thanks!

A little offtopic: about the Big Droid Immortality Protocol: you said it's SCP only - what about those who don't want the game changed so radically? (I don't want the SCP). Does BDIP heavily rely on SCP that you can't play it otherwise?

673fd9ef03985voodoo47

673fd9ef039d5
lets continue with the tech stuff in the development topic. it's SCP only because some direct gamesys edits were necessary (and I make mods primarily for SCP, if it can be made to work with vanilla then fine, if not I don't care), but I guess it could be done with dml stubs which are available for (SS2tool patched) vanilla as well. I'll check tomorrow and if it's something that can be done quickly, I'll convert it.
I don't want the SCP
we can't be friends then.

673fd9ef03aa4mireazma

673fd9ef03aee
Ouch! Hey, no need for punching like that.
SCP seems interesting but from a glance it looked like a major change to the vanilla maps, hence the reluctance. And the pumpkin heads... I don't know... And it's not your creation if I'm not mistaken. Plus I'm afraid of my 15 installed mods being incompatible but I'll check them.

673fd9ef03bbbunn_atropos

673fd9ef03c05
There a no major changes to maps. Just small changes to make the game world more logical (f.e.: a broken door in Cryo A to give the room a real entrance instead of just a ladder).
The pumpkins are of course not part of regular SCP but a seasonal optional mod for the holidays.
And voodoo47 is heavily involved in the developement of SCP.

673fd9ef03cb3voodoo47

673fd9ef03cfc
you didn't seriously think a community patch marketed as a true to original experience would randomly stick pumpkins on all the AI heads, right?

also, things like "d3d_disp_limit_gpu_frames 1 1" can be found in cam_ext.cfg.
« Last Edit: 03. October 2017, 20:17:39 by voodoo47 »

673fd9ef03df7mireazma

673fd9ef03e40
It occurred to me that the pumpkin heads were seasonal but for me it spoke about the general mindset of the mod.
I'll install it as I'm curious anyway and start from square one with a fresh game with all mods (that I know of) enabled.
EDIT:
Can you give me a hand please? SCP_beta3 has a warning sign. The readme says about a minimum SS2 version of 2.44. Where can I see the version? Droid Immortality has the warning sign as well but it's ok to ignore it (voodoo47).

If at the start there's the new room on the right side, is it safe to assume *all* the SCP features work?
« Last Edit: 03. October 2017, 20:55:15 by mireazma »
2 Guests are here.
Nathaniel Hawthorne: No man, for any considerable period, can wear one face to himself, and another to the multitude, without finally getting bewildered as to which may be true.
Page: « 1 2 [3] 4 »
Contact SMF 2.0.19 | SMF © 2016, Simple Machines | Terms and Policies
FEEP
673fd9ef09101