*comment each room has two adjacent rooms, so we 50:50 which way the monster will go: ![]() Here’s a working example, with some comments… But please don’t just copy and paste it, try to understand it (feel free to ask questions) and adapt it to your specific requirements. One possibility is to use the array syntax to create location “objects” that have next/prev (or first/second) attributes that represent the “paths” between rooms. So you need a way to “model” the the layout of the rooms. The code needs to be told what it can and can’t do. You can’t really shortcut this, if you want code to adhere to some rules, then you need to define those rules in code. (without going into a massive amount of lines of C-Script) ![]() Even if the PC has this skillset they can completely avoid the mission (no stat check, no need to take specific plot avenues to avoid it) by simply clicking the “do not accept this mission” button. I will also note, this is a SIDE-MISSION in the game and it is made abundantly clear to the PC which skillset they will need to complete this mission. This particular section of the novel is horror-esque though the player can kill the creature under -very- specific circumstances (having a specific item and a particular skill). It’s also more unfair because the player has no possible way of predicting the creature’s movements and adapting accordingly. Obviously if the movement is completely random, this is very, very unfair to the player who can only move between a small and very set number of points from any given point. If possible, I’d also be looking to have it set up so that the player is aware of the creature’s presence in a neighboring room (for example player is room 3 which connects to 2 and 4 and thus either value causes the player character to hear noises indicating the monster is nearby) so that the player has indicators that they need to hide or go someplace else. Movement-wise, I’m looking to put the creature and the player on equal terms in regards to their abilities to maneuver. ![]() Using *rand can set a value for the creature (kind of jury-rigging here) within a specified range (for example there are 6 rooms, if rand = 6 then the creature is in room 6) but is there a way to limit the creature (without going into a massive amount of lines of C-Script) from going from A to C when the player from room A can only move to B? They cannot reason with it nor can they trap it (permanently anyways). The reason this is important is because simply put the player cannot kill it. I would prefer the NPC to move semi-randomly (it is not a very intelligent creature) but not so randomly as to be moving through walls the player cannot move through. In the book I am currently writing I intend to have a single NPC monster that moves around a facility the PC is inside of.
0 Comments
Leave a Reply. |