WB Tutorial Questions

Discussion in 'General Modification' started by Ranth, Jan 17, 2009.

Remove all ads!
  1. Ranth

    Ranth Established Member

    Joined:
    Jan 26, 2008
    Messages:
    829
    Likes Received:
    0
    Another major issue I am facing is as follows.

    I make my tutorial mod, front end sees it, I activate it, and then I play. I fixed the errors we went over yesterday (in the above posts) and everything works fine (dialogue and gaining 3 levels). Note: At this point I am using data/scr and data/dlg (per Ted's instructions) for the location of script and dialogue files.

    The problem occured when I activated the 5.5.0 mod to grab some of the map folders for use in my new mod. When I reactive my mod in front end, the SCR and DLG folders are now in modules/ToEE/ folder (the activation must have moved them there) and the gain 3 levels and dialogue scripts do not work in game.

    Furthermore, if I copy and paste the SCR and DLG folders from modules/ToEE/ and place them in the data folder, the scripts and dialogue still do not work in game. I believe they are losing their formatting.

    Are these known issues? Are there work-arounds?

    Also, console commands do not seem to work. I cannot game.fade_and_teleport to my new map nor can I from ed input * to get the new commands (with the ed.py file in my SCR folder). Any ideas?
     
  2. Agetian

    Agetian Attorney General Administrator

    Joined:
    Aug 14, 2004
    Messages:
    2,526
    Likes Received:
    0
    The module activation and reactivation will completely overwrite your current module information with the one in the .tfm file. Therefore, unless you update the .tfm file with your changes, your new module structure will get destroyed and will be replaced with your older module structure from the .tfm file. Therefore,

    1) Make sure you update the .tfm file every time you make changes to the module files or their structure.

    2) You're advised to keep your unpacked mod files somewhere outside the game folder so they don't get overwritten in case you need to switch to other modules to do something.

    - Agetian
     
  3. Ranth

    Ranth Established Member

    Joined:
    Jan 26, 2008
    Messages:
    829
    Likes Received:
    0
    But if I do not switch modules, I am able to edit the files directly in the ToEE folder correct? It just makes it quicker than zipping, renaming, and activing a TFM file for each item I add.
     
  4. Shiningted

    Shiningted I want my goat back Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,654
    Likes Received:
    352
    Yeah: just be aware that you lose everything if you activate somehing else, so save your changes elsewhere as Ag said.
    Not really. Firstly, to see the changes to the map, you would have to clear the map cache: thats precisely what that procedure does, it forces the game to 'recompile' any given map, taking new changes (and mods) into account.

    Worse still, if you don't clear the map cache and introduce changes, then there is a chance the map will not gel with the smaller versions stored in saves etc (for instance, saves keep track of how much of a map you've unfogged) and you will get problems. When I first introduced Frank's door in ToEE, it caused major problems in existing games (ie start a new game to get it to work). You can't have players start a new game for something thats introduced half-way through, and you can't guarantee they will even reload and clear the map cache (unless you tell them to at some point in the game, which sorta breaks the magic) so you will have to do it some other way.

    One option is to recreate the map (with your changes) and slyly send the party to the new map, thinking they are at the old map. But again, if it is the moathouse backdoor, thats a Worldmap map, so you can't really do that either.

    Modding ToEE is as much about acknowledging what we can't do as it is about doing what we can do :)
     
  5. Ranth

    Ranth Established Member

    Joined:
    Jan 26, 2008
    Messages:
    829
    Likes Received:
    0
    Thanks Ted.

    I am kinda determined to make my new map idea work, so I am going to try everything I can. I wish I could write a script that says 'When someone clicks this World Map icon, if this global variable is present, use this map folder. Else, use this one.' but I guess its not that easy.

    Another question. Since I am gearing this to high level parties... is there a max # of characters/monsters that can be in a fight? I believe I had a fight of 24 or 26 people/monsters in the first level of the temple against some bugbears, is there any limit?

    Finally, does the game automatically calculate how much experience a kill is worth based on its stats, or do I need to declare that somewhere in the protos or when I make a new object?
     
  6. GuardianAngel82

    GuardianAngel82 Senior Member

    Joined:
    Oct 3, 2007
    Messages:
    3,481
    Likes Received:
    5
    I believe it's 30 players and npc's. Any addional npc's wait until a slot is open. I once fought 8 copies of the moathouse ambush...~120 bad guys. Whee!
     
  7. Ranth

    Ranth Established Member

    Joined:
    Jan 26, 2008
    Messages:
    829
    Likes Received:
    0
    Ted,

    I did some research into Python script. What if I did this to make the cave scenario work?

    1) You have the normal moathouse backdoor with artwork/sectoring.
    2) Something happens in-game (while the party is not on the cave map) and it runs a script.
    3) The script deletes the moathouse backdoor map folder.
    4) The script renames another folder with the new artwork with the original folder's name.

    Since Python can delete files and rename files, it should be able to do this right? Then the next time the party goes to that place on the map, the game will load the new artwork and sectoring (plus any MOB files, ect).

    This should work right?

    EDIT: The first script should not delete the folder. It would rename it. I was thinking of situations where loading saved games where the global event did not happen yet, but it would still load the new artwork (assuming the new artwork folder replaced the old one in a new save). There would need to be a script that ran at the beginning of each load and name/rename the correct folder based on the global variable.
     
    Last edited: Jan 20, 2009
  8. Shiningted

    Shiningted I want my goat back Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,654
    Likes Received:
    352
    Yes, that should work for the artwork (I think). I am saying I don't think that will work for the sectoring (which is in a different folder, btw), because the recompiling of the map happens when you start the game, at the 'clearing sector data' stage or whatever its called (if the game doesn't find the weirdly named little files that are its 'compiled' versions).

    But hey - by all means try these things Ranth :) If you are that determined I bet you will find a workaround of some sort.
     
  9. Ranth

    Ranth Established Member

    Joined:
    Jan 26, 2008
    Messages:
    829
    Likes Received:
    0
    Well if the sectoring is in a different folder, then I dont need to rename folders to trick the computer. I could just have a script replace the MapList.mes file with a new MapList.mes file that directs that world map location (# map #) to a new folder (with the updated artwork). That way the sectoring data will remain intact (the new artwork folder will load the sector data on startup).

    This is assuming the game does not load the MapList.mes and hold it in memory throughout the game. I am hoping the game refers to it throughout the game.
     
  10. Shiningted

    Shiningted I want my goat back Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,654
    Likes Received:
    352
    Yup, that may very well work :)
     
  11. Ranth

    Ranth Established Member

    Joined:
    Jan 26, 2008
    Messages:
    829
    Likes Received:
    0
    Has anyone figured out how to add the water animation in the the Hommlet river to a map? If so, any direction is helpful.
     
  12. Ranth

    Ranth Established Member

    Joined:
    Jan 26, 2008
    Messages:
    829
    Likes Received:
    0
    I cannot find the Protoypes for any of the major NPC's in WB. I looked for Terjon, Calbert, and Burne but none of them were under their name in the Prototype tab (Brune's apprentice was though).

    Are these character's under other known names or in a different file?
     
  13. Shiningted

    Shiningted I want my goat back Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,654
    Likes Received:
    352
    Yup. Check their IDed numbers as well (col's 22 & 23). There are often 3 seperate number for an NPC:

    - proto #
    - IDed # (once you have met them)
    - other number

    So Elmo might be prototype 14013 (for memory), which is 'drunk' in Description.mes, then his IDed # might be 20050 or so (which is 'Elmo' in Description.mes) and his other number is 8001 which is what you will find in his scripts (find_npc_near, that sort of thing). Complicated, but you'll get used to it.

    In a nutshell, look at the prototype # in description.mes for the entry you want to find in WorldBuilder.
     
    Last edited: Jan 23, 2009
  14. Ranth

    Ranth Established Member

    Joined:
    Jan 26, 2008
    Messages:
    829
    Likes Received:
    0
    Thank you Ted. I am getting into the nitty gritty of scripting and I have some questions. Is there a file, or does Co8 have a list of all the global flag #'s and what they represent? I need to start making some for my expansion, but I dont want to overwrite any. I saw the forum post regarding them, but I know it must have been updated with recent expansions. Is there an updated list?

    Some more questions. I have this script:
    Code:
    	if (anyone( triggerer.group_list(), "has_item", 2203 ):
    		triggerer.begin_dialog( attachee, 2010 )
    This should look for the golden skull in the party, and if it finds it, start dialogue line 2010. But the dialogue only works if the PC with the skull speaks to the NPC, not anyone in the party. Any ideas?

    Also, is there a command to destroy an item? I found this:
    pc.item_transfer_to(npc,2203)
    But then the NPC has the item, which you can kill to get the item back.

    Finally, is the moathouse ambush run by a script in the SCR folder? I cannot find it nor could I find a script file in the Map folder. If a script does check for the ambush, I sure would like to see it to use some of it.
     
    Last edited: Jan 24, 2009
  15. Shiningted

    Shiningted I want my goat back Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,654
    Likes Received:
    352
    You've already posted the 'destroy' command yourself :p;

    attachee.destroy()

    Just change 'attachee' to whatever handle you have on the item. For instance:
    Code:
    gold_skull = pc.item_find(2203)
    if gold_skull != OBJ_HANDLE_NULL:
    	gold_skull.destroy()
    Always make sure you have

    from utilities import *

    at the start of any script using OBJ_HANDLE_NULL because it will be calling a utility script that will return that answer (if appropriate).

    Not sure where the ambush script is, nor why your earlier one didn't work with anyone in the party :scratchhe
     
Our Host!