Modding Q&A [For Quick Questions and Answers]

Currently Viewing (Users: 0, Guests: 1)

Status
Not open for further replies.

Michadr

Grandmaster Knight
WBM&BVC
Best answers
0
I recently uploaded a testing version and a bunch of people have reported that prisoners just disappear... which is weird. Does anybody know what could be causing this? Oh it always seems to happen at midnight when troops get their daily xp.
 

Lav

Sergeant Knight at Arms
M&BWB
Best answers
0
Michadr said:
I recently uploaded a testing version and a bunch of people have reported that prisoners just disappear... which is weird. Does anybody know what could be causing this? Oh it always seems to happen at midnight when troops get their daily xp.
Here's the code:

Code:
  # Check escape chances of hero prisoners.
  (48,
   [
       (call_script, "script_randomly_make_prisoner_heroes_escape_from_party", "p_main_party", 50),
       (try_for_range, ":center_no", walled_centers_begin, walled_centers_end),
##         (party_slot_eq, ":center_no", slot_town_lord, "trp_player"),
         (assign, ":chance", 30),
         (try_begin),
           (party_slot_eq, ":center_no", slot_center_has_prisoner_tower, 1),
           (assign, ":chance", 5),
         (try_end),
         (call_script, "script_randomly_make_prisoner_heroes_escape_from_party", ":center_no", ":chance"),
       (try_end),
    ]),
Code:
  # Checking escape chances of prisoners that joined the party recently.
  (6,
   [(gt, "$g_prisoner_recruit_troop_id", 0),
    (gt, "$g_prisoner_recruit_size", 0),
    (gt, "$g_prisoner_recruit_last_time", 0),
    (is_currently_night),
    (try_begin),
      (store_skill_level, ":leadership", "skl_leadership", "trp_player"),
      (val_mul, ":leadership", 5),
      (store_sub, ":chance", 66, ":leadership"),
      (gt, ":chance", 0),
      (assign, ":num_escaped", 0),
      (try_for_range, ":unused", 0, "$g_prisoner_recruit_size"),
        (store_random_in_range, ":random_no", 0, 100),
        (lt, ":random_no", ":chance"),
        (val_add, ":num_escaped", 1),
      (try_end),
      (party_remove_members, "p_main_party", "$g_prisoner_recruit_troop_id", ":num_escaped"),
      (assign, ":num_escaped", reg0),
      (gt, ":num_escaped", 0),
      (try_begin),
        (gt, ":num_escaped", 1),
        (assign, reg2, 1),
      (else_try),
        (assign, reg2, 0),
      (try_end),
      (assign, reg1, ":num_escaped"),
      (str_store_troop_name_by_count, s1, "$g_prisoner_recruit_troop_id", ":num_escaped"),
      (display_log_message, "@{reg1} {s1} {reg2?have:has} escaped from your party during the night."),
    (try_end),
    (assign, "$g_prisoner_recruit_troop_id", 0),
    (assign, "$g_prisoner_recruit_size", 0),
    ]),
 

Cozur

Grandmaster Knight
WB
Best answers
0
Does anyone have the code for the TweakMB option that allows you to choose a quest from a list, rather than it being given out randomly?
 

Michadr

Grandmaster Knight
WBM&BVC
Best answers
0
Lav said:
Michadr said:
I recently uploaded a testing version and a bunch of people have reported that prisoners just disappear... which is weird. Does anybody know what could be causing this? Oh it always seems to happen at midnight when troops get their daily xp.
Here's the code:

Code:
  # Check escape chances of hero prisoners.
  (48,
   [
       (call_script, "script_randomly_make_prisoner_heroes_escape_from_party", "p_main_party", 50),
       (try_for_range, ":center_no", walled_centers_begin, walled_centers_end),
##         (party_slot_eq, ":center_no", slot_town_lord, "trp_player"),
         (assign, ":chance", 30),
         (try_begin),
           (party_slot_eq, ":center_no", slot_center_has_prisoner_tower, 1),
           (assign, ":chance", 5),
         (try_end),
         (call_script, "script_randomly_make_prisoner_heroes_escape_from_party", ":center_no", ":chance"),
       (try_end),
    ]),
Code:
  # Checking escape chances of prisoners that joined the party recently.
  (6,
   [(gt, "$g_prisoner_recruit_troop_id", 0),
    (gt, "$g_prisoner_recruit_size", 0),
    (gt, "$g_prisoner_recruit_last_time", 0),
    (is_currently_night),
    (try_begin),
      (store_skill_level, ":leadership", "skl_leadership", "trp_player"),
      (val_mul, ":leadership", 5),
      (store_sub, ":chance", 66, ":leadership"),
      (gt, ":chance", 0),
      (assign, ":num_escaped", 0),
      (try_for_range, ":unused", 0, "$g_prisoner_recruit_size"),
        (store_random_in_range, ":random_no", 0, 100),
        (lt, ":random_no", ":chance"),
        (val_add, ":num_escaped", 1),
      (try_end),
      (party_remove_members, "p_main_party", "$g_prisoner_recruit_troop_id", ":num_escaped"),
      (assign, ":num_escaped", reg0),
      (gt, ":num_escaped", 0),
      (try_begin),
        (gt, ":num_escaped", 1),
        (assign, reg2, 1),
      (else_try),
        (assign, reg2, 0),
      (try_end),
      (assign, reg1, ":num_escaped"),
      (str_store_troop_name_by_count, s1, "$g_prisoner_recruit_troop_id", ":num_escaped"),
      (display_log_message, "@{reg1} {s1} {reg2?have:has} escaped from your party during the night."),
    (try_end),
    (assign, "$g_prisoner_recruit_troop_id", 0),
    (assign, "$g_prisoner_recruit_size", 0),
    ]),
Hmm... doesn't seem to be this that's causing the bug  :neutral: as it's exactly the same as mine.
 

Lord Wolfe

Recruit
Best answers
0
how would i use thorgrim's map editor to change the size of the map? such as the movable area and the boundary that stops the camera from moving
 

Michadr

Grandmaster Knight
WBM&BVC
Best answers
0
Lord Wolfe said:
how would i use thorgrim's map editor to change the size of the map? such as the movable area and the boundary that stops the camera from moving
To move the red border, simply right click and hold, then move. Did you mean something like this for the other part? (Dragging the red triangles). There might be other ways but another person would have to answer if they know how :smile:
http://img15.poco.cn/mypoco/myphoto/20131030/17/64729303201310301748213078833761181_000.jpg
 

La Grandmaster

Sergeant Knight at Arms
Best answers
0
Lord Wolfe said:
how would i use thorgrim's map editor to change the size of the map? such as the movable area and the boundary that stops the camera from moving
You can edit it via the module.ini file - that is the way I have always done it
 

Lord Wolfe

Recruit
Best answers
0
im not skilled in the slightest on anything to do with python or the files, i mainly use thorgrims, morghs, and tweak but i want to make a map bigger than the basic calradia one and i figured id start by simply expanding into the desert but its proving quite annoying and im still not even sure what the red and yellow borders are around the regions
 

Lord Wolfe

Recruit
Best answers
0
so by clicking and dragging and moving the red and yellow borders, it makes the map size larger and therefore the camera wont be stopped at the "normal" edge?

also a seperate question, how do i perfectly line up vertexes so that they are accessible in the map again? i accidently deleted some and cant make it so i can travel across it again
 

produno

Master Knight
M&BWBWF&SNW
Best answers
0
Lord Wolfe said:
so by clicking and dragging and moving the red and yellow borders, it makes the map size larger and therefore the camera wont be stopped at the "normal" edge?

also a seperate question, how do i perfectly line up vertexes so that they are accessible in the map again? i accidently deleted some and cant make it so i can travel across it again
To move the borders ingame you need to change the settings in your module.ini. At the top you will have xy co-ords. Have a play with them.

For your second q, if you deleted the vertex you will have to open your map in a 3d program and re-connect them. Never delete them in thorgrims, use the weld function!
 

Lord Wolfe

Recruit
Best answers
0
I've tried welding but it just groups multiple vertices together permanently which still leaves them untravelable, and I'm trying to implement something to the game that the only setback is this
 

produno

Master Knight
M&BWBWF&SNW
Best answers
0
Yes, welding will merge the vertices if you have alot that are unwanted. Im not sure what you mean they are untravellable, why did you want to remove them in the first place?
 

Lord Wolfe

Recruit
Best answers
0
The lines separating my foreign triangle are impassable on the game map (I can't move from the map to my triangle) it's for making multi level maps but the only thing stopping it is the tiles not lining up perfectly and being one piece rather than several tiles
 

JohnRocket

Recruit
Best answers
0
Hi Guys.Do you have any ideas how to get this script working with a dedicated server? (the Script solely teleports my character when I am on 'host-game ' server) 
Mission templates

(0,0,0, [(key_clicked,key_m)],
[


(display_message,"@TELEPORT",0xFFFFAAFF),
(multiplayer_send_int_to_server,TP,130),
    ]),

Scripts

("game_receive_network_message",
  [
    (store_script_param, ":player_no", 1),
    (store_script_param, ":event_type", 2),

...a Bunch of the scripts..
                      (else_try),
                            (eq,":event_type",TP,130), # the event is declared in header common
(player_is_active,":player_no"),
(player_is_admin,":player_no"),
(player_get_agent_id,":ag_id",":player_no"),
(agent_get_position,pos10,":ag_id"),
(position_move_y,pos10,299),
(agent_set_position,":ag_id",pos10),
                      (else_try),

...a Bunch of the scripts..


Thanks in advance.
 

Somebody

Code Pope
Baron
WBWF&S
Best answers
1
Take a look at header_operations instead of randomly trying to piece bits of codes together.
Code:
multiplayer_send_int_to_server
has a message type and a value. Depending on how you defined TP, this may or may not interfere with another event. 130 means nothing in this context, although I suspect that's what you declared it as in header_commons - the value is meaningless in this context in any case.
Code:
eq
compares one value to another, not one value to another two, not three values. Take a good look (yes, again) at the difference between servers and clients and how to synchronize events.
 

Go_Khla_Yeh

Master Knight
Best answers
0
Hi everybody

I have a question about formation:

I prefer that the first line, second line or third line shoot on my order than the left, right or middle side!

Is that possible to be changed?"


Thank you.
 

Somebody

Code Pope
Baron
WBWF&S
Best answers
1
First you need to determine what first, second, and third lines mean in the context of the game. The commands are hardwired to do certain things and you do not have access to the logic behind that, so you need to do some positional checks (I'm assuming you have them on hold position) against the order position and determine which way they're facing. Then you can assign agent slots based on their relative row in the formation, and add your own triggers to force the first, second, or whatever to fire.
 

Go_Khla_Yeh

Master Knight
Best answers
0
Thank you, Somebody.

This is what I want to mean...
while the first line charging his guns, the second line shoot to the enemy's lines but that... when I give the order!


Friendly.


 
Status
Not open for further replies.