3 questions about modding

Discussion in 'General Modification' started by 0rion79, Jun 8, 2005.

Remove all ads!
  1. 0rion79

    0rion79 Established Member

    Joined:
    Apr 9, 2005
    Messages:
    573
    Likes Received:
    0
    Hi: I need to know the following things.

    1 - let's say that I want to build a new monster. How do I equip him? Especially, what should I do if I want him to use a secondary weapon for 2-weapon fighting, except of giving him the proper feats in the protos? If I'm right, the protos already include a slot for NPC/monster's items but how should I "tell" the AI that I want my monster to use the axe in the right hand and the dagger in the left one?

    2 - how do I create a new mercant? What dialogues strings should I add and how may I make the difference between some mercants like The Brother Smith that refresh his stock daily, or Brune that never renews his stock?

    1 - how do I manage creatures' scripts? Let's say that I want an ogre magi to cast cone of cold the first fighting round, then to attack untill death. Is there a general process or is too complicated to be posted here?
     
  2. Allyx

    Allyx Master Crafter Global Moderator Supporter

    Joined:
    Dec 2, 2004
    Messages:
    5,001
    Likes Received:
    250
    1. invensource.mes contains a list of all the npc's and a list of all the item numbers from protos and the % chance of having each item when you encounter them.

    2. in your npc's dlg file add B: to go to a barter screen, in invensource.mes add your npc's buy list - not sure about the auto refresh thing try copying the list from the one you want it to be like, if that doen't work it's either a scripting thing or a .mob file thing (I know noting about either, but livonya seems to know a lot about scripting and/or both).

    3.In protos find your ogremagi, go to the spells list (near the end of the line) change the first slot to cone of cold, leave the rest blank - simple.
     
  3. 0rion79

    0rion79 Established Member

    Joined:
    Apr 9, 2005
    Messages:
    573
    Likes Received:
    0
    Allyx, I did some test and I still have some questions.

    Great, but this doesn't answer to the basic question: how do I have a NPC to equip a specific item? Does the game automatically assign items to the proper slots? But how, then, to assign a specific werapon to the second hand slot to a monster that has the 2-weapons-fighting feat? Let's say that I want to fix the balor so that he fights with his vorpal longsword and a flamming whip (spiked chain): how do I tell to the AI wich weapon he has to use and in wich hand?

    I'm very confused. In that file, I read the text buy_list_mum,X and then the list of item that the PC is currently carrying with him/herself that looks like they do NOT belong to the buy list. For example,
    Code:
    {Blacksmith: buy_list_num,7 100,6013 100,6011 100,6012 100,4077 copper,82 silver,28}
    but I can't find any buy_list file in the game. Any hint? Should I extract them from some file or create a new one to place in a specific folder?

    So, what's the use of the strategy.tab file? Only if I want to have a monster to make the X action only in specific circumstances? As you say, it looks like that the ogre magi would cast cone of cold as first action regardless of the fact that there may be other ogres in the line.
    Thanks.
     
  4. Shiningted

    Shiningted I want my goat back Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,654
    Likes Received:
    352
    I've seen ummmm 'equip_best' or something in the .py files for characters. As i said to u once before, look at the default 2-weapon stuff in Black Jay's file (00002).

    Damn this is hard without the game! Sorry i can't tell u more, my game hard drive is not plugged in.
     
  5. Allyx

    Allyx Master Crafter Global Moderator Supporter

    Joined:
    Dec 2, 2004
    Messages:
    5,001
    Likes Received:
    250
    Thats what scripts are for.


    try number 7: blacksmiths store


    for more complicated strategies, I made and tested a white dragon that had cone of cold x3, burning hands, ray of enfeeblement, and gust of wind, and 6 natural attacks per round, it worked fine with the same strategy.tab file as the ice lizard, as I used that as a starting point.
     
  6. 0rion79

    0rion79 Established Member

    Joined:
    Apr 9, 2005
    Messages:
    573
    Likes Received:
    0
    I would like so much to beat him :)
    Maybe one day.... in the meantime, I'll try making pratice using your advices and I guess that I confused the buy list (kind of things that NPC will buy) with NPC possessions.
     
    Last edited: Jun 10, 2005
  7. 0rion79

    0rion79 Established Member

    Joined:
    Apr 9, 2005
    Messages:
    573
    Likes Received:
    0
    Damn.... I don't understand what's wrong.
    I did some more test and I was able to trick the AI, making an item to be created in Guardian Balor's inventory when he speaks to me. Of course, the item is his missing fire whip, quickly shifted with a flamming spiked chain.
    It works great, as long as some good soul will point me a way to directly find and hack the mob files, that are the files that should really contain the owned items and that are listed in the protos (balor's is 165).
    But the problem is that that utterly idiot demon (well, indeed it is me who's not skilled in hacking, but don't argue about that :D) just puts back his renewed vorpal sword in his virtual backpack and fights only with the spiked chain. I gave him the proper feats in the protos and modified his py file as showed below, using the samples contained in Black Jay py file.
    Is anybody able to see if something is wrong or missing? Honestly, I can see nothing that may look like a command to put weapon X in right hand and weapon Y in left hand. As well, looking at liv's assassin gives me no clue.

    4133 and 4325 are the sword and the spiked chain.
    Code:
    from toee import *
    
    
    def san_dialog( attachee, triggerer ):
    	create_item_in_inventory( 4325, attachee )
    	attachee.item_wield_best_all()
    	triggerer.begin_dialog(attachee,1)
    	return SKIP_DEFAULT
    
    def san_heartbeat( attachee, triggerer ):
    	if (not game.combat_is_active()):
    		for obj in game.obj_list_vicinity(attachee.location,OLC_PC):
    			if (is_safe_to_talk(attachee,obj)):
    				obj.begin_dialog(attachee,1)
    				game.new_sid = 0
    				return RUN_DEFAULT
    	return RUN_DEFAULT
    
    def san_dying( attachee, triggerer ):
    	game.global_vars[30] = game.global_vars[30] + 1
    	return RUN_DEFAULT
    
    def san_heartbeat( attachee, triggerer ):
    	if (game.combat_is_active()):
    		return RUN_DEFAULT
    	if (attachee.name == 14358 and (not attachee.has_wielded(4133) or not attachee.has_wielded(4325))):
    		attachee.item_wield_best_all()
    		attachee.item_wield_best_all()
    		game.new_sid = 0
    def san_enter_combat( attachee, triggerer ):
    	if (attachee.name == 14358 and (not attachee.has_wielded(4133) or not attachee.has_wielded(4325))):
    		attachee.item_wield_best_all()
    		game.new_sid = 0
    def san_start_combat( attachee, triggerer ):
    	if (attachee.name == 14358 and (not attachee.has_wielded(4133) or not attachee.has_wielded(4325))):
    		attachee.item_wield_best_all()
    #		game.new_sid = 0
     
  8. Allyx

    Allyx Master Crafter Global Moderator Supporter

    Joined:
    Dec 2, 2004
    Messages:
    5,001
    Likes Received:
    250
    That scripting stuff is wasted on me, but just to make sure, does the balor have exotic weapon proficiency in spiked chain? and can he weild it one handed (its a two handed weapon)
     
  9. 0rion79

    0rion79 Established Member

    Joined:
    Apr 9, 2005
    Messages:
    573
    Likes Received:
    0
    The answer is yes to both.
    I previously changed the 2-handed vorpal sword into a big-size one handed longsword. A PC with englarge person spell active (or scroop or the troll leader) is able to handle it or the chain with 1 hand instead, because he is of big size like the Balor. So the size is right. It is missing something to tell the balor to put weapon X in hand X and weapon Y in hand Y.
     
Our Host!