Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Dark Dreams of Furiae - a new module for NWN:EE! Buy now
Attention, new and old users! Please read the new rules of conduct for the forums, and we hope you enjoy your stay!

Some modding questions

Saigon1983Saigon1983 Member Posts: 156
edited April 2015 in General Modding
Hello, everyone!

I have a "noob-maybe" question.
I'm from Russia. So, i have two TLK files, you know.
For example, I have 2 replics from NPC, one for male-hero and one for female-hero. An I also have two WAV-files for these replics. An a TRA-file. My question is, which syntaxis is correct?:

@1000=~Replic for male~ [VOICE001] ~Replic for female~ [VOICE002]
or
@1000=~Replic for male~ ~Replic for female~ [VOICE001] [VOICE002]

or both are correct/incorrect?

In D-file I'll code it like this:
SAY @1000
Will this works?

Post edited by Saigon1983 on
elminster

Comments

  • IsayaIsaya Member, Translator (NDA) Posts: 743
    The first syntax is correct. That's what you get when converting the game tlk files to tra format with WeiDU. I don't know if the second one works.
    I never experienced with different voice files for male and female, I don't know if it work but it seems reasonnable to expect it.

    Anywhere you can write @nnn, you'll be able to have a text using the first syntax. However it will only work for texts used in a context where the character gender is checked by the game. It works for dialogs but not scripted cutscenes or item descriptions, for instance (unless something was changed in the Enhanced Editions). For those, the male text is applied.

    JuliusBorisovelminster
  • Saigon1983Saigon1983 Member Posts: 156
  • Saigon1983Saigon1983 Member Posts: 156
    Another one question: is there any way to add a new token in game and use it for compiling dialogs? For example, I need a token < A >, than will set a letter "A" in dialogF.tlk...

  • IsayaIsaya Member, Translator (NDA) Posts: 743
    Here is a rough tutorial that explains how you can create and use new tokens.
    It's not directly applicable as it is, but it explains the principle. For instance, you'll have to devise a proper ways of doing what's described as strref="text", for instance.

    elminsterSaigon1983JuliusBorisov
  • Saigon1983Saigon1983 Member Posts: 156
    @Isaya, thanks. Not sure, will it be helpful, because today I'm dumb(( And don't understand, where to put three lines of code... and what function returns the str.ref of the LAST one string of tlk-file...

    Un russian, some phrases for male and female persons diferent only in ending "a" for female verbs. The common method ~male~ ~female~ is useful, but I want to set token < A >, which will add "" to dialog.tlk and "a" to dialogF.tlk. So, I think about three-lines code, which I cat add to any mod for a russian translate. The conception of this code is like this:

    1. Append "" to dialog.tlk and "a" to dialogF.tlk. This will sets in the last tlk-string
    2. Set "myvar", which takes the number of last string as strref
    3. SetToken("A"."myvar")

    But I have no idea, how to write this correctly... and where...

  • Saigon1983Saigon1983 Member Posts: 156
    And another question: what params should I set in NearInfinity to give my custom sword (for example) property: can be equippped ONLY by certain hero (by name of this hero)?

  • IsayaIsaya Member, Translator (NDA) Posts: 743
    I never made experiments myself with the tokens. I'm afraid I can't give a detailed use case.

    There are many ways to add a new string to the dialog files. However, in this case, you'd better do it in the same file as the code to set the token linked with the particular string.
    Since you want to use this on a very broad scale, you should ensure this is done as soon as the game starts. You could add that to a script in the starting area of the game. This one depends on the game.
    You don't need a variable. In the example, the use case was to display the value of a variable. In your case, you just want to link the token to your string. This may work:
    SetToken("FEMALE_SUFFIX", @1~~ ~a~)
    with
    @1 = ~~ ~a~
    for russian, and
    @1 = ~~ ~~
    for other languages.

    Then use your token like this (fake english example)
    @57 = ~I am Jhon~ ~I am Jane~

    Please don't take this for granted though.

    To restrict an item to a specific chararacter there is a new effect in Enhanced Editions. You can read details about it here and you can check various items in BG2EE that use it: Yoshimo's katana (NPSW02.ITM). In practise, most items whose code start with NP are NPC specific in BG2EE, if you need more examples.
    This is not compatible with older games. You'd have to include restrictions on strength and other characteristics of the NPC to simulate something similar with BG2 (that's how the NP items were made back then).

    Saigon1983
  • WhiteAgnusWhiteAgnus Member Posts: 112
    edited April 2015
    Isaya said:


    This is not compatible with older games. You'd have to include restrictions on strength and other characteristics of the NPC to simulate something similar with BG2 (that's how the NP items were made back then).

    You could also use opcode #180 to simulate this in the older games, without setting strength, etc...

    #180 (0x180) Item: Can't Use Item [180]
    Parameter #1: String Reference
    Parameter #2: Undefined
    Description:
    The targeted creatures(s) cannot use the item specified by the resource key. The strref specified by the 'String Reference' field is displayed when an attempt to use the item is made.
    Create a spell with effect type 180, Target 'Everyone except self', String reference 'This item only can used by NPC', Restriction 'Equip', Timing Mode 'Instant Permanent', Propability '100', Resource 'Itemname'.

    If the NPC joins the party or got the item somewhere later in the game you could cast the spell via the NPC script and the item only could used by this NPC... ;) (If you try to equip this Item to another NPC the String reference would be displayed in the inventory screen, like if you trying to take Minsc's Boo away...)

    IF
    Global("NPCGotHisItem","LOCALS",0)
    PartyHasItem("Itemname")
    THEN
    RESPONSE #100
    SetGlobal("NPCGotHisItem","LOCALS",1)
    ApplySpellRES("Spell",Myself)
    END

    Post edited by WhiteAgnus on
    elminster
  • Saigon1983Saigon1983 Member Posts: 156
    Is there any way to apply any item-set in the game? I.e., if my hero equips certain sword, certain shield and certain armor, he recieves any bonuses?

  • ArdanisArdanis Member Posts: 1,731
    If you want to keep it neat and tight - not really. It *might* be possible with new IWD:EE features, but I wouldn't hold my breath even then.

    My advise is to design the set in a way that each its piece complements the others. E.g. each item gives a small cumulative bonus to something, be it regeneration, resistance type, immunity to disabling one type of effects or what have you... This is more or less how item sets are implemented in Item Revisions mod.

    JuliusBorisov
Sign In or Register to comment.