Jump to content

Goofy

Member
  • Posts

    10
  • Joined

  • Last visited

    Never

Goofy's Achievements

Tenderfoot Thahd

Tenderfoot Thahd (2/17)

  1. Monsters get all skills but only with base values, which is : ToolUse=Dext/2, this is not enough. So I will replace for bashing : Strenght by Strenght + (Level/2) for picking : ToolUse by (Dext+Int+ToolUse+level)/3 with a minimum Int=3 It gives for the Brigand Archer (level 2, strenght 2). bash : 3, pick-lock : 2 It gives for the Slith (level 10, strenght 5). bash : 10, pick-lock : 8 It gives for the Slith Chief (level 20, strenght 8) bash : 18, pick-lock : 16
  2. Quote: Ishad Nha : With the monsters you might not want to have stupid monsters being able to lockpick and weak monsters being able to bash doors. *monsters to open an unlocked or locked door are checked for specie : Reptile, Beast, Insect, Slime/plant and Stone/golem are excluded *monsters to bash a locked door are checked for strength level against door's physical strength *monsters to pick a locked door are checked for tool use level against door's mechanism difficulty, and for specie : Human, Nephil (with bonus), Slith and Vahnatai only are allowed but intelligence is not checked for picking look (should it...) Quote: You would implement this best by using memory cells in the creatures screen. You could also use the same cell for all three of bash, open and pick. Don't see what you mean there, is it that some individual monsters should not be able to open/bash/pick doors ? If so there is no call, I think, to read a monster memory cell from a door terrain script... Alternatively a door could have an additional memory cell to prevent any monster to open/bash/pick it. This is against realism but could be useful.
  3. An alternate door.txt for testing, debugging, commenting... * compatible with default door.txt (no need to change memory cells) * monsters can open/bash/pick-lock doors when adjacent to them (bashing/picking-lock only if the creature is hostile) * multiple doors (up to 8) can share the same SDF for their lock status, this is the door index in memory cell (4) (this can save a lot of SDFs when there are many locked doors in a town) * doors can be locked back with the corresponding key (special item) and with lock-picking * the party loose a turn in town mode when opening/closing/bashing/picking a door (this freeze-a-turn feature can be easily removed) * a random component when bashing/picking/using unlock spell * unlock spell can progressively unlock a door * bashed doors keep a physical strength of 0 until party exits town (so if the door is locked back it can be easily bashed again) * party can try to bash/pick-lock a door even if they have the corresponding key (!) * doors with a lock level of 250 and more (in memory cell (0)) can't be opened except with the corresponding key (special item) note : since unlock spell can progressively unlock doors a higher lock level might be needed, also a door with a lock level up to 249 can be unlocked with enough spell points (for this reason this feature might not be desirable and can be easily removed) notice : there are many restrictions to monsters opening/forcing a door, such as the specie, a bad state like paralysis, not enough intelligence to try to lock-pick a door, a force barrier on the door... Code updated at the Blades Forge (look for 'door.txt' by Goofy) : Blades Forge Scripts
  4. Code update... Part 1 : the scenario script parts -------- Code: // SCENARIO SCRIPTbeginscenarioscript;variables; short count, result, done, pos_x, pos_y; short i, j, k;body;// *************************************************************************************************// START_SCEN_STATE// *************************************************************************************************beginstate START_SCEN_STATE;// init unique stats for switching, to avoid switching effects on scenario start// uses flags (pos_x to pos_x+4, pos_y) = (30 to 30+4, 29)// uses flags (pos_x to pos_x+7(+4 for joined-NPCs), pos_y) = (10 to 10+7(+4 for joined-NPCs), 29) // take switch flags pos_x = 30; pos_y = 29; i = 0; while (i <= 3) { if (char_status(i) != 0) { done = 0; j = 0; // try stat from Strength (0) to Pathfinder (24), use bought levels while (j <= 24 && done == 0) { result = get_stat_levels_bought(i, j) % 10; done = 0; k = 0; while (k <= 3 && done < 3) { // don't check against himself if (k != i) { if (char_status(k) == 0) done = done + 1; else if (result != (get_stat_levels_bought(k, j) % 10)) done = done + 1; } k = k + 1; } if (done == 3) done = 1; else done = 0; j = j + 1; } j = j - 1; // can't get a unique stat for char (i), drop it if (done == 0) set_flag(pos_x + i, pos_y, 250); // got a unique stat for char (i) else set_flag(pos_x + i, pos_y, (j * 10) + result); } // set to default value for non-existing char (i) else set_flag(pos_x + i, pos_y, 250); i = i + 1; }// set switching difficulty level to 'reordering + lost a turn' (3), this can be changed at any time// uses flags (pos_x to pos_x+4, pos_y) = (30 to 30+4, 29)// uses flags (pos_x to pos_x+7(+4 for joined-NPCs), pos_y) = (10 to 10+7(+4 for joined-NPCs), 29) // take switch flags pos_x = 30; pos_y = 29; set_flag(pos_x + 4, pos_y, 3);break;// *************************************************************************************************// LOAD_SCEN_STATE// *************************************************************************************************beginstate LOAD_SCEN_STATE;break;// *************************************************************************************************// START_STATE// *************************************************************************************************beginstate START_STATE;// relocation **************************************************************************************// check current game mode for relocation on combat end (0 : outdoor) (1 : town) (2 : combat)// uses flags (pos_x to pos_x+7(+4 for joined-NPCs), pos_y) = (10 to 10+7(+4 for joined-NPCs), 29)// and flag (pos_x+12, pos_y) = (10+12, 29) (last turn mode flag) // take position and last turn mode flags pos_x = 10; pos_y = 29; // outdoor mode : just record if (is_outdoor() == 1) { set_flag(pos_x + 12, pos_y, 0); } // town mode : check for last turn mode, if it was combat relocate all chars else if (is_town() == 1) { // on combat end, in town mode only, relocate all chars to their last positions during the last combat turn // and center screen on the first living, present, non joined-NPC character (the leader) if (get_flag(pos_x + 12, pos_y) == 2) { done = 0; i = 0; // while (i <= 3) { // if joined-NPCs relocation is not needed while (i <= 5) { if (char_status(i) == 1 && get_flag(pos_x + (2 * i), pos_y) != 250) { relocate_character(i, get_flag(pos_x + (2 * i), pos_y), get_flag(pos_x + (2 * i) + 1, pos_y)); if (done == 0) { force_view_center(get_flag(pos_x + (2 * i), pos_y), get_flag(pos_x + (2 * i) + 1, pos_y)); done = 1; } } i = i + 1; } force_instant_terrain_redraw(); print_str_color("End combat.", 4); } set_flag(pos_x + 12, pos_y, 1); } // combat mode : just record else if (is_combat() == 1) { set_flag(pos_x + 12, pos_y, 2); }// update chars positions **************************************************************************// update all chars positions between turns// uses flags (pos_x to pos_x+7(+4 for joined-NPCs), pos_y) = (10 to 10+7(+4 for joined-NPCs), 29) // take position flags pos_x = 10; pos_y = 29; i = 0; // while (i <= 3) { // if joined-NPCs relocation is not needed while (i <= 5) { if (char_status(i) == 1) { set_flag(pos_x + (2 * i), pos_y, char_loc_x(i)); set_flag(pos_x + (2 * i) + 1, pos_y, char_loc_y(i)); } else { set_flag(pos_x + (2 * i), pos_y, 250); set_flag(pos_x + (2 * i) + 1, pos_y, 250); } i = i + 1; }// switching ***************************************************************************************// switching party order is prevented and/or paralyses whole party for one turn, not outdoor// switching difficulty level : 0 = normal, 1 = reordering, 2 = lost a turn, 3 = reordering + lost a turn// uses flags (pos_x to pos_x+4, pos_y) = (30 to 30+4, 29)// uses flags (pos_x to pos_x+7(+4 for joined-NPCs), pos_y) = (10 to 10+7(+4 for joined-NPCs), 29) // take switch flags (beware pos_x, pos_y will be swapped to position flags) pos_x = 30; pos_y = 29; // check stats for switching if (is_outdoor != 1) { j = 0; i = 0; while (i <= 3 && j <= 2) { count = get_flag(pos_x + i, pos_y); // check all existing chars with their unique stat, if stats modulus 10 are !=, stats are != if (char_status(i) != 0 && count != 250) { result = count % 10; done = (count - result) / 10; // if stat mismatch increase j by 1 if (get_stat_levels_bought(i, done) != result) j = j + 1; } i = i + 1; } // switching means at least two characters having their identification stat changed if (j >= 2) { // if flag(pos_x + 4, pos_y) = 1 or 3 // physical reordering is prevented (reversed to last chars positions) if (get_flag(pos_x + 4, pos_y) == 1 || get_flag(pos_x + 4, pos_y) == 3) { print_str_color("Reordering party...", 2); i = 0; while (i <= 3) { if (char_status(i) == 1) { count = get_flag(pos_x + i, pos_y); result = count % 10; done = (count - result) / 10; // find the position the char had and relocate it there j = 0; while (j <= 3 && get_flag(pos_x + (2 * j), pos_y) != 250) { if (get_stat_levels_bought(j, done) == result) { // take positions flags (this heavy but used only when switching occurs) pos_x = 10; pos_y = 29; relocate_character(i, get_flag(pos_x + (2 * j), pos_y), get_flag(pos_x + (2 * j) + 1, pos_y)); // take switch flags (this heavy but used only when switching occurs) pos_x = 30; pos_y = 29; } j = j + 1; } } i = i + 1; } // center screen on the first living, present, non joined-NPC character (the leader) done = 0; i = 0; while (i <= 3 && done == 0) { if (char_status(i) == 1) { // take positions flags (this heavy but used only when switching occurs) pos_x = 10; pos_y = 29; force_view_center(get_flag(pos_x + (2 * i), pos_y), get_flag(pos_x + (2 * i) + 1, pos_y)); // take switch flags (this heavy but used only when switching occurs) pos_x = 30; pos_y = 29; done = 1; } i = i + 1; } force_instant_terrain_redraw(); } // if flag(pos_x + 4, pos_y) = 2 or 3, paralyse all chars, and joined-NPCs, one turn, unblockable if (get_flag(pos_x + 4, pos_y) == 2 || get_flag(pos_x + 4, pos_y) == 3) { if ((get_flag(pos_x + 4, pos_y) == 2) || is_town() == 1) { print_str_color("You spend a turn reordering your party...", 3); } else { print_str_color("You lost a turn trying to reorder your party...", 1); } i = 0; while (i <= 5) { if (char_status(i) != 0) set_char_status(i, 11, 1, 1, 0); i = i + 1; } } } } // refresh unique stats for switching i = 0; while (i <= 3) { if (char_status(i) != 0) { done = 0; j = 0; // try stat from Strength (0) to Pathfinder (24), use bought levels while (j <= 24 && done == 0) { result = get_stat_levels_bought(i, j) % 10; done = 0; k = 0; while (k <= 3 && done < 3) { // don't check against himself if (k != i) { if (char_status(k) == 0) done = done + 1; else if (result != (get_stat_levels_bought(k, j) % 10)) done = done + 1; } k = k + 1; } if (done == 3) done = 1; else done = 0; j = j + 1; } j = j - 1; // can't get a unique stat for char (i), drop it if (done == 0) set_flag(pos_x + i, pos_y, 250); // got a unique stat for char (i) else set_flag(pos_x + i, pos_y, (j * 10) + result); } // set to default value for non-existing char (i) else set_flag(pos_x + i, pos_y, 250); i = i + 1; }break; Part 2 : the terrain script to place once in each town-------- Code: // TERRAIN SCRIPT// Script for updating characters positions in combat mode (to place on one terrain in each town)// uses flags (pos_x to pos_x+7(+4 for joined-NPCs), pos_y) = (10 to 10+7(+4 for joined-NPCs), 29)beginterrainscript;variables; short pos_x, pos_y, i;body;beginstate INIT_STATE; // run script every move even if party is far set_script_mode(3);break;beginstate START_STATE;// update all chars positions on each individual step during combat// uses flags (pos_x to pos_x+7(+4 for joined-NPCs), pos_y) = (10 to 10+7(+4 for joined-NPCs), 29) // take position flags pos_x = 10; pos_y = 29; if (is_combat() == 1) { i = 0; // while (i <= 3) { // if joined-NPCs relocation is not needed while (i <= 5) { if (char_status(i) == 1) { set_flag(pos_x + (2 * i), pos_y, char_loc_x(i)); set_flag(pos_x + (2 * i) + 1, pos_y, char_loc_y(i)); } else { set_flag(pos_x + (2 * i), pos_y, 250); set_flag(pos_x + (2 * i) + 1, pos_y, 250); } i = i + 1; } }break;
  5. Lazarus : just tested your ever-running terrain script (did a script saying "hello" from a terrain), now I understand your previous answer... It says "hello" 7 times per town mode move, and once per individual move in combat mode. The recording of each character position could be put in one script terrain in each town... with INIT_STATE 'set_script_mode(3)' (every turn) Tried that : both functions (especially end combat relocation) work. For the cpu load, I run a Sempron 2400 (very basic) and I tested with and without my script it makes no difference (I made my party run around a filled town with the mouse left click down). The reason is that it is not graphic operations but simple mathematical operations (should be nothing for a computer if BOE engine works normally) I saw the marking character trick with a special ability and I could use it. The advantage of my system is that it is more self-contained and can be inserted in a scenario without interfering (however it needs temporary variables and 4 flags for skills marking)
  6. [updated] A more complete scenario script to control how playing characters move some may find that very useful, others very superfluous, at least it should be funny to look at when working so it's a script for the scenario START_STATE (or a town state run each turn), and a bit of code for the scenario START_SCEN_STATE it also requires a script to be run from one terrain in each town (second part of code), this can be any terrain it allows to control how characters are positioned on combat end, and how they get positioned when the player uses the 'switch' buttons (under the portraits) it's probably difficult to read but it can be tested directly inside a scenario by temporarily replacing thescenario.txt with this code (except for the terrain script that updates characters positions during a combat turn, which must be done with the Editor) First part : ------------ the code to place in the scenario main script file (code updated below...) Second part : ------------- the code to place in a script file and to execute from one terrain in each town (code updated below...)
  7. Thank you for renaming I found the edit button...
  8. This thread should be renamed but I don't known who can do that, to 'End Combat bug workaround' probably. Also a possible problem : (leader = in slot order (0 to 3) the first living present character) first the good : in fact the leader can change during combat... if he dies. But if the previous leader didn't cross a given special encounter, the others, following him in town mode, shouldn't have either. second, the problem : if the terrain on which a playing character was sitting at the beginning of the turn has been swapped in the middle of this turn to a blocked terrain, and the combat ends, the leader at this moment and thus the party could remain stuck inside this spot when relocated. this might be possible if terrain swapping is triggered by a creature script, or by a character walking on this spot for example. so when swapping/flipping a terrain/floor to a blocked one it should be checked if char_on_me() == -1, but, in addition in combat mode, the script would have to check, with the flags used to record positions, if ANY character (since the leader may have changed since the beginning of the turn) was not upon this spot at the beginning of the current turn, and if so do not swap. the problem is to avoid trapping the party in a position one of the characters had at the beginning of the last combat turn. the modification is not to the script I gave, but to all scripts that swap/flip terrains/floors from a non-blocked one to a blocked one (set as blocked in scendata.txt).
  9. End Combat bug workaround (some edits) ------------------------- If no one has already written this, a piece of script to avoid the end-combat bug (the party moving one step forward and skipping encounters). This is a piece of script to place in the Scenario Script, START_STATE (I don't know if START_STATE in the Scenario Script is run each turn in any situation but I think so). It requires 9 stuff done flags, I used (0 to 8, 1) To notice : since characters cannot be 'switched' in combat mode the leader remains the same and no encounter should be skipped (it would have been walked upon by the leader either before combat in town mode, or during the combat) (Code updated below...)
  10. I'm trying to post a piece of script that may be useful to some people but I get : 'Sorry, we do not permit this HTML tag:Parenthesis in HTML tag' is the // used for script comments that create a problem ? if this post get through probably not... or is it the () parenthesis as stated? this is a script to solve (work-around) the combat end bug, if any interested... thanks for any help.
×
×
  • Create New...