Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
gdwitt said:
Thank you for pointing that out.
I don't see anything in the scripts that shows the increment that changes price for each consecutive buy or sell.
I am able to modify the penalty_factor to make things less difficult on the players.
("game_get_item_sell_price_factor",
    [
      (store_script_param_1, ":item_kind_id"),
      (assign, ":price_factor", 100),

      (call_script, "script_get_trade_penalty", ":item_kind_id"),
      (assign, ":trade_penalty", reg0),

      (try_begin),
        (is_between, "$g_encountered_party", centers_begin, centers_end),
        (is_between, ":item_kind_id", trade_goods_begin, trade_goods_end),
        (store_sub, ":item_slot_no", ":item_kind_id", trade_goods_begin),
        (val_add, ":item_slot_no", slot_town_trade_good_prices_begin),
        (party_get_slot, ":price_factor", "$g_encountered_party", ":item_slot_no"),
        (val_mul, ":price_factor", 100),#normalize price factor to range 0..100
        (val_div, ":price_factor", average_price_factor),##gdw1000 in module constants
      (else_try),
        #increase trade penalty while selling weapons, armor, and horses
        (val_mul, ":trade_penalty", 3),#gdw from 4 to 3 reduced to ease
      (try_end),
         
      (store_add, ":penalty_divisor", 100, ":trade_penalty"),
            (val_mul, ":price_factor", 100),
      (val_div, ":price_factor", ":penalty_divisor"),
            (assign, reg0, ":price_factor"),
      (set_trigger_result, reg0),
  ]),
But is the increment of 6-8% for consecutive transactions just part of the game engine?
I think I see an increment in game_event_buy_item
("game_event_buy_item",
    [
      (store_script_param_1, ":item_kind_id"),
      (store_script_param_2, ":reclaim_mode"),
      (try_begin),
        (is_between, ":item_kind_id", trade_goods_begin, trade_goods_end),
        (store_sub, ":item_slot_no", ":item_kind_id", trade_goods_begin),
        (val_add, ":item_slot_no", slot_town_trade_good_prices_begin),
        (party_get_slot, ":multiplier", "$g_encountered_party", ":item_slot_no"),
        (try_begin),
          (eq, ":reclaim_mode", 0),
          (val_add, ":multiplier", 16),##gdw was at 20
        (else_try),
          (val_add, ":multiplier", 24),##gdw was at 30
        (try_end),

(store_item_value, ":item_value", ":item_kind_id"),
(try_begin),
  (ge, ":item_value", 100),
  (store_sub, ":item_value_sub_100", ":item_value", 100),
  (store_div, ":item_value_sub_100_div_8", ":item_value_sub_100", :cool:,
  (val_add, ":multiplier", ":item_value_sub_100_div_8"),
(try_end),
        (val_min, ":multiplier", maximum_price_factor),
        (party_set_slot, "$g_encountered_party", ":item_slot_no", ":multiplier"),
      (try_end),
  ]),
But I don't see this script being called anywhere except for buying cattle. Does this script change the increment?
Cheers!
You can't see it anywhere because it is used in the trade screen which is a hardcoded presentation that can't be seen in the module system.
 
To add to what erennuman_mb states, things in the module system that start with "game_" are called directly by the engine. They may be called by other bits of the module system, too, but primarily the game engine itself knows to look for those scripts and does so when necessary.

Curiously, when you copied the scripts here, you skipped right over the comments which make this quite clear:
  # This script is called from the game engine for calculating the buying price of any item.
 
hey, i just wanted to know, what <prop_instance_no> is?

Code:
prop_instance_deform_to_time              = 2610 # (prop_instance_deform_to_time, <prop_instance_no>, <value>), # value gives the vertex animation time.
what do I have to do with this?
 
KokosnussBuddha said:
is it possible to create a vertex animation for a item, and start it when it hits something?

EDIT: thank you :wink:

EDIT: just found out, that this seems to be not possible :/

But as it works with bow - arrow (on action shooting) it should work with spear on action (hitting) but i wouldn't matter whatever it hits
So there is probably a piece of new written code based on bow stuff needed
 
Hi all.
I'm trying to create a script that allows me to move the camera to selected agent position. The scripts is called from presentation.

Code:
(player_get_agent_id, ":view_agent_no", "$m_displayPlayer"),
(ge, ":view_agent_no", 0),
(agent_is_active, ":view_agent_no"),
(agent_is_alive, ":view_agent_no"),
(agent_get_position, pos5, ":view_agent_no"),
(position_move_z, pos5, 120, 1),
(position_get_x, ":x", pos5),
(position_get_y, ":y", pos5),
(position_get_z, ":z", pos5),
(assign, reg0, ":x"),
(assign, reg1, ":y"),
(assign, reg2, ":z"),
(assign, reg3, ":view_agent_no"),
(display_message, "@agent:{reg3} - x:{reg0} - y:{reg1} - z:{reg2}"),
(mission_cam_animate_to_position, pos5, 1, 1),

The script gets the position for the agent but my camera view remains always in same position. Suggestions ? Thanks.
 
somebody i looked at your suggestion for ti_on_agen_hit and i was surprised when i found this :

Code:
ti_on_shield_hit = -103.0 #can only be used in module_items triggers
# Trigger Param 1: receiver agent no
# Trigger Param 2: dealer agent no
# Trigger Param 3: inflicted damage
# Trigger Param 4: raw damage (before shield skill and skill resistance bonuses)
# Trigger Param 5: item kind no
# Trigger Param 6: item modifier
# Trigger Param 7: missile item kind no
# Trigger Param 8: missile item modifier
# Trigger Result: if set, damage dealt to shield

now hope we can make a code of this
 
Maybe someone of you here can help me. Tried to integrate dunde's custom banner codes into a native module (btw the mbrepository download is missing the .dds textures) yet I always come up with all heraldry on items painted black:
S2yf7wE.png
Yes, I've tried to substitute the missing .dds files, yet I see nothing wrong with the code and still don't get to show the heraldry on items. It works perfectly on the overworld map.
 
Hello!

I have customisable troops in my mod, unfortunately whenever I reboot my save game the customised units are reverted to their normal inventory and the "armoury troop" loses all of it's available equipment.
 
I'm back again
With some help the error i showed is gone
With some help to the xbox errors are gone
But now it tells me that mesh note window bottom is not defined
But in meshes

Code:
## 14 Dec 2011

from header_meshes import *
meshes = [
  ## Prebatle Orders & Deployment Begin
  ("note_window_bottom", 0, "note_window", 0, 0, 0, 0, 0, 0, 1, 1, 1),
  ("order_frame", 0, "order_frame", 0, 0, 0, 0, 0, 0, 1, 1, 1),
  ("flag4", 0, "flag4", 0, 0, 0, 0, 0, 0, 1, 1, 1),
  ("flag5", 0, "flag5", 0, 0, 0, 0, 0, 0, 1, 1, 1),
  ("flag6", 0, "flag6", 0, 0, 0, 0, 0, 0, 1, 1, 1),
  ("flag7", 0, "flag7", 0, 0, 0, 0, 0, 0, 1, 1, 1),
  ("flag8", 0, "flag8", 0, 0, 0, 0, 0, 0, 1, 1, 1),
  ("flag9", 0, "flag9", 0, 0, 0, 0, 0, 0, 1, 1, 1),
  ## Prebattle Orders & Deployment End
[/spoiler]
Code:
File "C:\Users\joostgrunwald\Downloads\A World Of Warlock\A World Of Warlock\C
ompile\pbod_presentations.py", line 332, in <module>
    ("prebattle_orders",0, mesh_note_window_bottom,[
NameError: name 'mesh_note_window_bottom' is not defined
 
sorry for double post
i am almost finished with a script that makes my pilum bow when hit  a shield
the animation of a spear is
1 ready
2 shoot

i would like to edit a 3 that happens at the moment that 2 happens (or later)
so could i make it so that after that animations it does another one immediatly??
 
builder of the gods said:
I'm back again
With some help the error i showed is gone
With some help to the xbox errors are gone
But now it tells me that mesh note window bottom is not defined
But in meshes

Code:
## 14 Dec 2011

from header_meshes import *
meshes = [
  ## Prebatle Orders & Deployment Begin
  ("note_window_bottom", 0, "note_window", 0, 0, 0, 0, 0, 0, 1, 1, 1),
  ("order_frame", 0, "order_frame", 0, 0, 0, 0, 0, 0, 1, 1, 1),
  ("flag4", 0, "flag4", 0, 0, 0, 0, 0, 0, 1, 1, 1),
  ("flag5", 0, "flag5", 0, 0, 0, 0, 0, 0, 1, 1, 1),
  ("flag6", 0, "flag6", 0, 0, 0, 0, 0, 0, 1, 1, 1),
  ("flag7", 0, "flag7", 0, 0, 0, 0, 0, 0, 1, 1, 1),
  ("flag8", 0, "flag8", 0, 0, 0, 0, 0, 0, 1, 1, 1),
  ("flag9", 0, "flag9", 0, 0, 0, 0, 0, 0, 1, 1, 1),
  ## Prebattle Orders & Deployment End
[/spoiler]
Code:
File "C:\Users\joostgrunwald\Downloads\A World Of Warlock\A World Of Warlock\C
ompile\pbod_presentations.py", line 332, in <module>
    ("prebattle_orders",0, mesh_note_window_bottom,[
NameError: name 'mesh_note_window_bottom' is not defined
Replace 'mesh_note_window_bottom' at presentation by 0 first, then compile. module system will recreate the IDs file. Put 'mesh_note_window_bottom' back, and recompile.
 
Got a question here and hope it's a right thread to ask.

How may I change a range at which "allied" enemies join each other battles against player on the world map?

For example - 2 bandit groups are chasing me cause their combined strength is supposed to be higher. One of them attacks but another doesn't join because it's still too far away. That's not right. How may I increase this "joining" distance? Thank you!
 
Status
Not open for further replies.
Back
Top Bottom