ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Clear Sky Forum » Mod discussion
Adapting a SoC repair mod

Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  20:39:59  5 November 2012
profilee-mailreply Message URLTo the Top
soopytwist
Senior Resident
 

 
On forum: 03/30/2010
Messages: 447
Adapting a SoC repair mod

So I'm trying to adapt my repair mod from SoC into CS but it seems it isn't that easy. The mod is actually a modified Autologic repair mod which was based on...someone else's, sorry I've forgotten who that was!

I believe it to be either the scripts that are causing the game not to load or the localisation file.

The vanilla localisation file does not contain any file look-ups (like string_table_general etc). I've got just this:

[string_table]
language = eng

files = string_table_repair_kit

The script on the other hand is probably the culprit as it is configured for SoC's weapon slots. CS is different so what needs to change?


function itemuse(what)
     local obj_name = what:name()
    if (string.find(obj_name, "repair_kit")) then
        use_repair_kit(what)
    end
end

function use_repair_kit(what)
    local repair_slot_num = 0

    local item_in_slot_1 = db.actor:item_in_slot(1)
    local item_in_slot_2 = db.actor:item_in_slot(2)
    local item_in_slot_6 = db.actor:item_in_slot(6)

    if (item_in_slot_1 ~= nil) then
        repair_slot_num = 1
    end

    if (item_in_slot_2 ~= nil) then
        if (repair_slot_num == 0) then
            repair_slot_num = 2
        elseif (repair_slot_num == 1) then
            if (item_in_slot_1:condition() > item_in_slot_2:condition()) then
                repair_slot_num = 2
            end
        end
    end

    if (item_in_slot_6 ~= nil) then
        if (repair_slot_num == 0) then
            repair_slot_num = 6
        elseif  (repair_slot_num == 1) then
            if (item_in_slot_1:condition() > item_in_slot_6:condition()) then
                repair_slot_num = 6
            end
        elseif  (repair_slot_num == 2) then
            if (item_in_slot_2:condition() > item_in_slot_6:condition()) then
                repair_slot_num = 6
            end
        end
    end

    if (repair_slot_num == 1) then
        local rep_point = item_in_slot_1:condition() + 0.5
        if (rep_point > 1) then
            rep_point = 1
        end
        item_in_slot_1:set_condition(rep_point)
    elseif (repair_slot_num == 2) then
        local rep_point = item_in_slot_2:condition() + 0.5
        if (rep_point > 1) then
            rep_point = 1
        end
        item_in_slot_2:set_condition(rep_point)
    elseif (repair_slot_num == 6) then
        local rep_point = item_in_slot_6:condition() + 0.5
        if (rep_point > 1) then
            rep_point = 1
        end
        item_in_slot_6:set_condition(rep_point)
    end
end

  21:50:04  5 November 2012
profilee-mailreply Message URLTo the Top
soopytwist
Senior Resident
 

 
On forum: 03/30/2010
 

Message edited by:
soopytwist
11/05/2012 22:43:47
Messages: 447
My bad, I left out the font_prefix in the localisation.

The game now loads but killing someone crashes the game. I guess because the repair kit should then appear in the dead NPC's inventory (from death_items...).

EDIT

I'm an idiot. I also specified the wrong ogf in items.ltx.

While the game no longer crashes I'm not seeing any repair kits on dead bodies. The visual for it was equipments\item_merger.ogf but CS doesn't recognise this old SoC ogf file so I used dynamics\devices\dev_vodka\dev_vodka.ogf instead. Didn't think it would matter considering you can't drop the repair kits so it does not need a model. If it HAS to be item_merger.ogf what's the CS equivalent?

EDIT

Okay, it's working now. I wasn't killing enough NPC's to find any kits, had to set the probability very high to get one. Unfortunately using one doesn't repair anything!
  23:30:29  5 November 2012
profilee-mailreply Message URLTo the Top
SetaKat
Ex modder, Zones only ferret and will someday release a game
(Resident)

 

 
On forum: 02/20/2010
Messages: 6340
Set it up in bind_stalker correctly?
  23:58:01  5 November 2012
profilee-mailreply Message URLTo the Top
soopytwist
Senior Resident
 

 
On forum: 03/30/2010
Messages: 447
Already is:


function actor_binder:on_item_drop (obj)
    level_tasks.proceed(self.object)
    --game_stats.update_drop_item (obj, self.object)
  repair_kit.itemuse(obj)
end

  23:02:51  6 November 2012
profilee-mailreply Message URLTo the Top
soopytwist
Senior Resident
 

 
On forum: 03/30/2010
Messages: 447
So any ideas anyone? It all seems to work apart from the fact that using a repair kit doesn't repair anything. The script was designed for SoC, maybe repairs work differently in CS?

I had to stop playing the game. I just got into Limansk with a broken gun and no armour left. With no engineers around to repair my stuff I'm dead meat - can't reach the hospital. This is why I started adapting my repair mod from SoC. So I need this mod to work so I can carry on playing.
  23:09:45  6 November 2012
profilee-mailreply Message URLTo the Top
nashathedog
Senior Resident
 

 
On forum: 01/31/2011
Messages: 8010

---QUOTATION---
So any ideas anyone? It all seems to work apart from the fact that using a repair kit doesn't repair anything. The script was designed for SoC, maybe repairs work differently in CS?

I had to stop playing the game. I just got into Limansk with a broken gun and no armour left. With no engineers around to repair my stuff I'm dead meat - can't reach the hospital. This is why I started adapting my repair mod from SoC. So I need this mod to work so I can carry on playing.
---END QUOTATION---



There is a CS guy who does repairs in Limansk, Isn't there?
  00:14:55  7 November 2012
profilee-mailreply Message URLTo the Top
soopytwist
Senior Resident
 

 
On forum: 03/30/2010
Messages: 447
You sure? I think he probably got killed.

I've managed to sort the issue now anyway. Had my section in bind_stalker all wrong. Works a treat now. Will test it thoroughly, maybe even have traders sell the repair kits as well, which is something I didn't implement in SoC. Then I'll upload it to filefront.
  20:26:45  16 November 2012
profilee-mailreply Message URLTo the Top
soopytwist
Senior Resident
 

 
On forum: 03/30/2010
Messages: 447
Mod is pending approval on FileFront. I now have version 1.1 finished with usage sounds.
 
Each word should be at least 3 characters long.
Search:    
Search conditions:    - spaces as AND    - spaces as OR   
 
Forum Index » S.T.A.L.K.E.R.: Clear Sky Forum » Mod discussion
 

All short dates are in Month-Day-Year format.


 

Copyright © 1995-2019 GSC Game World. All rights reserved.
This site is best viewed in Internet Explorer 4.xx and up and Javascript enabled. Webmaster.
Opera Software products are not supported.
If any problem concerning the site functioning under Opera Software appears apply
to Opera Software technical support service.