Well whaddya know?

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

Remove all ads!
  1. darmagon

    darmagon stumbler in the dark

    Joined:
    Mar 22, 2005
    Messages:
    295
    Likes Received:
    0
    Okay, you might want to know this: column 4 (0 based) in the partsys.tab files affects the duration of the effect. Also, a spell with mutiple recipients will have the spell sound played once per recipient if the spell sound is specified in the "spell_effect" slot for the spell in snd_spell.mes. To avoid this, (for spells with mulitiple "effectees" , use the spell begin sound slot.

    Darmagon
     
  2. Cujo

    Cujo Mad Hatter Veteran

    Joined:
    Apr 4, 2005
    Messages:
    3,636
    Likes Received:
    1
    you can only make new clothes out of the ones that already exist in the game - creative thought onto how you can use the skm's is required

    there are 4 different areas you can apply a skin to - HEAD, GLOVES, BOOTS, CHEST.

    anything that goes {CHEST:art\meshes\ will replace the skin aplyed to the chest the same goes for the rest of the other areas.

    addmesh can be applyed without a skin eg helms - so you'll get invisable if you apply to the clothing slot, have some addmesh disapear if equiped to the robes slot and are wearing armour that has addmesh - or if the item has more than one addmesh it'll loose one of the meshes when you equip a helm.

    I havn't tested yet but I think that if you have the addmesh equip to the necklace slot that might do it (just a theory)

    to make complex clothings - ones with new addmesh you will need a hex editor
     
    Last edited: Feb 27, 2006
  3. darmagon

    darmagon stumbler in the dark

    Joined:
    Mar 22, 2005
    Messages:
    295
    Likes Received:
    0
    You can change the scripts of an npc on the fly by accessing the scripts attribute. It is an array which contains, apparently in the same order as in the protos, the number of the file for each script. So say you want to create a Greater temple bugbear and you want to have a conversation with him as though he were Jaroo:
    Code:
    bb = game.obj_create(14174, game.party[0].location)
    bb.scripts[9]=12# 9 is the number for san_dialog and 12 is jaroos script number
    
    Now just initiate dialog with him and there is a bugbear in front of you with Jaroos dialog coming out of him. Yeah I know, you could have done it in the protos but this way you don't have to change the protos.

    Not sure how useful this might be (except for such parlour tricks) but who knows....

    Also you can get a list (actually it's a tuple) of the feat numbers (as defined in feats.mes) a critter has with:
    Code:
    cf = critter.feats
    Again, probably not very useful (especially since you can't change the feats this way, and believe me I tried.)

    Darmagon
     
  4. Shiningted

    Shiningted I want my goat back Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,651
    Likes Received:
    350
    Fact: Attachee.float_line() is the best command in the game.

    However, it cannot properly be triggered from someone else's dialogue if they have vocals. For instance, if you did the following:
    Code:
    def	npc_float( attachee, triggerer ):
    	npc = find_npc_near(attachee,14681)
    	if (npc != OBJ_HANDLE_NULL):
    		npc.float_line(610,triggerer)
    The floatline WOULD appear but any vocals would be lost because the game turns down other sounds when a critter is talking.

    This assumes the attachee critter has vocals of course (that is, an appropriately numbered folder in data/sound/speech). Otherwise it would probably work ok :)
     
    Last edited: Feb 3, 2006
  5. Shiningted

    Shiningted I want my goat back Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,651
    Likes Received:
    350
    Fact: we have a new forum!

    Just a reminder that the things that are found in utilities.py can be used individually. For instance, if we look at the familiar is_safe_to_talk()
    Code:
    def is_safe_to_talk(speaker,listener):
    	if (speaker.can_see(listener)):
    		if (speaker.distance_to(listener) <= 15):
    			return 1
    	return 0
    we can still use if (attachee.can_see(triggerer)): as a seperate command in a script - damn good way of establishing line of sight :)

    EDIT: There is also a has_los (has line-of-sight) command which works just fine.
     
    Last edited: Dec 9, 2006
  6. Allyx

    Allyx Master Crafter Global Moderator Supporter

    Joined:
    Dec 2, 2004
    Messages:
    5,001
    Likes Received:
    250
    I just realized I never actually posted the "disappearance/reappearance" trick in huge detail...

    Firstly you make a new mobile object (the NPC you want to "move", and set the following object flags:
    OF_SEE_THROUGH
    OF_SHOOT_THROUGH
    OF_PROVIDES_COVER
    OF_SET HEIGHT
    OF_RADIUS_SET

    Make sure your NPC's San_heartbeat entry in protos.tab is set to look for your NPC's script file. The following is a portion from the Lord Viscount's (in Verbobonc) script file...

    Code:
    def san_heartbeat( attachee, triggerer ):
    	if (is_daytime() == 0 and attachee.map == 5122 and game.global_flags[992] == 0):
    		attachee.object_flag_set(OF_OFF)
    	elif (attachee.map == 5122 and game.global_flags[992] == 1):
    		attachee.object_flag_set(OF_OFF)
    	elif (is_daytime() == 1 and attachee.map == 5132 and game.global_flags[992] == 0):
    		attachee.object_flag_set(OF_OFF)
    	elif (attachee.map == 5132 and game.global_flags[992] == 1):
    		attachee.object_flag_set(OF_OFF)
    	else:
    		attachee.object_flag_unset(OF_OFF)
    	return RUN_DEFAULT
    Now map 5122 and map 5123 are his home and his office maps, global_flags [992] is set to 1 when he is dead (so he doesn't appear in location 2 after you killed him in location 1).

    The Smigmal escape example is also quite useful, it's triggered by dialogue this time though...

    Code:
    def smigmal_escape( attachee, triggerer ):
    	attachee.object_flag_set(OF_OFF)
    	game.timevent_add( smigmal_return, ( attachee, ), 7200000 )
    	return RUN_DEFAULT
    
    def smigmal_return( attachee ):
    	attachee.object_flag_unset(OF_OFF)
    	game.global_flags[144] = 1
    	return RUN_DEFAULT
    When it works right it's ALL good! ;)
     
  7. Cuchulainn

    Cuchulainn Windmill Tilter

    Joined:
    Jan 16, 2006
    Messages:
    611
    Likes Received:
    0
    Inventory Icons.

    Hey I finaly get to post something here.:) This won't be news to the longtimers, but it took me ages to figure it out and it doesn't seem to be posted anywhere.

    Invetory icons are 64x64 tgas stored in data\art\interface\inventory. They are referenced in inventory.mes in the same folder. Column 53 (inventory icon) in the protos.tab contains a 3 digit # that matches an entry in inventory.mes The format for the file entry is
    {00xxx}{myfile.tga)
    So for new items just make your new 64x64 pic, save it in the right folder. Make the new entry in inventory.mes, and enter the 3 digit number in column 53 of you protos row.

    Also if you define the item in your tga as 100% alpha(white), leaving everything else as 0% alpha(black), the background will be treated as transparent. This means you don't see a black square around it when moving/dropping the item.

    Cuchulainn.
     
    Last edited: Jun 15, 2006
  8. darmagon

    darmagon stumbler in the dark

    Joined:
    Mar 22, 2005
    Messages:
    295
    Likes Received:
    0
    Okay, this is going to be a 3 part post (at least):)

    First: game.sound() is a function you can use to play sounds in the game (using a script or from the console.) Duh! pretty obvious. What has not been so obvious thus far (AFAIK) is how to use the function and this is my discovery. ToEE2.dat has a folder 'sound'. In that folder there is a file called 'SND_00INDEX.MES' which provides some index numbers for various other files to be found in the same folder. These other files have numbers assigned to certain sounds by path/file name relative to the sound directory. These 2 numbers are the arguments to use when calling 'game.sound'. First comes the number of the sound in the indexed file and then comes the number of the indexed file from 'SND_00INDEX.MES'. So, if you check it out , try this in the console (or script):
    Code:
    game.sound(690,1)
    This should give you the ice lizard attack sound......(Warning, not sure why but some sounds repeat a few times when invoked with this function. My first cursory check indicates that it is only brief sounds but that may be incorrect, More tests should be made.....)

    Second: I know I posted the method for finding out about the functions available upon a certain game object a long time ago but some recent posts have made it obvious that:either no one saw it or no one bothered to carry through with the steps . In any case please find the .txt files attached below. They don't tell you how to use the functions but at leat they list what is there so you can try to figure them out (as I did with game.sound())

    Third: included in the attached files below is a list of (possible) parameters for 'obj_set_int' and 'obj_get_int' (from char_attribs.txt) Be warned, it is certain that trying to use some of these with the aforementioned functions will cause a CTD. Others will give you what you want and still others have an arcane way of doing things which I haven't been able to fully crack yet (pm me for details if you are interested).

    Finally,also included with what I have attached below is a list of many of the unique identifiiers used in the game code 'toee_list.txt'. It is redundant in some instances but contains other information which might be useful.

    In case anyone happens to be wondering why I never shared these things before: First I did share the method for finding out much of this info somewhere else; Second I did repost toee_list.txt somewhere else and third I just discovered the sound stuff yesterday......:)

    EDIT:
    The one thing I forgot is :this: http://www.radgametools.com/bnkmain.htm
    with this we should be able to make our own bink video files and add them to the game....:) Haven't tested it yet but the label says....:)

    Darmagon

    EDIT BY SHININGTED: I hope Darmagon doesn't mind me saying this, but I believe he is in error on the use of the game.sound command.

    Its actually much simpler than it seems: you play the game sound, and the number of times you want to hear it. This explains the 'repeat sounds' Darmagon was experiencing. Thus the command

    game.sound(xxxx, y)

    will play sound xxxx on y number of occasions. Examples of this in action can be found in Spell785 - Use Vial.py.
     

    Attached Files:

    Last edited by a moderator: Apr 28, 2007
  9. Cuchulainn

    Cuchulainn Windmill Tilter

    Joined:
    Jan 16, 2006
    Messages:
    611
    Likes Received:
    0
    Transparency in model tgas.

    When editing a tga that get's wrapped around a model in game (either base or addmesh) you can define a part of the tga as 100% in the alpha channel, everything you've left as 0% alpha becomes transparent in game. This gives us a lot of flexability when making new items.

    Think the shoulder pads are to big on the studded leather and the collar looks stupid. Set only the portions of the addmesh you want keep as vissible.

    Desperatly want to make that diamond shaped shield you saw in a Heavy Metal comic. Open up the tower shield tga define a diamond shape inside the original shield as 100% alpha, and voila diamond shaped shield.

    When you remove portions of an addmesh the armor underneath shows through. Of course if you remove portions of the base armor you just get a hole. So it's not much use on base armor or clothing, unless of course you want a peg leg, a one armed man, or as Cujo said the headless horseman. ;)

    Cuchulainn.
     
    Last edited: Jun 15, 2006
  10. Shiningted

    Shiningted I want my goat back Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,651
    Likes Received:
    350
    Fact: Keeping track of things that are switched off can be a pain: even basic console commands like game.obj_list_vicinity() won't find things flagged OF_OFF.

    To at least check if they are there, easier than setting/unsetting flags with ToEEWB (or scripts), just stick some game.particles in the heartbeat as you would with any other script you are testing. Mage armor works great for this:
    Code:
    def san_first_heartbeat( attachee, triggerer ):
    	game.particles( "sp-mage armor", attachee )
     
  11. Cerulean the Blue

    Cerulean the Blue Blue Meanie Veteran

    Joined:
    Apr 23, 2005
    Messages:
    1,962
    Likes Received:
    0
    If you flag something as OF_OFF in the MOB, you won't be able to unset that flag from a script.

    EDIT BY SHININGTED: Actually you can: I think Blue has noticed that too ;)
     
    Last edited by a moderator: Apr 28, 2007
  12. Shiningted

    Shiningted I want my goat back Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,651
    Likes Received:
    350
    Apparent fact (painfully tested): The first time you enter a map, all the first_heartbeat files will fire everywhere. However, if you have been there before, they only fire as you enter their sector.

    Theory: Clearing the map_cache may change this.

    Edit: Deleting the .pyc might change this too, but you rarely do it as part of playing a normal game ;)

    2nd Edit: This has NOT happened consistently for me (or it has consistently happened on some large maps and consistently not happened on other large maps).

    Just be aware that on any subsequent visit, you may have to come within 'range' to activate a first heartbeat file on a mob that is a fair distance from the landing spot.
     
    Last edited: Apr 28, 2007
  13. Allyx

    Allyx Master Crafter Global Moderator Supporter

    Joined:
    Dec 2, 2004
    Messages:
    5,001
    Likes Received:
    250
    NPC Generators.

    Question: How do those rats in the Moathouse keep coming back?

    Answer: There is one rat that is set as an NPC generator, it repeatedly spawns rats until the maximum number of rats (127) have been spawned.

    Question: How do I make an NPC generator?

    Answer: Open ToEEWB, on the "Objects" tab click "New" to make a new mobile, select the monster type you want to generate (only one type per generator) in the "prototype:" field check the dispatcher check box, and set the X-Y co-ordinates and rotation you want the creatures to originate from.

    Next, set the flags...

    OBJECT FLAGS (set the following)
    OF_OFF
    OF_SEE_THROUGH
    OF_PROVIDES_COVER
    OF_INVULNERABLE
    OF_HEIGHT_SET
    OF_RADIUS_SET

    NPC FLAGS
    ONF_WAYPOINTS_DAY
    ONF_WAYPOINTS_NIGHT
    ONF_KOS (not needed, but can be set if you want the critters to attack on sight)
    ONF_GENERATOR

    Next, on the "NPC/Critters" tab check the Waypoints check box and set some waypoints (area's you want your generated critters to wander to, in sequence).

    Now go to the NPC Generator tab, check the "NPC is a Generator" check box, set the Generator ID number (the rat's in the moathouse are number 1, i'm using 2-7) I think the numbers must all be different from eachother.

    Check the boxes to activate the generator at day and or night, (not sure what active on screen is yet) Check "spawn all to get the selected number of critters to spawn simultaneously, or leave blank to spawn one at a time, put the number of critters you'd like active at anyone time from this spawner in the "Concurrent Spawn Maximum" box (Max number is 31).

    Set the "Total Spawn Number" (Max 127) check the box to ignore this number. and set the "Spawn Beat Rate" (the moathouse rats respawn every second). Now save your mobile and put in in the map folder you want it to be in.
     
    Last edited: Apr 26, 2006
  14. Allyx

    Allyx Master Crafter Global Moderator Supporter

    Joined:
    Dec 2, 2004
    Messages:
    5,001
    Likes Received:
    250
    Scout points

    Question: How do I get a monster to run off and warn his buddy's that i'm in the area, like that bugear in the Moathouse does?

    Answer: Give it a scout point, here's how...

    Make your new mobile set the prototype, location and rotation (as I detailed above for the generator) and set these flags...

    NPC flags
    ONF_WAYPOINTS_DAY
    ONF_KOS

    NPC/Critters 2
    Check the "Standpoints" checkbox and put the same co-ordinates you selected for the critter before for both day and night standpoints. The X Y offsets can be adjusted to shift the critter around the selected tile if it looks a little odd, and don't forget the map number.

    Check the "Scout X" check box, and enter the co-ordinates you want the critter to run to, if there are critters around that location, they too will become active and added to the combat initiative order.
     
    Last edited: Apr 26, 2006
  15. darmagon

    darmagon stumbler in the dark

    Joined:
    Mar 22, 2005
    Messages:
    295
    Likes Received:
    0
    Item slot as per item_worn_at

    • 0-hat/eyeglasses
    • 1 necklace
    • 2 gloves
    • 3 primary weapon
    • 4 secondary weapon / big shield
    • 5 armor
    • 6 primary ring
    • 7 secondary ring
    • 8 boots
    • 9 ammo
    • 10 cloak
    • 11 2nd shield spot/ buckler spot
    • 12 robe
    • 13 bracers
    • 14 bard's instrument
    • 15 thieves tools
     
    Last edited: Jun 2, 2006
Our Host!