Well whaddya know?

Discussion in 'ToEE Toolset Project Documentation' started by Shiningted, Jul 2, 2005.

Remove all ads!
  1. Shiningted

    Shiningted I want my goat back Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,651
    Likes Received:
    350
    Ok this is meant to be a thread like the one Gaear started for fixing known issues: this one is for things we discover while modding that others may not realise. Just cool little things or things that aren't obviously apparent. Since so many of us are modding in such different directions (weapons, spells, clothes, bardic instruments, feats, skills, dialogue etc) we could quickly build quite a little archive.

    Lets use this sensibly and no debating things: just post what you know. If someone posts something grossly wrong, PM them so they can test it and fix it, don't argue the toss on here.

    Hope people find this useful and I don't just post a couple things everyone knows :yeaaa:
     
  2. Shiningted

    Shiningted I want my goat back Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,651
    Likes Received:
    350
    Fact: If you want a creature to attack on sight, add ONF_KOS (kill-on-sight?) in col 152 of the protos. Alternately, if you create a new monster by copying an existing one but don't want it to attack on sight, make sure this flag isn't there.
     
  3. Shiningted

    Shiningted I want my goat back Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,651
    Likes Received:
    350
    Fact: you can create visual effects right in the dialogue file, you don't need to script them in the .py file or import utilities or such. For instance, if you wanted to have an NPC suddenly explode like a fireball, you might have:

    {100}{You make me so angry, Player 1, I feel I am gonna explode!!!}{You make me so angry, Player 1, I feel I am gonna explode!!!}{}{}{}{game.particles( 'sp-Fireball-Hit', npc )}

    Edit - just noticed Liv used this in one of the Lareth dlgs, along with a couple other things I thought i had 'discovered'. Always 2 steps ahead :clap:
     
    Last edited: Jul 20, 2005
  4. darmagon

    darmagon stumbler in the dark

    Joined:
    Mar 22, 2005
    Messages:
    295
    Likes Received:
    0
    fact: in the game console you can use the following sequence of commands to write a file of the functions available for a certain object:

    Code:
    f = open('filename.txt', 'w')
    f.write(str(dir(obj)))
    f.close()
    where 'filename.txt' is the name of the file you want to write to.
    obj is the name of the object you want to know about (ie. game or game.party[0] etc.)

    the quotes around the names must be included as above in the code section. after each line you need to hit the enter key.

    The file will show up in the 'modules\ToEE' directory under your main Temple of Elemental Evil install directory.

    Darmagon
     
  5. Cujo

    Cujo Mad Hatter Veteran

    Joined:
    Apr 4, 2005
    Messages:
    3,636
    Likes Received:
    1
    what I know and want to know;
    the only differences between a human male and an elf male in the protos, is model size, race_*, protrait pic# and subtype.

    so how does it know to put the elf skin onto an elf, it uses the human male's model, if its because of the race subtype is there a list anywhere (and can it be added to). I've come to the conclusion that the humanoid models have some code so that they can wear different skins, unlike other models which don't change clothes. If the male elf didn't use the male humans model I'd probly would be wondering some thing else (the halfling and gnomes also use the humans model)
     
    Last edited: Jul 15, 2005
  6. Shiningted

    Shiningted I want my goat back Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,651
    Likes Received:
    350
    Theory (heavily tested): To check if it is night, you seem to have to use the script
    is_daytime() != 1

    rather than

    is_nighttime() == 1
     
  7. Shiningted

    Shiningted I want my goat back Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,651
    Likes Received:
    350
    Fact: to add a random encounter, first you have to script it in whatever triggers it. For instance, Thrommel's reward is triggered by the script
    schedule_reward(npc,pc)

    which is defined as follows:

    Note the time thing: if you don't want to wait for ages, put in a lower number (2000 works for me!)

    Now, give_reward is defined as follows:

    This is the moneyshot. Note 3001: that is the number that will turn up in the random_encounter.py file. Pop this now and look for the bit that says:

    def check_predetermined_encounter( setup, encounter ):

    Underneath you will see a series of id #'s for random encouters (rewards by and large, I suspect): 3000, 3001, 3002, 3003, and whatever else has since been added. So, put your id number in there, with a script to spawn the desired 'enemy', and a matching id # back in the def give_reward script of whatever is triggering your encounter.

    But don't touch 3010. Thats MINE. MINE YOU HERE ME!??!?

    And don't touch 3011 or 3012 either, they're Cujo's. He bites, you know. :giggle:

    EDIT: Lets not overuse this, btw: sometimes you just wanna walk to Nulb!
     
  8. Cujo

    Cujo Mad Hatter Veteran

    Joined:
    Apr 4, 2005
    Messages:
    3,636
    Likes Received:
    1
    protos.tab looks for meshes.mes in the model colum*
    protos.tab looks for materials.mes in the colour colum**
    protos.tab looks for addmesh.mes in the colour colum**

    meshes.mes line example
    {12166}{armor\gladiator\gladiator_armor_ground}
    its looking for file, gladiator_armor_ground***
    12166 is the model number in the protos for this example

    materials.mes line example
    {14300}{CHEST:art\meshes\armor\gladiator\gladiator _male_hu.mdf}
    its looking for file, gladiator_male_hu.mdf***

    gladiator_male_hu.mdf looks for/contains this text...
    Textured
    Texture "art/meshes/armor/gladiator/gladiator_male_hu.tga"

    addmesh.mes line example
    {14300}{art\meshes\armor\gladiator\gladiator_M_hum an_addm.SKM}
    its looking for file, gladiator_M_human_addm.SKM***
    14300 is the colour number for this example

    *found in data/art/meshes
    **found in data/rules -the clothings in this have to have matching sets of numbers
    ***found in data/art/meshes/armor/gladiator
     
  9. Cujo

    Cujo Mad Hatter Veteran

    Joined:
    Apr 4, 2005
    Messages:
    3,636
    Likes Received:
    1
    Hey I just had an idea. I know how to make elmo stop swaying perminently (just change his model number from 503 to 100) now If anyone knows how darley changes, then you could do the same thing with elmo to have him swaying when out of your party untill you hire him.

    have I explained that very well?
     
  10. Agetian

    Agetian Attorney General Administrator

    Joined:
    Aug 14, 2004
    Messages:
    2,526
    Likes Received:
    0
    Fact: you can assign standpoints to creatures when they are first created with a heartbeat script, using the commands:

    attachee.standpoint_set(STANDPOINT_DAY, ***)
    attachee.standpoint_set(STANDPOINT_NIGHT, ***)

    Where "***" should be replaced with a number from jumppoint.tab corresponding to a jump point that is to be used as a creature's standpoint.

    Note that the MOB way of scripting standpoints works, but I can't yet find out how to make the creature change maps on standpoint change (e.g. go from a map to another map if the standpoint requires to do that), so if you want that effect you can script it.

    - Agetian
     
  11. Agetian

    Agetian Attorney General Administrator

    Joined:
    Aug 14, 2004
    Messages:
    2,526
    Likes Received:
    0
    Making scripts run only once without global flags

    Here's a nifty way to make the scripts run only once without having to waste a global flag or a global variable to check whether it has already been run. Say, we want a certain heartbeat script to run only once. Then we do:

    Code:
    def san_heartbeat ( attachee, triggerer ):
              .......                      # our code here
    
              game.new_sid = 0
              return RUN_DEFAULT
    
    By using game.new_sid=0 we disable the script and prevent it from running further.
    Hope this helps.

    - Agetian
     
  12. Shiningted

    Shiningted I want my goat back Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,651
    Likes Received:
    350
    May as well bump this, some useful stuff here.

    Apparent Fact: To keep sectored doors (ie internal doors, not passage icons) RE-appearing on maps without the map having a total conniption, the 'provides cover', 'radius' and '3d render height' flags have to be set, with appropriate values.

    EDIT: This is wrong, sorry: it was a problem that was sorted by, errr, Sector Sort.
     
    Last edited: Dec 9, 2006
  13. Shiningted

    Shiningted I want my goat back Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,651
    Likes Received:
    350
    OCF_SLEEPING seems to do very little - it appears to be similar to 'mute', in that it causes the NPC to not respond to being 'clicked' on, though s/he continues to stand there as normal. Certainly the NPC does not fall to the floor asleep.

    OCF_PARALYZED causes the NPC to freeze, like a model in a far away sector (think the Hommlet map, if u r at one end and you scroll over to the other, you will see Burne's Badgers etc standing around frozen, they don't start to move til u enter their sector). If u freeze a character will they are unconscious (<0 HP) they will remain frozen on the ground even if brought back to >0 HP.

    Edit by SA:

    DO NOT use OCF_PARALYZED only by itself. If the character enters combat, it will freeze the game on their turn!


    I have tried to use it to do petrified creatures. It worked quite well, other than the above...

    To combat this, you can set the OF_OFF flag - this will prevent the character from entering combat. But it will also make it disappear...
     
    Last edited by a moderator: Nov 14, 2013
  14. darmagon

    darmagon stumbler in the dark

    Joined:
    Mar 22, 2005
    Messages:
    295
    Likes Received:
    0
    Au contraire, Shiningted, OCF_SLEEPING does exactly what I need it to to disallow dialog in the spell Time Stop. Thanks, I hadn't even thought of it .

    Darmagon
     
  15. Shiningted

    Shiningted I want my goat back Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,651
    Likes Received:
    350
    Fact: Deleting things from the protos.tab will cause the game to CTD!

    By this, I mean things originally in there. My ProtoEd stopped working in 98 - the current protos.tab is just too big for it, it seems - and by 'stopped working' I mean 'corrupted the hell out of the damn thing'. So to keep it useable for KotB I deleted stuff like the characters and items from DH that would never make an appearance, shrank the protos.tab to a manageable size and kept hacking away. However, since I have been adding a lot of new, unique items, I went looking for more things to delete. I got rid of Wonnilon's backpack, but next time I ran the game, it CTDed while loading (in the sectoring bit, not the protos bit).

    Although in KotB none of the maps etc from ToEE get used, they are still in there, in the .dat file, and they still get 'loaded' at the begining. The game hit the point where the .mob for Wonnilon's backpack is, found no corresponding proto and CTDed.

    Toffee supports user-made .dat files and in the future this may not be an issue but for now, anyone making a new module has to modify or expand whats there, you can't just delete the existing stuff.
     
Our Host!