Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
I wonder how the game engine deals with slots.
I mean :
1. If a troop has 20000 slots, and other troops' max slot are around 300. Will the game provides for all troops memory  for 20000 slots,
    or dynamically provide for each troops memory as they need?

2. If I want to make debt/loan matrix among the 200 npc's.
  Which method is more efficient :
    - make a single dummy troop that have 19900 slots,    or
    - giving extra 199 slots for each npc.
  (unpacked yet)

3. If we use slot 1-100 then slot 101-200 are unused (reversed), And we use slot 201.
    Will the game make blank slots for 101-200 (allocate memory for them) or not?

Thanks before
 
Well this code
Code:
(0, 0, 0, 
[(game_key_clicked, gk_toggle_weapon_mode)],
[
  (get_player_agent_no, ":player_agent"),
  (agent_get_wielded_item, ":wielded_weapon", ":player_agent", 0),
  (eq, ":wielded_weapon", "itm_lightsaber"),
  (agent_play_sound, ":player_agent", "snd_whoosh"),
  (agent_unequip_item, ":player_agent", "itm_lightsaber"),
  (agent_equip_item, ":player_agent", "itm_lightsaber_alt"),
  (agent_set_wielded_item, ":player_agent", "itm_lightsaber_alt"),
]),	  

(0, 0, 2, 
[(game_key_clicked, gk_toggle_weapon_mode)],
[
  (get_player_agent_no, ":player_agent"),
  (agent_get_wielded_item, ":wielded_weapon", ":player_agent", 0),
  (eq, ":wielded_weapon", "itm_lightsaber_alt"),
  (agent_play_sound, ":player_agent", "snd_whoosh_reversed"),
  (agent_unequip_item, ":player_agent", "itm_lightsaber_alt"),
  (agent_equip_item, ":player_agent", "itm_lightsaber"),
  (agent_set_wielded_item, ":player_agent", "itm_lightsaber"),
]),

works when I host a game and test myself but when we hosted it on a dedicated server it was all bugged :-S I know that there are problems with things on dedicated servers but how do I fix it?
 
ithilienranger said:
Why do you need that many slots?

To save relations and debt/loan among NPCs. Native WB has the relation matrix too , using 2nd method (all troops must spare slot 165 til 290+ up) for it. I just realized that today when porting my mod to WB. I did have the same relation matrix in The Vision, but I used 1st method (creating dummy array troop). That's make me wonder why native use 2nd method. It could be related to game engine's mechanism dealing with slots.
 
dunde said:
I wonder how the game engine deals with slots.
I mean :
1. If a troop has 20000 slots, and other troops' max slot are around 300. Will the game provides for all troops memory  for 20000 slots,
    or dynamically provide for each troops memory as they need?
Each troop has a different slot container object, independent from the others.
dunde said:
2. If I want to make debt/loan matrix among the 200 npc's.
  Which method is more efficient :
    - make a single dummy troop that have 19900 slots,    or
    - giving extra 199 slots for each npc.
  (unpacked yet)
The first one should have a bit less overhead, but performance-wise and memory-wise both are insignificant.
dunde said:
3. If we use slot 1-100 then slot 101-200 are unused (reversed), And we use slot 201.
    Will the game make blank slots for 101-200 (allocate memory for them) or not?
Yes, it allocates memory in chunks. If you know that you will use a big amount of slots just set a very high slot right at the start, so the game will allocate the whole chunk of memory without having to resize it gradually.
 
Code that works when I host my own multiplayer game does not work when we host a dedicated server

Code:
(0, 0, 0, 
[(game_key_clicked, gk_toggle_weapon_mode)],
[
  (get_player_agent_no, ":player_agent"),
  (agent_get_wielded_item, ":wielded_weapon", ":player_agent", 0),
  (eq, ":wielded_weapon", "itm_lightsaber"),
  (agent_play_sound, ":player_agent", "snd_whoosh"),
  (agent_unequip_item, ":player_agent", "itm_lightsaber"),
  (agent_equip_item, ":player_agent", "itm_lightsaber_alt"),
  (agent_set_wielded_item, ":player_agent", "itm_lightsaber_alt"),
]),	  

(0, 0, 2, 
[(game_key_clicked, gk_toggle_weapon_mode)],
[
  (get_player_agent_no, ":player_agent"),
  (agent_get_wielded_item, ":wielded_weapon", ":player_agent", 0),
  (eq, ":wielded_weapon", "itm_lightsaber_alt"),
  (agent_play_sound, ":player_agent", "snd_whoosh_reversed"),
  (agent_unequip_item, ":player_agent", "itm_lightsaber_alt"),
  (agent_equip_item, ":player_agent", "itm_lightsaber"),
  (agent_set_wielded_item, ":player_agent", "itm_lightsaber"),
]),
 
Longshaft said:
Code that works when I host my own multiplayer game does not work when we host a dedicated server

Code:
(0, 0, 0, 
[(game_key_clicked, gk_toggle_weapon_mode)],
[
  (get_player_agent_no, ":player_agent"),
  (agent_get_wielded_item, ":wielded_weapon", ":player_agent", 0),
  (eq, ":wielded_weapon", "itm_lightsaber"),
  (agent_play_sound, ":player_agent", "snd_whoosh"),
  (agent_unequip_item, ":player_agent", "itm_lightsaber"),
  (agent_equip_item, ":player_agent", "itm_lightsaber_alt"),
  (agent_set_wielded_item, ":player_agent", "itm_lightsaber_alt"),
]),	  

(0, 0, 2, 
[(game_key_clicked, gk_toggle_weapon_mode)],
[
  (get_player_agent_no, ":player_agent"),
  (agent_get_wielded_item, ":wielded_weapon", ":player_agent", 0),
  (eq, ":wielded_weapon", "itm_lightsaber_alt"),
  (agent_play_sound, ":player_agent", "snd_whoosh_reversed"),
  (agent_unequip_item, ":player_agent", "itm_lightsaber_alt"),
  (agent_equip_item, ":player_agent", "itm_lightsaber"),
  (agent_set_wielded_item, ":player_agent", "itm_lightsaber"),
]),

You need to send a message to the server, since the equip/unequip/set wielded operations only work server-side. Likewise, you need to send the sound to each client if you want them all to hear it.
 
MadocComadrin said:
Longshaft said:
Code that works when I host my own multiplayer game does not work when we host a dedicated server

Code:
(0, 0, 0, 
[(game_key_clicked, gk_toggle_weapon_mode)],
[
  (get_player_agent_no, ":player_agent"),
  (agent_get_wielded_item, ":wielded_weapon", ":player_agent", 0),
  (eq, ":wielded_weapon", "itm_lightsaber"),
  (agent_play_sound, ":player_agent", "snd_whoosh"),
  (agent_unequip_item, ":player_agent", "itm_lightsaber"),
  (agent_equip_item, ":player_agent", "itm_lightsaber_alt"),
  (agent_set_wielded_item, ":player_agent", "itm_lightsaber_alt"),
]),	  

(0, 0, 2, 
[(game_key_clicked, gk_toggle_weapon_mode)],
[
  (get_player_agent_no, ":player_agent"),
  (agent_get_wielded_item, ":wielded_weapon", ":player_agent", 0),
  (eq, ":wielded_weapon", "itm_lightsaber_alt"),
  (agent_play_sound, ":player_agent", "snd_whoosh_reversed"),
  (agent_unequip_item, ":player_agent", "itm_lightsaber_alt"),
  (agent_equip_item, ":player_agent", "itm_lightsaber"),
  (agent_set_wielded_item, ":player_agent", "itm_lightsaber"),
]),

You need to send a message to the server, since the equip/unequip/set wielded operations only work server-side. Likewise, you need to send the sound to each client if you want them all to hear it.

Thanks, how do I send a message?
 
cmpxchg8b said:
Each troop has a different slot container object, independent from the others.

The first one should have a bit less overhead, but performance-wise and memory-wise both are insignificant.

Yes, it allocates memory in chunks. If you know that you will use a big amount of slots just set a very high slot right at the start, so the game will allocate the whole chunk of memory without having to resize it gradually.

Thank you so much, cmpxchg8b.
 
I used rubik's autoloot codeto store item stats to item slots. I'm having trouble with the damage types. If i understood header_items.py correctly get_thrust_damage(y)  function stores both damage amount and damage type(just making wildguess, thoe bitwise operations are bit beyond me). I can get the damage part with (val_mod, thrust_damage , 256). How can i get the damage type?
 
rabican said:
I used rubik's autoloot codeto store item stats to item slots. I'm having trouble with the damage types. If i understood header_items.py correctly get_thrust_damage(y)  function stores both damage amount and damage type(just making wildguess, thoe bitwise operations are bit beyond me). I can get the damage part with (val_mod, thrust_damage , 256). How can i get the damage type?

Code:
(item_get_slot, ":thrust_damage", ":item_no", slot_item_thrust_damage),
(store_mod, ":damage",":thrust_damage" , 256),
(store_div, ":damage_type",":thrust_damage" , 256),

":damage_type" will be 0,1 or 2 (cut, pierce or blunt)
 
Hmm you know the way when you look at master of the field flags they appear the same nearly no matter what way you look at them, is there anyway to get rid of this (it happens with the glow particle aswell)
 
Longshaft said:
Hmm you know the way when you look at master of the field flags they appear the same nearly no matter what way you look at them, is there anyway to get rid of this (it happens with the glow particle aswell)
Try removing sokf_face_player from their entries in module_scene_props.py.
 
Well actually it seems that the fire glow particles system is actually just rotating around one fixed point on the weapon, is there anyway to make it so that it just is on a point and always pointing in the same direction?
 
Somebody said:
# 21) Emit velocity :  Particles are initially shot with this velocity.

That just makes it emit in a direction very fast, it is still rotating around a fixed position :-S
 
Status
Not open for further replies.
Back
Top Bottom