Modding Q&A [For Quick Questions and Answers]

正在查看此主题的用户

状态
不接受进一步回复。
In terms of body shape and face, so I would assume mesh and texture...?

As an example, I'm looking to make the jarls of the nords into something more stereotypical... Something Arnold-esque, so to speak. And fantasy dwarven-like Rhodoks, for another example. Of course, the poor fellows are going to have to endure me turning them female (well, using the resources already in the game) until I figure out what I'm doing and thus know what resources I'm going to need to create :p

Thanks in advance!
 
I have  a question about troop_set_slot

Does this function regard slots differently than (player_add_spawn_item,player_id, item_slot_no, item_id),

I've got my database equipment code almost working but when I use the ek_item* slots, only the last item is populated (within the first slot).  However when I use function (player_add_spawn_item,player_id, item_slot_no, item_id), with the same item and slot ids, the equipment is spawn where I'd expect it to.  I'm so close to getting this working though

 
I take it that multiplayer troop item selections are done here:

slot_player_selected_item_indices_begin        = 2
slot_player_selected_item_indices_end          = 11

?
 
Kodashi 说:
I take it that multiplayer troop item selections are done here:

slot_player_selected_item_indices_begin        = 2
slot_player_selected_item_indices_end          = 11

?

Yes, the *_set_slot or * _get_slot etc operations refer to arrayed variables that are called slots.

These should not be confused with the equipment slots ek_* that identify where items go on a troop/agent/player.
(This arrayed variable type of slot is explained in the syntax thread you've been pointed to that is in my sig.)
 
Caba`drin 说:
Kodashi 说:
I take it that multiplayer troop item selections are done here:

slot_player_selected_item_indices_begin        = 2
slot_player_selected_item_indices_end          = 11

?

Yes, the *_set_slot or * _get_slot etc operations refer to arrayed variables that are called slots.

These should not be confused with the equipment slots ek_* that identify where items go on a troop/agent/player.
(This arrayed variable type of slot is explained in the syntax thread you've been pointed to that is in my sig.)

Awesome! 

Thanks for the guidance on this :smile:
 
What exactly does Ctrl+M reload?  It didn't reload my menus.txt file, since the most recent changes I made were not reflected.  (For certain.)
 
Crazy-Q 说:
What exactly does Ctrl+M reload?  It didn't reload my menus.txt file, since the most recent changes I made were not reflected.  (For certain.)
It should reload all of the .txt files. It did prior to 1.142 at least and the devs noted they changed things with its function. Are you using 1.142?

I've made changes to menus, scripts, mission templates, dialogs, and presentations that were always successfully reloaded with Ctrl-M before. I've not tried with 1.142 though.
 
Once I can get this inventory thing solved, I think I'll be nearly finished.  However, I am not quite sure how to loop through the Troop_Slot indexes.  Is there any example code out there?
 
Caba`drin 说:
Crazy-Q 说:
What exactly does Ctrl+M reload?  It didn't reload my menus.txt file, since the most recent changes I made were not reflected.  (For certain.)
It should reload all of the .txt files. It did prior to 1.142 at least and the devs noted they changed things with its function. Are you using 1.142?

I've made changes to menus, scripts, mission templates, dialogs, and presentations that were always successfully reloaded with Ctrl-M before. I've not tried with 1.142 though.

No, I'm using 1.134.  I'm wondering if it could be a compiling error.  My compiler isn't very clean.  (Lots of unused variables or unassigned variable uses at the moment, something might have slipped past my eye.)  I'm restarting the game, so I'll see. 

EDIT:  It must be, because it's still not working...
 
It's been a while since I've tried to add a visitor to a scene.  Does anyone see a problem with this? 

插入代码块:
      "Visit the Clergy",
      [
        (modify_visitors_at_site, "scn_chalcedonian"),
        (reset_visitors),
        (set_visitor, 0, "trp_player"),
        (set_visitor, 30, "trp_chalcedonian"),				
        (set_jump_mission, "mt_visit_priest"),
        (jump_to_scene, "scn_chalcedonian"),
        (change_screen_mission),		
      ]),

For whatever reason, trp_chalcedonian isn't showing up in entry point 30. 
 
Does "replace_prop_instance" work in Multiplayer? Atm I use "prop_instance_set_visibility", what seems to work, and then i move it away. But that does not clear the collision it seems, so i need to find something to make the prop have no collision any more...
 
Patta 说:
Does "replace_prop_instance" work in Multiplayer? Atm I use "prop_instance_set_visibility", what seems to work, and then i move it away. But that does not clear the collision it seems, so i need to find something to make the prop have no collision any more...
It only works before the scene loads, in ti_[before|after]_mission_start. The only way I know of to clear the collision object is to make it destroyable and destroy it - you could try using prop_instance_receive_damage, but I think it was designed in a strange way, needing to be called on client and server to stay in sync (or something) and not calling ti_on_scene_prop_hit or ti_on_scene_prop_destroy, so I haven't tried using it.

Ahh wait: you mean you moved the visible mesh away, but the collision object stayed in place? That means you need to add sokf_moveable to the scene prop flags, and then make sure you only move it on the server (otherwise clients will disconnect with a sync error).
 
I do that all only server side, so that is no problem. But thanks with the flag, didn't know that. Yes, I meant it like that.
 
I got a ballista prop (OSP) and tried to operate it. I will make it as a siege weapon, so I've tried to rotate it as my wish, but I have a problem. I don't know why it just follows agent's position. Here is the code.

DOMA_Ballista = [
    (ti_before_mission_start, 0, 0, [], [
        (assign, "$ballista_run" ,0),
    ]),

    (0, 0, 0, [], [
      (multiplayer_get_my_player, ":player_no"),
  (player_is_active, ":player_no"),
  (player_get_agent_id, ":agent", ":player_no"),
  (agent_is_active, ":agent"),
      (scene_prop_get_instance , ":instance_no", "spr_do_lv2_ballista", 0),
  (prop_instance_get_position, pos1, ":instance_no"),
  (agent_get_position, pos2, ":agent"),
  (get_distance_between_positions, ":distance", pos1, pos2,),
  (try_begin),
  (le, ":distance", 500),
  (assign, "$ballista_run" ,1),
      (else_try),
      (assign, "$ballista_run", 0),
      (try_end),  
    ]),

    (0, 0, 2, [ (eq, "$ballista_run" ,1), (key_clicked, key_up)], [
      (multiplayer_get_my_player, ":player_no"),
  (player_is_active, ":player_no"),
  (player_get_agent_id, ":agent", ":player_no"),
  (agent_is_active, ":agent"),
      (scene_prop_get_instance , ":instance_no", "spr_do_lv2_ballista", 0),
  (prop_instance_get_position, pos1, ":instance_no"),
  (agent_get_position, pos2, ":agent"),
  (get_distance_between_positions, ":distance", pos1, pos2,),
  (le, ":distance", 500),
  (prop_instance_get_position, pos3, ":instance_no"),
  (position_rotate_x, pos3, -5),
  (multiplayer_send_3_int_to_server, multiplayer_event_prop_instance_animating, ":instance_no", pos3, 200),
    ]),
    (0, 0, 2, [ (eq, "$ballista_run" ,1), (key_clicked, key_down)], [
      (multiplayer_get_my_player, ":player_no"),
  (player_is_active, ":player_no"),
  (player_get_agent_id, ":agent", ":player_no"),
  (agent_is_active, ":agent"),
      (scene_prop_get_instance , ":instance_no", "spr_do_lv2_ballista", 0),
  (prop_instance_get_position, pos1, ":instance_no"),
  (agent_get_position, pos2, ":agent"),
  (get_distance_between_positions, ":distance", pos1, pos2,),
  (le, ":distance", 500),
  (prop_instance_get_position, pos3, ":instance_no"),
  (position_rotate_x, pos3, 5),
  (multiplayer_send_3_int_to_server, multiplayer_event_prop_instance_animating, ":instance_no", pos3, 200),
    ]),
    (0, 0, 2, [ (eq, "$ballista_run" ,1), (key_clicked, key_left)], [
      (multiplayer_get_my_player, ":player_no"),
  (player_is_active, ":player_no"),
  (player_get_agent_id, ":agent", ":player_no"),
  (agent_is_active, ":agent"),
      (scene_prop_get_instance , ":instance_no", "spr_do_lv2_ballista", 0),
  (prop_instance_get_position, pos1, ":instance_no"),
  (agent_get_position, pos2, ":agent"),
  (get_distance_between_positions, ":distance", pos1, pos2,),
  (le, ":distance", 500),
  (prop_instance_get_position, pos3, ":instance_no"),
  (position_rotate_z, pos3, -5),
  (multiplayer_send_3_int_to_server, multiplayer_event_prop_instance_animating, ":instance_no", pos3, 200),
    ]),
    (0, 0, 2, [ (eq, "$ballista_run" ,1), (key_clicked, key_right)], [
      (multiplayer_get_my_player, ":player_no"),
  (player_is_active, ":player_no"),
  (player_get_agent_id, ":agent", ":player_no"),
  (agent_is_active, ":agent"),
      (scene_prop_get_instance , ":instance_no", "spr_do_lv2_ballista", 0),
  (prop_instance_get_position, pos1, ":instance_no"),
  (agent_get_position, pos2, ":agent"),
  (get_distance_between_positions, ":distance", pos1, pos2,),
  (le, ":distance", 500),
  (prop_instance_get_position, pos3, ":instance_no"),
  (position_rotate_z, pos3, 5),
  (multiplayer_send_3_int_to_server, multiplayer_event_prop_instance_animating, ":instance_no", pos3, 200),
    ]),

]
 
DOMA_ 说:
  (multiplayer_send_3_int_to_server, multiplayer_event_prop_instance_animating, ":instance_no", pos3, 200),
You can't do this: pos3 is simply a fancy name for 3 (as you can see in header_common.py), so this will just send the instance id, 3, and 200 to the server (which is useless because the position registers are not syncronised). To send positions to the server you need to extract the various numbers converted to fixed point and send them separately, which means loss of precision and packed or multiple messages.

However, you are going about it in the wrong way: you shouldn't be doing position and distance checks on the client, as people could just mod the checks right out and the server wouldn't do anything about it. Instead you should send "input" messages from the client to the server, and then do all the checks on the server; though the code can sometimes be optimised further by running some checks on both the client and the server, so if a player is bashing a key to activate something when far out of range, the client doesn't spam the server with messages that might make it waste time with expensive checks. Bonus points if you share the same scripts for server and client checks.
 
Firstly, thanks to everyone for all of your assistance.  I'm able to now read and write equipment data to and from my database and have it populate the approriate slot...at least for the inital spawn.  I have some additional questions; hopefully short and easy ones.

1) Which script(s) are fired when a player selects their 'Class' from within the gui?  I am looking to set saved equipment from the database to the gui based on their class selection.  This might not be possible so my plan B is to lock that character into a class once they've made their initial selection.  I'm good either way :smile:

2) What functions are used to set Attributes, Skills, and Weapon Profs?

... and I think that might do it. 
 
When a player selects a troop/equipment, a network message is sent. So check that message and mimic what it does in the url_response script (You want to assign gear based on data from a database right?).

As for weapon proficiencies and the rest, they're set via troops, ie. you can't set them per agent. If you want to set them per player, you're going to have to get creative. If the cRPG source is still open, look there.
 
状态
不接受进一步回复。
后退
顶部 底部