Well-Actually War Trall BainIhrno Posted February 4, 2013 Share Posted February 4, 2013 In my translation of Of Good and Evil to Blades of Avernum, I'm programming the friendly towns to (1) end the scenario if you steal something (doesn't count as winning) and (2) kill you if you attack the town. I know that's probably not what some BoA players want to hear, but I feel when translating the plot over to BoA, being able to attack the friendly towns and the response only being the standard "town becomes hostile" wouldn't make sense in this storyline. So I have programmed this with the START_STATE command, but I'm worried that having the game check the crime level every turn will cause the game to slow down. So I guess my question is, does START_STATE slow the game down if used in certain ways? Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Ishad Nha Posted February 4, 2013 Share Posted February 4, 2013 I have used it for creating timers, in Shadow of the Stranger you need it to know when the day ends. (Some towns have separate versions for both day and night.) It seemed to work okay, no slowing down. I don't think it will make much difference but I don't really know. IIRC crime is handled only one way, via the crime_level functions. Offhand I don't know if you can give players banishment rather than death. Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Niemand Posted February 4, 2013 Share Posted February 4, 2013 I know that's probably not what some BoA players want to hear, but I feel when translating the plot over to BoA, being able to attack the friendly towns and the response only being the standard "town becomes hostile" wouldn't make sense in this storyline. The default behavior isn't very useful, since it can easily put a game into an un-winnable state. I, for one, see no problem with your choice to alter it. So I guess my question is, does START_STATE slow the game down if used in certain ways? Absolutely. Avernumscript is very slow, as can be seen when designers ask it to do too much. (See for example, A Visit to the Madhouse, which accumulated a fair number of complaints because of frequently running creature scripts.) However, in this case I think you're probably fine, since you're only putting in a single conditional. If you really feel paranoid, you could factor out the body of the conditional into another state and brach to it with set_state_continue() so that there's very little code actually in the START_STATE. (Assuming the interpreter in the game works as the pieces of it leftover in the editor do, even when the body of a conditional is skipped the skipping takes time proportional to the amount of code skipped.) Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Ishad Nha Posted February 4, 2013 Share Posted February 4, 2013 Come to think of it, this will work for the current town: short town_status(short which_town) 2- party has entered, town hates Town goes hostile due to the crime level being reached, then this is evaluated, you can then end the scenario. You need to distinguish between possible causes of hostility. If a PC attacks someone a flag can be set... Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk Kelandon Posted February 4, 2013 Share Posted February 4, 2013 However, in this case I think you're probably fine, since you're only putting in a single conditional. This. I did something like this in Exodus, with each of the expedition towns having a crime level and flag check in the START_STATE. It runs fine. Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall BainIhrno Posted February 4, 2013 Author Share Posted February 4, 2013 Thanks everyone. For stolen items, I may set up the coding to lower your reputation for doing so rather than ending the scenario, under further consideration (OG&E in BoE had a reputation system). Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall BainIhrno Posted March 21, 2013 Author Share Posted March 21, 2013 I've started alpha-testing the scenario now, and this is the configuration I used to check the crime level beginstate START_STATE; if (get_crime_level(ME) > 0 && < 5) set_state_continue(53); if (get_crime_level(ME) >= 5) set_state_continue(54); State 53 will decrease the party's reputation via SDF by 1. State 54 will kill the party. However, right now the scenario is calling state 53 on every turn in the town, and attacking the town doesn't call 54. What am I doing wrong? Quote Link to comment Share on other sites More sharing options...
Easygoing Eyebeast Xaiya Posted March 21, 2013 Share Posted March 21, 2013 I've started alpha-testing the scenario now, and this is the configuration I used to check the crime level beginstate START_STATE; if (get_crime_level(ME) > 0 && < 5) set_state_continue(53); if (get_crime_level(ME) >= 5) set_state_continue(54); State 53 will decrease the party's reputation via SDF by 1. State 54 will kill the party. However, right now the scenario is calling state 53 on every turn in the town, and attacking the town doesn't call 54. What am I doing wrong? START_STATE get's called every turn, so every turn it checks with the if statement. That's why it's calling 53 every turn. If you want 53 to only be called once the first time the party does something to raise the crime level and no more, then you'll need to add a flag condition. And my memory may be a bit fuzzy on this, but I think killing someone simply raises the crime level by 3. Though more importantly, there's a mistake in the syntax: if (get_crime_level(ME) > 0 && < 5) I believe should be if (get_crime_level(ME) > 0 && get_crime_level(ME) < 5) Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk Kelandon Posted March 21, 2013 Share Posted March 21, 2013 The call get_crime_level() doesn't take arguments, so get rid of those ME arguments. Also, fix the && syntax as Iffy described. Finally, you'll want to have a flag in state 53 that makes it a one-time for each increase in the crime level. So, for example, you could check if the crime level equals the flag at the beginning of the state (and end the state if it does), and then set the flag equal to the crime level at the end of the state. Something like: if (get_crime_level() == get_flag(100,0)) // assume that flag 100,0 is just tracking whether this state has been called end(); inc_flag(100,1,get_crime_level() - get_flag(100,0)); // assume that flag 100,1 is the reputation flag — this decreases the reputation by the additional amount of the crime level set_flag(100,0,get_crime_level()); Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall BainIhrno Posted March 21, 2013 Author Share Posted March 21, 2013 Thanks. As long as I'm on this subject, can SDFs have a value below 0 in BoA? The current configuration has two SDFs for reputation that supplement one another, one keeps track of good deeds and one of bad deeds. Is it possible, in other words, to do with one SDF? Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk Kelandon Posted March 21, 2013 Share Posted March 21, 2013 I believe the answer is no on the negative value but yes on the one SDF. The way Jeff handles that in Geneforge is by setting the SDF to 100 to begin with, so instead of dealing with negative numbers, he just deals with values below 100. Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Ishad Nha Posted March 22, 2013 Share Posted March 22, 2013 Have to be careful that a party does not increment their reputation SDF below 0 or above 255, that will cause a crash. Make alterations only happen if SDF is above A and less than (255 - A), where A is the largest possible increment for reputation. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.