Day 30: Crimes, Snitching and Arrests


Snitch, Question and Arrest

I created a jail cell in the security room out of existing assets. I added 4 prisoner stations for NPCs when the get arrested.

I created an arrest caution that throws the NPC in jail for 10 turns. All NPCs can snitch on each other and the player.

At this point testing was getting cumbersome and I needed to review my AI workflow.

Game Turn

  1. ai begins their turn
  2. gets players nearby rooms based on exit and enter room
  3. begin ai movement
  4. set npcs target room based on player location and ai_path
  5. s et order of potential rooms based on priority (rooms in between current location and target)
  6. attempt to fill station
  7. remove_effects
  8. release prisoners they get their npc action moves
  9. quest specific checks
  10. load level specifics, visuals, text scripts, …

then… this code:

Address Cautions

local watcher = tasksystem.address_cautions()
if watcher.npc ~= nil then confrontation_scene(watcher) end
  • the dreaded address_cautions that i’ve needed to cleanup for a while
    • add to game_turn function? - probably

Reviewed and Tweaked

I use two separate functions for witnessing the player steal and an NPC steal. I need to combine repeated code. Nothing really happens when the player is confronted. Needs a lot of consequences. Need to delete old cautions after they are addressed, like when someone is arrested. Addressing cautions needs to happen more often (each turn and interaction).

For confrontations, I need to add the npc’s current room and past room to their state and check to see if the pass each other through a “doorway”.

Stealing

instead of just stealing a random item I added 3 functions for stealing. Steal most valuable, the one that best aligns with your skills, the last item that was added or a random item.

I also added stat bonuses for every item.

Bugs Everywhere

Noticed when NPCs are sent to jail, they are cloned, and one of them is still walking around free.

I created logs to show what is going on in through the process of stealing and getting caught.

DEBUG:SCRIPT: Quest related checks:::
DEBUG:SCRIPT: steal attempt -	visitor01	 SEEN by:	labor02	in	grounds
DEBUG:SCRIPT: labor02	did not confront: 	visitor01
DEBUG:SCRIPT: consulation_checks:	reckless
DEBUG:SCRIPT: labor02	saw	visitor01	do	theft	and created caution:	reckless
DEBUG:SCRIPT: consulation_checks:	snitch
DEBUG:SCRIPT: RC:::	visitor02	has NO effect but a caution:	snitch	because of gossip from	labor02	that	visitor01	was caught for	theft
DEBUG:SCRIPT: visitor02	saw	visitor01	do	theft	and created caution:	snitch

I think what is interesting here is that V01 was seen stealing by L02, but L02 didn’t snitch to security. Instead L02 recklessly gossiped to V02 about the crime. Then V02 snitched to security third hand.
I thought it was fun to see the environment be a little “alive”.

Stashing

I wanted to mimic stealing, but instead NPCs could stash items. I could see in the future NPCs having hot, stolen items that they want to “hide” or cheap items they need to unload.

Now NPCs will either steal or stash. This should help keep inventories level and not have too much crime going on at once.

Also

My inventory code was messy but I ironed out the adding and removing of stat bonuses and also have them applying on “New Game”

Next:

  • Doctor Quests again.

Files

Beeline Blvd.zip Play in browser
May 10, 2024

Get Beeline Blvd.

Leave a comment

Log in with itch.io to leave a comment.