Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
dunde said:
I see.  May be checking for a whole inventory in tableau_game_inventory_window works.
It just draw player's picture with equipment, does not it?
I don't see how it could help.
 
Rongar said:
It is possible to push a modified item to any troop either using operations that work with inventory or directly editing troops.txt (in contrast to module_troops.py where only plain items can be specified). On a battle field probably I could get modifier via nice wse agent_item_slot_modifier (maybe even could find work around for multiple shields).
But my problem that in the first place I need it for merchants that are heroes but may hold multiple instance of items with the same id in inventory.
If you are talking about hero troops, you should be able to get the modifier by using (troop_get_inventory_slot_modifier,<destination>,<troop_id>,<inventory_slot_no>), no? All agents based on a hero troop template will have their equipped items based on the items in the appropriate ek_slots, so far as I am aware.
 
Caba`drin said:
If you are talking about hero troops, you should be able to get the modifier by using (troop_get_inventory_slot_modifier,<destination>,<troop_id>,<inventory_slot_no>), no? All agents based on a hero troop template will have their equipped items based on the items in the appropriate ek_slots, so far as I am aware.
That's not quite right, because equipment can be overridden by an entry point, but anyway how can I get inventory_slot_no in ti_on_item_init trigger?
I investigate possibility to make multitexture depending on item modifier.
 
Rongar said:
I investigate possibility to make multitexture depending on item modifier.
That explains why you insist to do it in ti_on_item_init. How about counting up? As far I know, when items shown up in the inventory windows, ti_on_item_init will return troop_id but with agent_id = -1. I'm not sure if the initialization order is, but if they're ordered by inventory slot, then you can initialize a global variable to 0 before calling trading screen. Counting up on every ti_on_item_init and use the counter according the inventory_slot to get the modifier.
 
Caba`drin said:
A loop through the ek_slots checking for equality with the item the trigger gives you. Shouldn't be too many instances where the troop has two of the same item ID equipped.

Rongar said:
On a battle field probably I could get modifier via nice wse agent_item_slot_modifier (maybe even could find work around for multiple shields).
But my problem that in the first place I need it for merchants that are heroes but may hold multiple instance of items with the same id in inventory.

Sorry for selfciting.

dunde said:
I'm not sure if the initialization order is, but if they're ordered by inventory slot, then you can initialize a global variable to 0 before calling trading screen. Counting up on every ti_on_item_init and use the counter according the inventory_slot to get the modifier.
That's interesting. Seems with enough efforts it's feasible even to track movement of items in inventory correct. Thanks for hint, dunde.
 
I had seen that. It may not be the best option, but it is an option and I believe my point stands. Merchants won't have multiple copies of the same item equipped, that is, in the ek_slots 0-9. What they contain in the remainder of their inventory is moot.

But perhaps I'm missing something and this is truly a dead-end.
 
Caba`drin said:
It may not be the best option, but it is an option and I believe my point stands. Merchants won't have multiple copies of the same item equipped, that is, in the ek_slots 0-9. What they contain in the remainder of their inventory is moot.
If item is equipped, agent_get_item_slot_modifier is shortcut.
Working with inventory of troop of agent produces a lot of bugs. 
 
Rongar said:
It is possible to push a modified item to any troop either using operations that work with inventory or directly editing troops.txt
Is that the field defaulted to 0 in troops.txt?
With regards to your question about transactions, you can try using game_get_item_extra_text which gets the imod as the 3rd parameter. If the player mouses over the item, it should trigger. Not too sure about Ctrl+Clicking though.
 
I'm trying to use a custom skybox for the world map, but it makes all the map icons and terrain super bright. If I turn off HDR in my video settings it looks normal, but obviously I would rather not have to do that. Is there anything special I have to do set up a skybox?
 
Okay, just for curiosity sake.... How exactly would I go about adding a delay to an action.
Basically something like:
ti_on_weapon_attack
<action>
<<<Add Delay>>>
<Action2>

Any ideas how to add a simple timed delay without using a crazed Mission Template trigger? Or, could someone give me an example of a trigger that would do that?
 
You're most likely going to end up using two triggers, the latter looping over all possible agents. Or, you could try spawning a scene prop well below the ground, store the agent/location/whatever data you need in its slots, animate it for the delay you need, then use ti_on_animation_finished to trigger the second action. Theoretically, the latter trades memory overhead for time.
 
Hmm.... Shoot. Back to the drawing board then. I'm working on making burst firing through WSE, but I have to have miniscule delays between the spawning of bullets. :razz:
 
I have a quick question, how do you change how much a companion costs?

In little script things for companions like this:
Code:
trp_npc1 Borcha Borcha 0 268435472 0 0 1 0 0
  203 0 171 0 382 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 
  8 7 12 7 3
 60 60 60 60 60 60 0
0 52559872 3 4130 69632 0 
  20384866627 2710329261906387509 1946924 0 0 0 0 0
I'm not sure which one, if there is any, determines how much he costs.
 
I was testing adding NPC's with add_visitors_to_current_scene.

But I'm not sure what is the "NPC GROUP" (last parameter). It's the player who lead the bots, or what?

I'm not sure, and I have tested it, but I need more people to ensure it.

Also, if the group term are not for make some player leader, it's possible to make an specific player the leader of an specific NPC?

Thanks.

 
Somebody said:
Rongar said:
It is possible to push a modified item to any troop either using operations that work with inventory or directly editing troops.txt
Is that the field defaulted to 0 in troops.txt?
Wait a second. If there are fields for item modifiers at troops.txt, then we should be able to entry the values from module_troops.py. May be little change on module_troops.py and process_troops.py is enough.
 
Well can someone instruct me on how to change the price of companions, then? I searched and couldn't find anything on it.
 
Status
Not open for further replies.
Back
Top Bottom