Jump to content

Old MikeS

Member
  • Posts

    56
  • Joined

  • Last visited

Everything posted by Old MikeS

  1. There are five book graphics already available, you just need to define them in your data file. The sheets and icon/inventory indexes are as follows: ; first it_floor_which_sheet = 1026; it_floor_which_icon = 0; it_inventory_icon = 0; ; second it_floor_which_sheet = 1026; it_floor_which_icon = 1; it_inventory_icon = 1; ; third it_floor_which_sheet = 1026; it_floor_which_icon = 2; it_inventory_icon = 2; ; fourth it_floor_which_sheet = 1026; it_floor_which_icon = 3; it_inventory_icon = 3; ; fifth it_floor_which_sheet = 1032; it_floor_which_icon = 0; it_inventory_icon = 1; I think Kelandon's custom object script includes these as well.
  2. Mystery Manor is really at version 1.0.1. You do have the latest version posted on the site. I thought I'd sent another message about the updated version, but can't be sure (too many classes for work recently, can't be sure of anything anymore). Thank you for the site update.
  3. I'll probably release the scenario I'm working on also (Amnesia). Don't know when (got most of the town/city laid out, won't have any outdoors), but it took me almost 3 weeks to get some custom graphics created/finished. Still need to populate, setup dialog and flesh out the plot. Similar to what Nikki x has planned, it will have no combat (the coding for that is finished - I take away all equipment/magic at the start, give it back when you finish). I'm leaning at a March/April time frame, depending on how often I can work on it between work and family.
  4. For (1) - I've used this (CV has something like it also - this is from what I've currently been working on): Code: beginstate 13; // balance the monsters on this level to party (max) level // x = dungeon level // do this one time only (first time entering a level/regenerating a level)... set_flag(x, 27, 1); // get max party level i = 0; lvl = 0; while (i < 4) { if (char_ok(i) == TRUE) { e = get_level(i); if (e > lvl) { lvl = e; } } i = i + 1; } // check max level monster levels in dungeon... i = bg; while (i < en) { if (char_ok(i) == TRUE) { e = get_level(i); if (lvl > e) { tt = lvl - e; // monster level = cur lvl + 0..delta + [1-9] mlvl = e + get_ran(1, 0, tt) + x; if (mlvl <= 100) set_level(i, mlvl); else set_level(i, 100); } } i = i + 1; }break; In the above, bg and en are the monster number ranges set elsewhere prior to state 13 being called. The code above tries to set all monsters to parties level + some. I've been thinking of a different formula for this because the current one really makes the monsters extemely tough (almost unbeatable). Of course the above doesn't change the monster level if the level is greater than the parties level.
  5. Just in case people were wondering, I completed the thief creature script with some help from here. Since the prior question contained an unworking script, I've included the completed, fixed one here. Nothing like being in fight with someone and have your sword swipped . Code: // thief.txt v1.0// M. G. Slack - 2005// (slack at attglobal . net)// - based off of basicnpc// A very simple, naive text. Creature attacks anything it hates nearby.// Once it has won, it returns to its home.// In addition, will occasionally, based on level, will attempt to steal a// random object from the character fighting. If successful, will then// teleport away or stay if cell 6 is set.// POTENTIAL TODO - add counter to loop when determining where to teleport// to, so endless loop not generated, user controllable?// Memory Cells:// Cell 0 - How creature moves.// 0 - If 0, wander randomly. // 1 - Stands still until a target appears.// 2 - Completely immobile, even if target appears.// Cell 1,2 - Stuff done flag. If both 0, nothing. Otherwise when this // is killed, set to 1. (Example: If cell 1 is 3 and cell 2 is 5, when// creature is killed, sets SDF(3,5) to 1.)// Cell 3 - Dialogue node to start with if talked to. if left at 0, this// character doesn't talk.// Cell 4,5 - Coordinates of chest/spot to place stolen items at. If both// left at zero, thief keeps item. Note, if not set, thief will not// steal equipped items.// Cell 6 - If set to 1 (non-zero), thief won't teleport away. Logically// does not make sense to set 4,5 and 6 - how can the thief put items in// a cache if he doesn't go anywhere?begincreaturescript;variables;short i, itm, slt, st, x, y, fl, tr, target;body;beginstate INIT_STATE; if (get_memory_cell(0) == 2) set_mobility(ME, 0);break;beginstate DEAD_STATE; // Set the appropriate stuff done flag for this character being dead if ((get_memory_cell(1) != 0) || (get_memory_cell(2) != 0)) set_flag(get_memory_cell(1), get_memory_cell(2), 1);break;beginstate START_STATE; // if I have a target for some reason, go attack it if (target_ok()) { if (dist_to_char(get_target()) <= 16) set_state(3); else set_target(ME, -1); } // Look for a target, attack it if visible if (select_target(ME, 8, 0)) { do_attack(); set_state(3); } // Have I been hit? Strike back! if (who_hit_me() >= 0) { set_target(ME, who_hit_me()); do_attack(); set_state(3); } // Otherwise, just peacefully move around. Go back to start, if I'm too far // from where I started. if ((my_dist_from_start() >= 6) || ((my_dist_from_start() > 0) && (get_memory_cell(0) > 0))) { if (get_ran(1, 1, 100) < 40) return_to_start(ME, 1); } else if (get_memory_cell(0) == 0) { fidget(ME, 25); } // if we're in combat and the above didn't give me anything to do, just // stop now. Otherwise, game will keep running script, and that eats up CPU time. if (am_i_doing_action() == FALSE) end_combat_turn();break;beginstate 3; // attacking if (target_ok() == FALSE) { set_state(START_STATE); } // try to steal? if (get_ran(1, 0, 100) <= get_level(my_number())) { set_state_continue(10); } else { do_attack(); }break;beginstate TALKING_STATE; if (get_memory_cell(3) == 0) { print_str("Talking: It doesn't respond."); end(); } begin_talk_mode(get_memory_cell(3));break;beginstate 10; // steal something? // print_str("Start of steal."); i = get_target(); // print_big_str("Target = ", i, ""); if ((get_memory_cell(4) == 0) && (get_memory_cell(5) == 0)) { st = 13; } else { st = 0; } slt = get_ran(1, st, 39); // print_big_str("Slot = ", slt, ""); itm = item_type_in_slot(i, slt); if (itm > 0) { // steal it and go... // print_big_str("Good item = ", itm, ""); if (st > 0) { // char_take_item(i, itm); destroy_char_item(i, slt); char_give_item(my_number(), itm); } else { take_item_char_item(i, slt, get_memory_cell(4), get_memory_cell(5)); } if (get_memory_cell(6) == 0) { // print_str("Getting ready to leave."); set_state_continue(11); } else { end_combat_turn(); set_state(3); } } else { do_attack(); set_state(3); }break;beginstate 11; // teleport away (get random location (not blocked) and go) print_str_color("The thief takes an item and slips away.", 4); i = current_town_size(); if (i == 0) st = 63; else if (i == 1) st = 47; else st = 31; i = 0; while (i == 0) { x = get_ran(1, 0, st); y = get_ran(1, 0, st); // check x and y fl = get_floor(x, y); tr = get_terrain(x, y); if ((((fl >= 0) && (fl <= 22)) || ((fl >= 37) && (fl <= 56)) || ((fl >= 72) && (fl <= 78)) || ((fl >= 81) && (fl <= 91)) || ((fl >= 95) && (fl <= 123))) && ((tr == 0) || ((tr >= 2) && (tr <= 121)) || ((tr >= 137) && (tr <= 146)) || ((tr >= 155) && (tr <= 165))) && (is_blocked(x, y) == FALSE)) { i = 1; } // slip to location if (i == 1) { relocate_character(my_number(), x, y); } } // print_big_str("New x = ", x, ""); // print_big_str("New y = ", y, ""); end_combat_turn(); set_target(ME, -1); set_char_alert(my_number(), 0); set_state(START_STATE);break; Let me know if you find something that doesn't work. Mike
  6. Just as an aside, for Win v1.0.3 BOA, you can read outdoor and indoor signs again (I least I work where I didn't with 1.0.2). Hopefully this was fixed with the Mac release at the same time. Mike
  7. Thanks for hints. I'll see about using the destroy_char_item and the char_give_item combination to see if it will do what I need. BTW, the script posted has a slight error in the is_blocked call, I forgot the x,y params. Declaring a string constant works fine, at least in the Windows BOA version. Hopefully (since it is documented in the ed ins), it works as well in the Mac version. Mike
  8. Dang. Should've checked the bugs list before posting. Any work-arounds? Also, is someone maintaining alint? When running against some scripts, it flags the following valid code: Code: string somevar = "some val"; In fact any 'constant' string defined this way used later it also flags as an inappropriate variable. Mike
  9. Hi all, Have the following creature script (it has debug lines in it): Code: // thief.txt// - based off of basicnpc// A very simple, naive text. Creature attacks anything it hates nearby.// Once it has won, it returns to its home.// In addition, will occasionally, based on level, will attempt to steal a// random object from the character fighting. If successful, will then// teleport away.// Memory Cells:// Cell 0 - How creature moves.// 0 - If 0, wander randomly. // 1 - Stands still until a target appears.// 2 - Completely immobile, even if target appears.// Cell 1,2 - Stuff done flag. If both 0, nothing. Otherwise when this // is killed, set to 1. (Example: If cell 1 is 3 and cell 2 is 5, when// creature is killed, sets SDF(3,5) to 1.)// Cell 3 - Dialogue node to start with if talked to. if left at 0, this// character doesn't talk.// Cell 4,5 - Coordinates of chest/spot to place stolen items at. If both// left at zero, thief keeps item.begincreaturescript;variables;short i, itm, slt, st, x, y, fl, tr, target;body;beginstate INIT_STATE; if (get_memory_cell(0) == 2) set_mobility(ME, 0);break;beginstate DEAD_STATE; // Set the appropriate stuff done flag for this character being dead if ((get_memory_cell(1) != 0) || (get_memory_cell(2) != 0)) set_flag(get_memory_cell(1), get_memory_cell(2), 1);break;beginstate START_STATE; // if I have a target for some reason, go attack it if (target_ok()) { if (dist_to_char(get_target()) <= 16) set_state(3); else set_target(ME, -1); } // Look for a target, attack it if visible if (select_target(ME, 8, 0)) { do_attack(); set_state(3); } // Have I been hit? Strike back! if (who_hit_me() >= 0) { set_target(ME, who_hit_me()); do_attack(); set_state(3); } // Otherwise, just peacefully move around. Go back to start, if I'm too far // from where I started. if ((my_dist_from_start() >= 6) || ((my_dist_from_start() > 0) && (get_memory_cell(0) > 0))) { if (get_ran(1, 1, 100) < 40) return_to_start(ME, 1); } else if (get_memory_cell(0) == 0) { fidget(ME, 25); } // if we're in combat and the above didn't give me anything to do, just // stop now. Otherwise, game will keep running script, and that eats up CPU time. if (am_i_doing_action() == FALSE) end_combat_turn();break;beginstate 3; // attacking if (target_ok() == FALSE) set_state(START_STATE); // try to steal? if ((get_ran(1, 0, 100) <= get_level(my_number())) && (is_town() == 1)) { set_state_continue(10); } else { do_attack(); }break;beginstate TALKING_STATE; if (get_memory_cell(3) == 0) { print_str("Talking: It doesn't respond."); end(); } begin_talk_mode(get_memory_cell(3));break;beginstate 10; // steal something? print_str("Start of steal."); i = get_target(); print_big_str("Target = ", i, ""); if ((get_memory_cell(4) == 0) && (get_memory_cell(5) == 0)) { st = 13; } else { st = 0; } slt = get_ran(1, st, 39); print_big_str("Slot = ", slt, ""); itm = item_type_in_slot(i, slt); if (itm > 0) { // steal it and go... print_big_str("Good item = ", itm, ""); if (st > 0) { print_str("Before take item."); char_take_item(i, itm); char_give_item(my_number(), itm); } else { take_item_char_item(i, slt, get_memory_cell(4), get_memory_cell(5)); } print_str("Getting ready to leave."); set_state_continue(11); } else { do_attack(); }break;beginstate 11; // teleport away (get random location (not blocked) and go) print_str_color("The thief takes an item and slips away.", 4); i = current_town_size(); if (i == 0) st = 63; else if (i == 1) st = 47; else st = 31; i = 0; while (i == 0) { x = get_ran(1, 0, st); y = get_ran(1, 0, st); // check x and y fl = get_floor(x, y); tr = get_terrain(x, y); if ((((fl >= 0) && (fl <= 22)) || ((fl >= 37) && (fl <= 56)) || ((fl >= 72) && (fl <= 78)) || ((fl >= 81) && (fl <= 91)) || ((fl >= 95) && (fl <= 123))) && (((tr >= 2) && (tr <= 121)) || ((tr >= 137) && (tr <= 146)) || ((tr >= 155) && (tr <= 165))) && (is_blocked() == 0)) { i = 1; } // slip to location if (i == 1) { relocate_character(my_number(), x, y); } }break; What seems to happen is that it gets to the line 'char_take_item()' and throws the following message: 'Peculiar Error: Undefined function called'. I've been banging on this code for two days and can't figure out why it's displaying that message. Does anyone know what it means? Have I forgotten something in the script? Mike
  10. That's good to know, It'll save me the time to test out a darkness breather. I guess because of this line (in the boa exe) 'Your light is instantly snuffed out.' in the same area as the 'breathes darkness' text, I made the assumption that the darkness breath killed the light sources. Oh well.
  11. Just in case someone else needs a solution for this, what I ended up doing was set the dungeons to total dark, and add custom floor types importing the regular floor types, but adding the fl_light_radius=3 line to them. This isn't as slick as 'a puff of wind blows through and snuffs your torch out', but it allows me to have 'dark' areas and lighted areas without having to place terrain light sources. Note, I tried with the status calls to see if there was an undocumented status, but up through about status = 400, no luck. Also, it seems like you can create creatures that breath 'darkness'. It sure seems like that it would be easy enough to add a call to control the parties light source.
  12. Hi all, Does anyone know of a good technique to turn off a parties light source (torch, lamp, magic, etc.) and make it 'dark' again while in a dungeon? I couldn't find anything in the manual, but could've missed something that would work.
  13. Thanks for the warning. Luckily this isn't intergal to the plot line, just trying to dot the i's, cross the t's - so to speak. I'll probably just put in a warning message about combat mode and let the player make the choice. As another thought, would placing a check after each 'doattack()' call within the creature scripts be a better place to see if the split off character is in trouble? I may try this one day when I get really motivated.
  14. Thanks. I kinda knew that generation through scripting was the way to go, I was just getting lazy.
  15. I have the following code in a town's start state: Code: if (get_flag(4, 13) > 0) { plyr = get_selected_char(); // check if player in trouble in arena - loses automatically if ((char_status(plyr) != 1) || (get_health(plyr) < 15)) { // player has lost - rejoin party, then revive ii = get_char_status(plyr, 4); set_char_status(plyr, 4, -ii, 1, 0); reunite_party(); restore_pc(plyr); play_sound(27); message_dialog("You have lost your fight and have been teleported back to your companions.", "The victor is still getting crowd acclamation within the arena"); kill_char(get_flag(4, 3), 2, 0); set_flag(4, 3, 0); set_flag(4, 13, 0); }} Basically, it watches a 'split off' character and forces a heal/rejoin if the character is in trouble. It works great as long as the character does not go into combat mode. There it only works if the wounded check is met between combat rounds. Otherwise, the game ends in death. Is there another way to force a party rejoin if a split character dies while in combat that I may have missed? Or do I just pop up message letting the player know that combat may not be the best option while 'split'?
  16. Maybe it's just me and I haven't found it, but how do you turn off the wandering town monsters when you 'kill' a town? I would've assumed that by setting a town as dead, that the wandering monsters defined would stop, but they still seem to be generated. In outdoor regions, you have a sdf that can be used to turn off the encounters, but there doesn't seem to be something similar for wandering town monsters.
×
×
  • Create New...