Jump to content


Photo

Changing TDM files outside the pk4s?


  • Please log in to reply
14 replies to this topic

#1 wesp5

wesp5

    Advanced Member

  • Member
  • PipPipPip
  • 500 posts

Posted 06 May 2017 - 02:21 AM

I was trying to recreate the extinguishable oil lamps for my current TDM 2.05 setup, but it seems as if nothing outside the pk4s is able to override the content inside. I even tested this with some simple text files like tdm_version.txt, so is there a new variable I need to set or is there something else I am overlooking?



#2 freyk

freyk

    Member

  • Member
  • PipPip
  • 406 posts

Posted 06 May 2017 - 06:25 AM

I did this by
  • renaming the original file in the pk4 (that just a zip file is),
  • creating outside the pk4 (like in the fm\mymission folder), the same folder-structure that tdm uses
  • and change the file outside the pk4.
For your example:
Go inside tdm_base01.pk4, copy the file tdm_version.txt to darkmod\fm\wesp5mission\tdm_version.txt and change to content of the file in your fm folder.
Or
Go inside tdm_base01.pk4 and copy the file tdm_version.txt to darkmod\fm\wesp5mission\tdm_version.txt, rename the file in tdm_base01.pk4 and change to content of the file in your fm folder.

Edited by freyk, 06 May 2017 - 06:33 AM.


#3 stumpy

stumpy

    Advanced Member

  • Member
  • PipPipPip
  • 1639 posts

Posted 06 May 2017 - 07:05 AM

you would need to create a def file for new objects and then that would override the lamp in the pk4.



#4 wesp5

wesp5

    Advanced Member

  • Member
  • PipPipPip
  • 500 posts

Posted 06 May 2017 - 08:04 AM

you would need to create a def file for new objects and then that would override the lamp in the pk4.

How would I do that and make sure that TDM actually uses this?



#5 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 7438 posts

Posted 06 May 2017 - 08:35 AM

Make sure the defs folder is on the mod root or in the mission root. Make sure the def you create has the same name as the on in mission.
Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

(Yeah, shameless promotion... but traffic is traffic folks...)

#6 wesp5

wesp5

    Advanced Member

  • Member
  • PipPipPip
  • 500 posts

Posted 06 May 2017 - 09:11 AM

Make sure the defs folder is on the mod root or in the mission root. Make sure the def you create has the same name as the one in mission.

I tried placing the modified tdm_lights_static.def file into the root, fms and my test mission (Bakery Job by Sotha) folders without any results.

 

I managed to improve some key definition infos in the strings/english.lang file though, which proves a) that some outside files override the ones inside the pk4s and that the warning inside the english.lang ("This file was generated automatically, DO NOT EDIT - all changes will be lost when the file is regenerated. Edit strings/all.lang instead!") seems not to be true, because changing the same in all.lang didn't do anything.

 

Back to the lights issue, could it be that I still have to edit tdm_response_effects.script for the following insert suggested by Destined to work?

 

    "frobable"    "1"
    "sr_class_1"    "S"
    "sr_type_1"        "STIM_FROB"
    "sr_state_1"    "1"
    "sr_class_2"    "R"
    "sr_type_2"        "STIM_FROB"
    "sr_state_2"    "1"
    "sr_effect_2_1"   "effect_light_off"
    "sr_effect_2_1_arg1"   "_SELF"
 


Edited by wesp5, 06 May 2017 - 09:14 AM.


#7 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPip
  • 4820 posts

Posted 07 May 2017 - 05:39 AM

Why don't you just create your own entity? I don'T see why it is neccessary to overwrite the existing ones.

 

Regarding the frob. If I understand you correctly you want the light to go off if it gets frobbed?! Than this should work:

 

"frobable"         "1"                       // entity can be frobbed

"sr_class_1"     "R"                      // this is a response to a stim

"sr_type_1"      "STIM_FROB"     // the stim it responses to is frobbing

"sr_state_1"     "1"                       // the response is enabled

"sr_effect_1_1" "effect_light_off"// action to take place on response (turn off light)

"sr_effect_1_1" "_SELF"            // the light to turn off (the entity itself)

 

In the setup posted above the light is also emitting a frob stim, which doesn't make much sense. If S&R doesn't work, you can also use a frob_action_script. There is actually one for exactly that purpose (created by tels). Just add the following spawnarg:

"frob_action_script"       "frob_light_holder_ext"

 

This works on all entities with lights attached to them (like candles, torches etc...).


FM's: Builder Roads, Old Habits, Old Habits Rebuild
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#8 wesp5

wesp5

    Advanced Member

  • Member
  • PipPipPip
  • 500 posts

Posted 07 May 2017 - 07:39 AM

Why don't you just create your own entity? I don'T see why it is neccessary to overwrite the existing ones.

I don't want a new lamp entity to use in new maps, I want to have oil lamps exstinguishable in already existing maps, like was discussed here a long time ago. At the time I modified a local file in my setup that made this work, but of course the 2.05 update disabled that and now I can't remember how I did it! Can it be that the def file is only for DR and the tdm_response_effects.script file is the one I edited at the time to make it work in the game itself?


Edited by wesp5, 07 May 2017 - 07:40 AM.


#9 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPip
  • 4820 posts

Posted 07 May 2017 - 07:58 AM

The def files are for the game.


FM's: Builder Roads, Old Habits, Old Habits Rebuild
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#10 wesp5

wesp5

    Advanced Member

  • Member
  • PipPipPip
  • 500 posts

Posted 07 May 2017 - 11:24 AM

The def files are for the game.

Then something is wrong with my setup, although I just reinstalled the whole game just to be sure. As a test to see if changes in tdm_lights_static.def are used or not, I just set the flames of all oil lamps from "def_attach" "light_candleflame" to "def_attach" "light_torchflame_small". Playing "Bakery Job" again, I don't see a change whatsoever, even if I copy the def file into the tdm_defs01.pk4! What is going on here? Shouldn't this have changed the oil lamp flames in the game?


Edited by wesp5, 07 May 2017 - 11:25 AM.


#11 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPip
  • 4820 posts

Posted 07 May 2017 - 11:32 AM

Did you place the file in the correct subfolder (def, not defs or similar)?

Is the name the same as the one you want to overwrite (check spelling)?

Did you restart the game afterwards?

Did you check the console for any errors?


FM's: Builder Roads, Old Habits, Old Habits Rebuild
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#12 wesp5

wesp5

    Advanced Member

  • Member
  • PipPipPip
  • 500 posts

Posted 07 May 2017 - 12:53 PM

Did you place the file in the correct subfolder (def, not defs or similar)?

Is the name the same as the one you want to overwrite (check spelling)?

Did you restart the game afterwards?

Did you check the console for any errors?

Yes and yes and yes and no, I hadn't yet checked the console and when I did, I thought I caught my problem. Obviously TDM loads every def file it finds, regardless of the name, so because I saved the original as backup, it loaded that too and I got warnings about duplicate content! I thought this was it, removed all other files except the changed tdm_lights_static and still no change inside the game. Neither regarding flame effects or extinguishable lamps...



#13 Destined

Destined

    Advanced Member

  • Member
  • PipPipPip
  • 1034 posts

Posted 07 May 2017 - 01:22 PM

In the setup posted above the light is also emitting a frob stim, which doesn't make much sense. If S&R doesn't work, you can also use a frob_action_script. There is actually one for exactly that purpose (created by tels). Just add the following spawnarg:

"frob_action_script"       "frob_light_holder_ext"

This was my mistake. I thought that you always need the respective Stim to any Response you create on the same entity. In hindsight, I am not sure, why I thought that. Must have been some trial and error that worked this way... Well, I know it for the future :)



#14 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPip
  • 4820 posts

Posted 07 May 2017 - 01:41 PM

Well, entities don't stim themselves, so the light won't turn off itself. But placing two candles next to each other would probably cause them turn each other off. :)

 

@wesp5: Can you post a condump here? Enter condump anyname in the console, it will print the console output to a text file (anyname.txt). In addition, you could pack up your setup, upload it and pm me the link (or directly pm me the file if the file size allows it). It is probably some sort of typo.

 

I've overloaded stock files a dozen times and it always worked.


FM's: Builder Roads, Old Habits, Old Habits Rebuild
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#15 rich_is_bored

rich_is_bored

    Advanced Member

  • Member
  • PipPipPip
  • 833 posts

Posted 07 May 2017 - 03:57 PM

You need to make sure your changes are loaded last. The game loads pk4s in alphanumeric order. If you prefix your pk4 with something like "zzz_" that will ensure it is loaded after everything else.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users