Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Code:
got_white_walkers_respawn = (
  ti_on_agent_hit, 0, 0, [],
  [ (store_trigger_param_1, ":deadww"),
    (store_trigger_param_2, ":wwhunter"),
  #  (store_trigger_param_3, ":damage"),

     (neg|agent_is_alive, ":deadww"),
     (agent_is_alive, ":wwhunter"),

      (agent_get_troop_id, ":wwtroop", ":deadww"),
      (agent_get_position, pos27, ":deadww"),

      (eq, ":wwtroop", "trp_white_walker"),
       (set_spawn_position, pos27),
        (spawn_scene_prop, "spr_white_walker_body"),
    ])

I somehow need to clear the position just like "str_clear" for strings or some trick so every corpse has its own position but not just the first one which is dead's. Any clue? (For MP)
 
MadocComadrin said:
any php (or any other appropriate web scripting language) stuff will be done on and for the webserver to respond to the message sent by that operation.
I know, im just saying, how can i get a value from the php code?
Like, i put into a variable a value from the mysql, then how can i recieve it to the module system?
 
SnRolls said:
I know, im just saying, how can i get a value from the php code?
Like, i put into a variable a value from the mysql, then how can i recieve it to the module system?
Check header_operations.py file. Actually, make it a habit to always check it first.

There's the line:
Code:
send_message_to_url =  380  # (send_message_to_url, <string_id>, <encode_url>),
# result will be returned to script_game_receive_url_response
And then there's the module_scripts.py:
Code:
  #script_game_receive_url_response
  #response format should be like this:
  #  [a number or a string]|[another number or a string]|[yet another number or a string] ...
  # here is an example response:
  # 12|Player|100|another string|142|323542|34454|yet another string
  # INPUT: arg1 = num_integers, arg2 = num_strings
  # reg0, reg1, reg2, ... up to 128 registers contain the integer values
  # s0, s1, s2, ... up to 128 strings contain the string values
 
Before I reskeletonize all armors on my mods, I need to be sure if the game supports more than 8 morph keys for the armors, as I see on header_items,py, it only  provides skf_use_morph_key_10 to skf_use_morph_key_70 flags.
Can I add  skf_use_morph_key_80 = 0x00000008 there?
 
SnRolls said:
I saw that bro... where do i call the script?
and the registers contains the values i get from the php page?
Scripts that begin with "game_*" indicate that they are called from the engine at need. So long as you use the operation that I and now Lav have pointed out to you to send the message to your website--and do whatever you need to do with it on the website--the game will fire the script_game_receive_url_response whenever it receives a message from that website. Edit that script as you need to to deal with the information that is being returned to you.

You will then use store_script_param_1 to get the number of integers returned, so the script knows how many registers are full of numbers (starting at reg0) and then store_script_param_2 to get the numbers of strings returned (starting at s0), all as indicated by the comments in the script.

Belendor said:
I somehow need to clear the position just like "str_clear"
(init_position, <pos>) sets everything to 0s.
 
I'm going to check(with python comands) if a weapon has a special capability... and if yes, then an item slot should be set to 1.
But it wont work. The problem must be in these lines.
Code:
...
    capability = items[i_item][5] & itc_cleaver
    if capability == itc_bastardsword or capability == itc_morningstar:
      item_score.append((item_set_slot, i_item, slot_item_one_half_handed, 1))
...
Any ideas :?:
 
Caba`drin said:
SnRolls said:
I saw that bro... where do i call the script?
and the registers contains the values i get from the php page?
Scripts that begin with "game_*" indicate that they are called from the engine at need. So long as you use the operation that I and now Lav have pointed out to you to send the message to your website--and do whatever you need to do with it on the website--the game will fire the script_game_receive_url_response whenever it receives a message from that website. Edit that script as you need to to deal with the information that is being returned to you.

You will then use store_script_param_1 to get the number of integers returned, so the script knows how many registers are full of numbers (starting at reg0) and then store_script_param_2 to get the numbers of strings returned (starting at s0), all as indicated by the comments in the script.

Belendor said:
I somehow need to clear the position just like "str_clear"
(init_position, <pos>) sets everything to 0s.
Thanks, i got it.
Now, i have some questions,
First, i tried to look for those in header_operations.py but didnt found them.
1.If there is an operation to get player_id by his character name, what is the operation?
2.How can i change a troop equips only for player(choosed by player_id) and check first if he choosed that troop?
Thank you very much.
 
_Sebastian_ said:
I'm going to check(with python comands) if a weapon has a special capability... and if yes, then an item slot should be set to 1.
But it wont work. The problem must be in these lines.
Code:
...
    capability = items[i_item][5] & itc_cleaver
    if capability == itc_bastardsword or capability == itc_morningstar:
      item_score.append((item_set_slot, i_item, slot_item_one_half_handed, 1))
...
Any ideas :?:
You want
if items[i_item][5] &  itc_bastardsword == itc_bastardsword or items[i_item][5] & itc_morningstar ==  itc_morningstar:

or, as rubik does it:
    ## two hand/one hand
    type = items[i_item][3] & 0x000000ff
    if type == itp_type_two_handed_wpn and items[i_item][3] & itp_two_handed == 0:
      item_score.append((item_set_slot, i_item, slot_item_two_hand_one_hand, 1))
   
 
Is there a way to call a function I made whenever I have a weapon (in this case it's using the pistol as framework) attack.

Basically, I wrote a function:

Code:
def ammo_refill(x):
  x+=1
  return x

I tied that function to the bullet count for the pistol because I want to basically have infinite ammo.
 
The game engine will not parse that Python code. If you want infinite ammo, either call (agent_refill_ammo) after (get_player_agent_no) or more easily just change max_ammo to a high number so you won't even need to reload.
 
Ok thanks. I need to change my way of thinking a bit then, since I was going at this from a, call functions, sort of way.
 
Python is just the compiler for the Module System.

Think of it this way: Python itself may have been compiled by a Java compiler, but this doesn't mean that you can put calls to compiler's Java functions from your Python code. Situation with Python and ModSys is absolutely the same. You may use Python code to pre-calculate something at compile time, or auto-generate some ModSys code, but that's as far as you go.
 
Dawiduh said:
The banners are mocking me once again  :smile:

I have added a new type of world map banner that looks like this: http://davidstancu.com/pics/logo/fremen_sietch/mb20.jpg.

But when I look in the Notes tab at the character it looks like this: http://davidstancu.com/pics/logo/fremen_sietch/mb19.jpg

So I have a problem here. It was supposed tot use the banner's texture but it uses something another one as if the my texture is missing.

Any ideas?

Check "script_add_troop_to_cur_tableau_for_profile" or "script_add_troop_to_cur_tableau". You should adjust them according to your modification to banners.
 
Anyone know where is the code (toople) that places a small image that indicates the type of death that had a player in multiplayer game?

for example:

Player A (sword image) Player B
Player A (axe image) Player B
Player A (headshot image) Player B
Player A (couched lance image) Player B
...etc

Thanks
 
Andrews said:
Anyone know where is the code (toople) that places a small image that indicates the type of death that had a player in multiplayer game?
As far as I know this message is hardcoded. Those icons aren't even referenced anywhere in the Module System.
 
Status
Not open for further replies.
Back
Top Bottom