Dialog/Python Commands

Discussion in 'Tech Guides and Help Threads' started by Phalzyr, Oct 7, 2003.

Remove all ads!
  1. Aido

    Aido Member

    Joined:
    Sep 28, 2003
    Messages:
    10
    Likes Received:
    0
    I did a bit of tinkering myself; I had some ideas but wasn't able to test them.

    Have a look at the .mes files in ToEE3.dat, there are 4 files that begin 'game_rd_npc_' that relate to rumours heard in the game and 4 more files 'game_rp_npc_' that relate to reputation based messages. The different reputations are explained in 'gamereplog.mes'.

    There are also a heap of .mes files for class and race based messages: they begin as 'gd_cls_', 'gd_rce_' or 'gd_sto_' but I have a suspicion that some of these may be left over from Arcanum and don't relate to this game, the 'gd_sto_' files certainly are.

    There are another 8 files that begin 'gd_npc_', 'gd_pc' and 'gd_dumb_' that you may want to look at as well, some of these contain general messages for affirmative and negative answers, for bartering and exiting and I recognise some of these myself from the game.

    I would think that modifying the above files would have some effect on the game, but I'm not sure why it works, you might have some ideas. If you get a chance to test any of this, can you let us know how you went?

    [edit: spelling.]
     
  2. Phalzyr

    Phalzyr Established Member Veteran

    Joined:
    Sep 25, 2003
    Messages:
    193
    Likes Received:
    1
    Aido: Thanks I'll look at those and see if they actually change anything in game or not.
     
  3. Phalzyr

    Phalzyr Established Member Veteran

    Joined:
    Sep 25, 2003
    Messages:
    193
    Likes Received:
    1
    Aido: Yep those were the right ones just a little hunting and I found the four that matters :) See first post.
     
  4. cneal

    cneal Member

    Joined:
    Oct 26, 2003
    Messages:
    7
    Likes Received:
    0
    Thanks :)

    I did get something out of this as I was able to write and execute a simple py code with a dialog.

    Firstly I began by looking into the dat files with the tools offered here and then I used one of the scripts that I dl here as a base. The file 00212burnebadger.dlg in the /dlg folder was backed up and then replaced with this code

    Code:
    {1}{Yes oh cneal sir? How can I help you?}{Yes oh cneal maam? How can I help you?}{}{}{}{}
    {2}{Call script}{}{8}{}{10}{game.global_flags[163] = 1}
    {3}{[exit]}{}{1}{}{0}{}
    {10}{Talk to me again sir}{Talk to me again maam}{}{}{}{}
    {11}{[exit]}{}{1}{}{0}{}
    {20}{Thank you for testing my script sir.}{This is the end of the test maam}{}{}{}{}
    
    I added a file in the /src directory called py00212burnebadger.py and in that I added

    Code:
    from toee import *
    
    def san_dialog( attachee, triggerer ):
    	if (game.global_flags[163] == 1):
    		triggerer.begin_dialog( attachee, 20 )
    	else:
    		triggerer.begin_dialog( attachee, 1 )
    	return SKIP_DEFAULT
    
    
    I then deleted any pyc files relating to the .py file (if I had ran the script previously) and I tested the script by talking to one of the soldiers where you start out in the game. Anyway, that's pretty much what I learned for today. I'm sure there are much better ways of performing this task that I'm bound to learn soon.

    Thanks for the resources!

    <a href="http://home.san.rr.com/cneal92/lawfulneutral.html"><img src="http://home.san.rr.com/cneal92/images/lawfulneutral.png"></a>
     
  5. cerda

    cerda Member

    Joined:
    Oct 16, 2003
    Messages:
    14
    Likes Received:
    0
    hardcoded actions

    In .py files you should find redefinition of standard actions (they start with san_)
    san_bust( attachee, triggerer )

    san_buy_object( attachee, triggerer )

    san_catching_thief_pc( attachee, triggerer )

    san_caught_thief( attachee, triggerer )

    san_critical_hit( attachee, triggerer )

    san_critical_miss( attachee, triggerer )

    san_critter_hits( attachee, triggerer )

    san_destroy( attachee, triggerer )

    san_dialog( attachee, triggerer )

    san_dialog_override( attachee, triggerer )

    san_disband( attachee, triggerer )

    san_drop( attachee, triggerer )

    san_dying( attachee, triggerer )

    san_end_combat( attachee, triggerer )

    san_enter_combat( attachee, triggerer )

    san_examine( attachee, triggerer )

    san_exit_combat( attachee, triggerer )

    san_first_heartbeat( attachee, triggerer )

    san_get san_unlock( attachee, triggerer )

    san_heartbeat( attachee, triggerer )

    san_hit san_throw( attachee, triggerer )

    san_insert_item( attachee, triggerer )

    san_join( attachee, triggerer )

    san_leader_killing( attachee, triggerer )

    san_leader_sleeping( attachee, triggerer )

    san_miss( attachee, triggerer )

    san_new_map( attachee, triggerer )

    san_new_sector( attachee, triggerer )

    san_remove_item( attachee, triggerer )

    san_resurrect( attachee, triggerer )

    san_spell_cast( attachee, triggerer )

    san_start_combat( attachee, triggerer )

    san_taking_damage( attachee, triggerer )

    san_transfer( attachee, triggerer )

    san_trap( attachee, triggerer )

    san_true_seeing( attachee, triggerer )

    san_unlock_attempt( attachee, triggerer )

    san_use( attachee, triggerer )

    san_wield_off( attachee, triggerer )

    san_wield_on( attachee, triggerer )

    san_will_kos( attachee, triggerer )
     
  6. Ausir

    Ausir Beholder Overseer Veteran

    Joined:
    Aug 25, 2003
    Messages:
    90
    Likes Received:
    0
    {PC line #}{2}{3}{4}{5}{6}{7}

    In PC lines, is 2 also the text for female characters, or do I have to add more lines with conditions (1 for male, 1 for female)?
    It's important for my Polish translation.
     
  7. cerda

    cerda Member

    Joined:
    Oct 16, 2003
    Messages:
    14
    Likes Received:
    0
    Ausir:
    two texts are only for speaking with PCs because noone knows what gender you've chosen for your character ...
    as far as there is no gender changing NPC the text for second gender doesn't have any sense ...
    as I looked into files for different genders ie. Mona x Black Jay, the game coders ignore the NPC gender in .DLG files
     
  8. Ausir

    Ausir Beholder Overseer Veteran

    Joined:
    Aug 25, 2003
    Messages:
    90
    Likes Received:
    0
    I'm not talking about different NPC genders, but about translation to Polish - here a sentence like "I was there" has two different form for male and female speaker.

    Edit: I checked, and it doesn't work. Damn, that means more work for us... We'll have to do it with making additional lines with "pc.stat_level_get( stat_gender )" condition.
     
  9. cneal

    cneal Member

    Joined:
    Oct 26, 2003
    Messages:
    7
    Likes Received:
    0
    Why not have a seperate polish npc and an english npc?
     
  10. cerda

    cerda Member

    Joined:
    Oct 16, 2003
    Messages:
    14
    Likes Received:
    0
    I wanted to say that when PC is speaking to NPC, value in the the first brackets ({2} in you notation) is used even if the NPC you're speaking to is female ...
    when NPC speaking to PC
    - {2} is for males and {3} is for females as was written above ...

    So as you said if there are two different ways of expressing "I was there" for different genders you have to fix it youself ...
     
  11. cneal

    cneal Member

    Joined:
    Oct 26, 2003
    Messages:
    7
    Likes Received:
    0
    One thing I would like to do is create a seperate NPC and attach that script to it instead of using the NPC that came with the game :p

    <a href="http://home.san.rr.com/cneal92/lawfulneutral.html"><img src="http://home.san.rr.com/cneal92/images/lawfulneutral.png"></a>
     
  12. cerda

    cerda Member

    Joined:
    Oct 16, 2003
    Messages:
    14
    Likes Received:
    0
    You probably have to add

    new NPC into
    ruels\protos.tab file

    portrait definition into
    art\interface\PORTRAITS\portraits.mes file

    short description displayed if you don't know the NPC's real name into
    mes\description.mes file

    quests into
    mes\gamequestlog.mes file

    NPC's inventory into
    rules\InvenSource.mes file
     
  13. cneal

    cneal Member

    Joined:
    Oct 26, 2003
    Messages:
    7
    Likes Received:
    0
    Instead of having the previous py code, I modified it with this

    Code:
    from toee import *
    
    def san_dialog( attachee, triggerer ):
    	if (is_daytime() == 1):
    		triggerer.begin_dialog( attachee, 1 )
    	else:
    		triggerer.begin_dialog( attachee, 200 )
    	triggerer.begin_dialog( attachee, 1 )
    	return SKIP_DEFAULT
    
    and I added {200}{Get some rest sir}{Get some rest maam}{}{}{}{} to the other file. This prevents anyone from creating coversation when they should be asleep :)

    owell, back to trick o' treating

    To note: the 1st NPC you meet in the DEMO version is nybble and his py script file is found here \data\scr\py00078gnome1.py

    <a href="http://home.san.rr.com/cneal92/lawfulneutral.html"><img src="http://home.san.rr.com/cneal92/images/lawfulneutral.png"></a>
     
    Last edited: Nov 8, 2003
  14. seebs

    seebs Member

    Joined:
    Sep 27, 2003
    Messages:
    7
    Likes Received:
    0
    Is there a way to add or remove feats?

    I ask mostly because, a couple of levels back, I selected the wrong Spell Focus, and I only noticed now.
     
  15. zhuge

    zhuge Established Member Veteran

    Joined:
    Sep 27, 2003
    Messages:
    484
    Likes Received:
    0
    It sounds like what you need is a saved game editor. Ferros made one sometime back and I believe it could alter feats but it was rather buggy and could make the game crash. Try searching around here and the Atari forums for his name. Sorcerer's Place might also have one of his earlier builds.

    Kharmakazy also made a trainer/editor IIRC, but I don't think it could edit feats.
     
Our Host!