• Announcements

    • Right as Reign

      Logging in   05/10/2017

      If you had an account and can't log in as of 5/9/17, this may be because of a change in logins with new forum software. You can log in using your publicly displayed name (not your username) or your email address and the password you used before.   If you have problems with this, please ask any of the mods or admins. 

Archaon

Member
  • Content count

    32
  • Joined

  • Last visited

    Never

About Archaon

  • Rank
    Citizen
  1. If all else fails, put more parenthesises in your conditions. i.e: if ((foo() == 1) && (lol < 6)){ Might help, might not. Perhaps there is a way to avoid attacks of opportunity, but it would be a messy, roundabout way. I only have the barest concept in mind but it would work like this: -Have terrain scripts one space away from the turret. (Good it's stationary.) -When they are walked in, first block entrance. -Check to see if they are trying to enter from the turret's side, i.e. they try to move away from the turret. -If yes, make the turret friendly. -Unblock them and move them where they wanted to be. Reduce ap, if needed. -Make the turret hostile again. That is, if you are willing to bother. Perhaps you could use relocate instead of playing with the turret's attitude.
  2. While enjoyable, its diminutive length hurts this scenario. It felt smaller than even ‘kill them dead’, though there was a bit more as far as humor and silly(read hilarious) pics are concerned. I liked the custom sprites, especially the unique ones. They gave special feel and polish. The special™ was quite overpowered, even at its cost, and while I tried it, I never needed to use it. The second hulk easily died to the lab platform. The plot was chaotic, in a good way, and made me laugh. There was a semi-serious bug, that almost got me stuck. If Quincy has opened the gate and you leave the tower (i.e to rest), the gate reverts to closed. Also, you can start the cleaning before getting the quest, as long as you have the tools. Combat was a mixed bag. I greatly enjoyed the initial battle and all of the troglo castle, but the bats and the tower, even the final battle, were a bit worse. There is some interesting loot to be found, provided you don’t mind stalling while running for your life. I didn’t. XD This IMO would qualify as ‘good’ if it had been longer. As it is, it better be: Rating: [rating]Average[/rating]
  3. Quote: Edit: I don't think there's a way to change the name just in the dialog. You could always hack something together to that end. Change the name when talk state is called, then again in the town's start state, so it's reset every round. Not sure where that could be used, though. In the annual Merry convention, perhaps[ Merry(Avernum), Merry(Kritzan), etc.]
  4. 1)What you are looking for is in the creature script. If you open basicnpc.txt (or most others), you’ll find TALKING_STATE at the bottom. If memory cell 3 is zero, it will use a default one-liner instead: print_str("Talking: It doesn't respond."); So, if you want, say, the guards to say something different, you find their script (guard.txt) and change the above into something else. 2)This is explained in the docs, in custom floor types. You need a custom floor with special property 2. Don’t forget to set its strength, too. Welcome and happy coding ;-) Edit: also, we should probably take it to the editor forum beneath this one, but meh. An admin might move it.
  5. Quote: Fun fact: Really? Now, interpreter coding is hardly within my scope, but shouldn’t that work backwards? I don’t know, populate some array every time a left bracket is encountered, keeping data such as whether it’s a loop, a pointer to it, etc.
  6. Clever and useless are not mutually exclusive, though…
  7. That piece of runtime stupidity is good to know. It’s mostly avertable, too, if you nest deeply and only use 1 or 2 conditions per line. (Which, on the other hand, inflates your node total. *sigh*) Is there a nest limit? I have yet to hit one, though I haven’t really tried. Of course, one could also give property 6 to all appropriate floors and terrains and make is_blocked actually useful. A lot of work perhaps, but it only needs to be done once. If the shoe doesn’t fit, mutate the toe! @Metatron: To test the script, I gradually spread my party all over my testing town. I have seen attacks succeeding after a 10+ jump and failing after a 2- jump. It isn’t really consistent. Also, I in no way prevent the creature from moving around on its own. Do_attack is supposed to make it actually move towards the target if needed, but it has never done so, which means that at least part of it realizes the set target is right next to it. Schizoid code? Schrödinger’s attack? Can’t tell yet… The problem with emulating an attack is making it balanced. It’s one thing having it wtfpwn other creatures and quite another having it attacking the party. Next test: Shoving set_target in the while loop…
  8. A nice, if a bit short scenario, with a lot of sequel potential, good combat and interesting scripting. The town design is a bit atypical, which is not bad at all. Combining vahnatai and wooden walls is not seen often. The university was a bit cramped, though. A hidden message perhaps? There is a lot of unused space, the bane of headbutters. The characters were a mixed bag. The ones that drive the plot were reasonably fleshed out, but everyone else seemed a bit flat. Deadeye was amusing and useful, even though he didn’t tag along nearly as much as I’d have liked. Combat. I entered this scenario with a level 6 party, which is above the recommended. Thus combat was pretty easy, which I guess would make it balanced for a 1-5 lvl party. The sub-quest dungeons were nice and the harpies even challenging. The wolf battle was also good, especially due to good town design that restricted line of sight. As for general Seth, he didn’t seem like he needed an army at all. He is able to kill everything on his own XD Compared to that, the ‘final’ battle was a bit underwhelming. Not difficulty-wise, that was great, but more like scope-wise. I felt it lacked the epic feel that is a norm for the rest of this scenario. "Where you thought there was a simple garden, there is actually TREACHERY.” Loved this line. Loot was so-so. Perhaps I missed staff, but the noteworthy for me were a bolt of fire level, a not-helmet alchemy booster, some magic crystals and a bunch of highly priced energy potions. Play it. Enjoyable and will leave you wanting more. Rating: [rating]Good[/rating].
  9. Deadlines are a hit or miss for me. If it’s not really interesting, I leave it until the last possible moment, upon when the adrenaline of it all might allow me to enter a productive trance and produce some kind of masterpiece. Or it might not… In either case, my sleeping time usually suffers.
  10. Now that I have thought of it more, it’s pretty simple: -Make each crystal a different Item, but have all of them call the same scenario state. -Use Has_item and append calls and make a list of all available effects the party is carrying. -Ask for input. I’d use something like the alchemy system in Frostbite, so that you can include flavor text, too. State limit is not a problem. One could easily write states in creature or terrain scripts, hide them in inaccessible points and call them through their start_state via sdfs. I recently did that with a cutscene and it worked.
  11. Don’t worry, we are all bad people here, coding in obscure pseudo-C for no good reason and forcing poor creatures to follow our whims. XD Anyway, the above code was written on notepad, on a public PC, with no way to test it. I managed to integrate it into my original code after some much-needed debugging and testing. (And yes, now it runs 8 times, like it should ;-) Run_animation_sound worked like a charm. I also wrapped it all in a conditional, so that it only starts wrapping around when it has a target. Here’s the current, actually working version: Click to reveal.. Code: //Crtele v0.8//A departure from the basic script. The creature wraps next to each character//if able and attacks. // Cell 1,2 - Stuff done flag. If both 0, nothing. Otherwise when this // is killed, set to 1. // Cell 3 - Dialogue node to start with if talked to. if left at 0, this// character doesn't talk.begincreaturescript;variables;short i,j,x,y,a,ready, h, ap;int g;body;beginstate INIT_STATE; 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; //the only state usedif (get_attitude(ME) > 4){ //only run if hostile to party i = 0; set_strategy(ME,10);//target does not change automatically set_char_status(ME,3,3,1,0); //Haste it for more action points set_char_status(ME,16,3,1,0); //And divinely touch it while (i < 6){ //once for each party member if (char_ok(i)){ //make sure character exists if ((dist_to_char(i) <= 16) && (can_see_char(i))){ //Both distance and LOS //check terrain around target and select destination h = get_height(char_loc_x(i), char_loc_y(i)); j = 1; ready = 0; a = get_ran(1,1,8); //random position around target. 1 for north, c-clockwise. while ((j < 9) && (ready == 0)){ x = 0; y = 0; if ((a < 3) && (a > 7)) y = -1; if ((a > 3) && (a < 7)) y = 1; if ((a > 1) && (a < 5)) x = -1; if ((a > 5) && (a < 9)) x = 1; x = char_loc_x(i) + x; y = char_loc_y(i) + y; //long series of checks. This can only improve by checking floor and terrain numbers (*shudder*): if (((char_on_loc(x,y) == -1) || (char_on_loc(x,y) == my_number())) && (can_see_loc(x,y) == 1) && (get_height(x,y) == h) && (is_blocked(x,y) == 0)) ready = 1; j = j + 1; a = a + 1; if (a > 8) //We haven't checked every space yet, so cycle back to 1 a = 1; } if (ready == 1){ //if destination found... if ((x != my_loc_x()) || (y != my_loc_y())){//teleport if it's not there... put_boom_on_char(ME,2,0); relocate_character(my_number(),x,y); put_boom_on_char(ME,2,0); run_animation_sound(10); } set_target(ME,i);//target... ap = my_ap(); g = 0; while ((my_ap() == ap) && (g < 5)){ //Try to attack more than once. Sometimes even g < 500 doesn't work... do_attack(); g = g + 1; } } } } i = i + 1;//repeat for each party member, if possible } end_combat_turn();//then end turn.}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; More do_attack woes. I thought I was pretty smart when I tried this: ap = my_ap(); while (my_ap() == ap){ do_attack(); g = g + 1; } After generating an infinite loop error, I thought better. Sometimes, even 1000 repeats won’t result in an attack. By testing more, I found three possible cases. -do_attack works at once -It works after roughly 2-5 repeats -it doesn’t work no matter how many times you spam it. I can only think of theories right now. Perhaps the random generator is not seeded often enough, or perhaps a finite number of random values is pre-generated each round. Some in these forums have messed around with the BoE code. Is there something comparable there? Also, did I miss some is_REALLY_ blocked call? My placement detection usually works, but it can still teleport the creature behind a window, on water, etc. Need I really use some huge get_floor/terrain conditional to make sure?
  12. I did see the script you mention (something massacre, I think. I haven’t played your scenario yet, but I soon will.). If I read this correctly, the last_abil method uses the wrap every other turn or so. I intended that script to be used to the exclusion of all other attacks (So, the enemy has one powerful ability, but no versatility.) However I must confess your method of finding a free space (the first ‘while’ in the previous post) makes my skin crawl. Brute-forcing random numbers in hopes of a match is frankly a bit horrible (yet still better than what I did in my first version.) So, I came up with this: Code: x = 0;y = 0;i = 0;ready = 0p = get_rand(1,1,8);while ((i < 9) && (ready == 0)){ if ((p < 3) && (p > 7)) y = -1; if ((p > 3) && (p < 7)) y = 1; if ((p > 1) && (p < 5)) x = -1; if ((p > 5) && (p < 9)) x = 1; if (char_on_loc((char_loc_x(a) + x),(char_loc_y(a) + y)) = -1) ready = 1; i = i + 1; p = p + 1; if (p > 8) p = 1;} A bit more complicated, so I’ll explain. There are 8 possible positions around the target. The ‘p’ variable represents that, with 1 for north and moving counter-clockwise. X and y are the offsets from the target’s position. Putting the aforementioned 8 positions on a 3x3 grid, you’ll notice that for each side of the grid, one of the offsets always changes the same way, to either 1 or -1. The string of double condition ifs calculates that. So we have a line of conditions that depend on ‘p’ and a while loop that runs 8 times at most. By making the while’s control variable different from the ‘p’ and by selecting the ‘p’ randomly, you ensure the check will start from a random point, and thus the result will be random. At the end of the loop, the ‘p’ cycles back to 1 if it’s larger than 8, so that all positions will be checked.
  13. I can think of a few workarounds, but they are pretty ugly. - Make one kind of item for all crystals. -Give crystals only through scripted events and use 1 sdf per skill to count how many crystals of each kind the party has. -Each time a crystal is used, display a message saying which effects are available and ask for input of what to use. The only problem is what happens when the party drops a crystal. To fight that, you could make a single item called “bundle of crystals” and only take it away when there are no crystals left. Alternatively, you could make crystals special items and use them through a custom special ability. All these methods use a single state, no matter how many kinds of crystals you have.
  14. I tinkered around a bit more. Divinely touched gave a whopping 18 AP. The script also managed to damage 4 characters… once out of 30 or so turns. Scuttling do_attack seems more and more appealing. It seems to average at 50% success, for some reason. The probability distribution feels like a bell curve… The graphic bug is even weirder. Each time the creature teleports from a position without successfully dealing damage, the first frame of the teleport explosion stays still in each place. The next time anyone lands an attack, all animations resolve in bulk. I have tried to run force_instant_terrain_redraw in multiple places to no avail. It’s not even because of speed. I tried putting large pauses, again with no change. On a slightly unrelated note, is there a way to determine the direction a character faces? There is a cutscene call to set the direction but nothing that returns it.
  15. Once again I’ve tried something ambitious and once again I’m only partly successful. Take a load of this: Click to reveal.. Code: //Crtele v0.3//A departure from the basic script. The creature wraps next to each character//if able and attacks. // Cell 1,2 - Stuff done flag. If both 0, nothing. Otherwise when this // is killed, set to 1. // Cell 3 - Dialogue node to start with if talked to. if left at 0, this// character doesn't talk.begincreaturescript;variables;short i,x,y,xa,ya;body;beginstate INIT_STATE; 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; //the only state used i = 0; set_aggression(ME,100); set_strategy(ME,10);//target does not change automatically set_char_status(ME,3,15,1,0); //Haste it for more action points while (i < 6){ //once for each party member if (char_ok(i)){ //make sure character exists if ((dist_to_char(i) <= 16) && (can_see_char(i))){ //Both distance and LOS x = char_loc_x(i);//store x,y y = char_loc_y(i); xa = x; ya = y; //check terrain around target if ((get_terrain(x, y + 1) == 0) && (char_on_loc(x,y + 1) == -1)) ya = y + 1; if ((get_terrain(x, y - 1) == 0) && (char_on_loc(x,y - 1) == -1)) ya = y - 1; if ((get_terrain(x + 1, y ) == 0) && (char_on_loc(x + 1,y) == -1)){ xa = x + 1; ya = y; } if ((get_terrain(x - 1, y ) == 0) && (char_on_loc(x - 1,y) == -1)){ xa = x - 1; ya = y; } if ((xa != x) || (ya != y)){ //if destination found... if ((xa != my_loc_x()) || (ya != my_loc_y())){//teleport if I'm not there... put_boom_on_char(ME,2,0); force_instant_terrain_redraw(); play_sound(-10); pause(2); relocate_character(char_on_spot(my_loc_x(),my_loc_y()),xa,ya); //convulted, but relocate_character does not accept 'ME' put_boom_on_char(ME,2,0); force_instant_terrain_redraw(); pause(2); } set_target(ME,i);//target... do_attack();//attack! } } } i = i + 1;//repeat for each party member, if possible } end_combat_turn();//then end turn. 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; A creature script that wraps around the party instead of moving normally. It’s also supposed to attack all characters each turn, although it only manages none to 3 for some reason. Problems? Some graphic glitches. Do_attack() not always working, even though I force aggression to 100 and provide valid targets. Action points seem to cap at 10, even with haste, while I need at least 13 for 4 attacks. Perhaps do away with do_attack and deal damage manually? Thoughts? Testing? Debugging? Suggestions? Spam?