Can i get some help with this script?

You could make the door locked / unlocked via variable check. If the player paid for the room, the player can use the door / open it and if he hasn't paid, it's not possible.

You could do this in a combination of spatial script inside the room or so, to check if the player is still inside or not.
 
Josan12 wrote:
I have a question: As part of my resting mod, i want the rooms that you pay for in the game to actually be something useful. Here's my proposal:

a) make the doors on the pay-for rooms locked under a high difficulty lock (easy change - i can do this)
b) make the beds in said rooms 'useable' that will heal 999hp (easy change can do this)

So, when the player pays for their room, they get teleported into the room, past the locked door. They use the bed, and get their healing.

Of course you should make your mod do the things you want in exactly the way you'd like, but all this seems like you're making things unnecessarily complicated for yourself. Why not just set a timer when the player pays the innkeeper for the room? The way it would work then, would be pretty simple:

1) Player pays innkeeper for a room, setting a timer;

2) Player now has access to a room for a day (week, month, etc) depending on the duration of the timed event;

3) If the player rests in the inn during the time(r) period for which they have paid for a room, the player gets extra healing;

4) Once the timer runs out, the player doesn't get any more bonus healing on that map until they pay for a room again.

There's nothing wrong with asking the player to use a little imagination, but it's usually a bad idea to artificially limit the player's freedom and introduce complicated game mechanics that may end up causing more frustration than satisfaction for the player. I'm not sure what benefit you're hoping to gain by teleporting the player to a particular room, putting them on the bed, etc. What if I arrive in town in the morning and want to rent a room for later, after I take care of some business? Also most of the rooms at all the various inns are empty, and it seems like it shouldn't matter which room the player chooses (or even if they choose a room at all rather than resting in the lobby). You could populate some of the empty rooms with people who get upset if the player enters their room uninvited, or the innkeeper could get upset if the player barges into other rooms (i.e. lockpicks all the doors) and charge them a higher rent the next time. Perhaps it would be easier to modify the maps slightly so that every inn is designed like the Golden Gecko in the Den; there's a locked door at the lobby entrance to the rooms, and if the player tries to access the guest rooms without paying the innkeeper gets upset.

If the player sneaks into a room anyway, why not just allow it? They won't get the bonus healing if they didn't pay (justified as can't rest well because of worries about being discovered as a squatter, etc), which would make sneaking into a room pointless in the first place.

If it were me the highest level of complexity I'd build into this system would be to give the player a "room key" to a specific room, which the innkeeper asks them to return before checking out (extra rent fee next time if the key wasn't returned on a previous visit). That would likely be more than enough for most folks to simulate the roleplaying experience of renting a room at the inn. In general I'd say that the more elaborate and complex you make your implementation of the "renting a room" idea, the more quickly it will devolve into tedium rather than fun for the player. This needn't be a concern if you're just making the changes for your own enjoyment, but if you're making something to share with others such complexity may unduly limit your potential audience of end-users.

In any case, I wish you well on your modifications.
 
Ok, thanks guys. For such a simple change, this is definately in danger of getting over-complicated. Ultimately, I'm just trying to find a way to finish what BIS left unfinished - they obviously put the pay-for rooms in with some intention, but then they got cut along with the food system etc.

They implemented everything up to teleporting the player into the room.

I think i may go for setting a spatial script right on the inside of the door, that will open the door and can of course only be activated from the inside. I'll see if i can figure it out.
I like the idea of the player getting a key but i doubt i can figure out the scripting for the player not giving it back....
 
Josan12 said:
I like the idea of the player getting a key but i doubt i can figure out the scripting for the player not giving it back....

It's quite easy actually. You put something like the following in the receptionist's script:

Code:
procedure critter_p_proc begin
   variable hotel_exit:=20000; //The tile# of the tile leading outside the hotel/motel/else
   
   if ((tile_num(dude_obj) == hotel_exit) and (obj_is_carrying_obj_pid(dude_obj,PID_ROOM_KEY) > 0)) then begin
      start_gdialog(NAME,self_obj,4,-1,-1);
      gsay_start;
      call node001; //Call the node in which the keeper will ask dude to return the key before going out
      gsay_end;
      end_dialogue;
   end
end

The receptionist will initiate dialogue whenever dude is trying to leave the hotel without returning the key. The important thing is to make sure dude DOES give back the key. Otherwise, the event will be called a million times and dude will not be able to leave the hotel exit tile.
This can be done by not including the option NOT to give back the key :-)

Hope this helps.
 
If you're really committed to this locked doors/teleportation thing, then the "room key" idea would help with that as well. Just attach a script to the room door, making it completely unopenable unless the player-character has the room key in his/her possession. Assuming the innkeeper gives the pc the key at the time the room is rented and the pc is teleported to the room immediately after that, there should never be a problem situation where the pc becomes trapped inside the room.
 
Why would the PC need to return the room key? Maybe when they leave the establishment the key is automatically deleted from their inventory, and the slate is wiped. You can only pay for 1 night, if you wish to stay again leave and return to book your room.
 
I would simply do it either like in Fallout 1, where the hotel keeper npc is moving with the player to his room and talks to him (dialog opens, "do you want to rest now?" - yes / no) or like in Fallout 2, althou I can't remember right now, how it was handled there. (Wasn't it just with prostitutes?)
 
I have a question for everyone and anyone:

How would people feel if i were to make ALL beds in the game 'flat'??. When scenery objects are flat it simply means the player can walk on them.
The reason i am considering this is as a way to have the townsfolk be able to 'sleep' on them at night. If they are movement blockers this is not possible to my knowledge (although if anyone's got any bright ideas - be my guest)

Thoughts?
 
Josan12 said:
I have a question for everyone and anyone:

How would people feel if i were to make ALL beds in the game 'flat'??. When scenery objects are flat it simply means the player can walk on them.
The reason i am considering this is as a way to have the townsfolk be able to 'sleep' on them at night. If they are movement blockers this is not possible to my knowledge (although if anyone's got any bright ideas - be my guest)

Thoughts?

But how it works with Mrs Bishop?
Just a proposition or is it too much work to realize?
 
Josan12 said:
I have a question for everyone and anyone:

How would people feel if i were to make ALL beds in the game 'flat'??. When scenery objects are flat it simply means the player can walk on them.
The reason i am considering this is as a way to have the townsfolk be able to 'sleep' on them at night. If they are movement blockers this is not possible to my knowledge (although if anyone's got any bright ideas - be my guest)

Thoughts?

Usually bed scenery occupies one hex, so the rest needs to be filled with secret blocking hexes. You can remove several hexes 'in the middle' of the bed to enable dude/NPCs to 'sleep' in those beds.

However, I've been trying some tricks with flat scenery and sometimes it overlaps with lying character models :| Of course, I may be wrong...
 
Josan12 said:
I have a question for everyone and anyone:

How would people feel if i were to make ALL beds in the game 'flat'??. When scenery objects are flat it simply means the player can walk on them.
The reason i am considering this is as a way to have the townsfolk be able to 'sleep' on them at night. If they are movement blockers this is not possible to my knowledge (although if anyone's got any bright ideas - be my guest)

Thoughts?

Well I don't know how you plan on setting up the sleeping part, so I don't know if this would fit your idea...
You can remove the blocking hexes within a critters script like I did in a script earlier in this thread, easiest if every critter have their own bed.

If that's no good, may I suggest a compromise to your idea?
How about removing all the blocking hexes from the map script at nighttime and then add them back in the morning? That should be simple enough to do, just a bit more work writing down the hex numbers from the Mapper. And you are no stranger to tedious work anyway, are you? ;)
 
Josan12 said:
How would people feel if i were to make ALL beds in the game 'flat'??. When scenery objects are flat it simply means the player can walk on them.
Walls will be the big problem Josan…it can’t be done without moving the beds into the middle of the room and avoid going through the walls. :(
 
smilodom said:
But how it works with Mrs Bishop?
Just a proposition or is it too much work to realize?

Good idea. I will look into this

ardent said:
Usually bed scenery occupies one hex, so the rest needs to be filled with secret blocking hexes. You can remove several hexes 'in the middle' of the bed to enable dude/NPCs to 'sleep' in those beds.

Yes - i tried this following the script Darek posted last page in this thread. I couldn't actually make Darek's trick work where the script removes the blocking hex. But regardless, this option seems flawed to me as a) what if the player attacks the sleeping critter? said critter will then be trapped, and b) it's just too much tedious work - even for me (sorry Darek!)


pixote said:
Walls will be the big problem Josan…it can’t be done without moving the beds into the middle of the room and avoid going through the walls. Sad

I don't understand what you mean here. Why would i have to move any of the beds?

So i think it might be helpful to make a summary of the possible ways i can think of going about this challenge. You guys can add to them and comment:

1) The simplest and crudest: simply make a global script that makes all critters go invisible/move them off the map at night.
So when the player enters a map at night, most critters will be gone, to return in the morning.
Some important critters would be exempted from the global script.
These important critters could be assigned sleeping scripts that make them find a bed and sleep.

2) Make all/most beds flat, and assign all/most critters these beds (hexes) to go to sleep on. They would float 'zzzzzz' like Karl does and be undisturbable at night. Some critters could 'vanish' as above if there are not enough beds or they can't be flattened.

Thoughts?
 
Just perhaps a silly question but why in general are beds needed?
What about the option to do it in a similar case like at Bishops?
 
I’m sorry to be the bringer of bad news…but the flat beds will fall behind the walls. It’s one of the factors you’ll need to consider for your sleeping mod; art replacement might be the best and most attractive solution. But I’m sure you will come up with a good solution. :wink:

021bed.gif
 
Why making it that complicated anyway? Wouldn't it be enough to just "use" the bed?
 
I thought exchanging the artwork could be a solution, similar to what they do in Arcanum. The critter walks up to a bed and they disappear, then the beds change and the critter is soundly asleep. It’s a bit weird, but if the artwork is done well, it could be convincing, whether its script friendly, well that’s another issue. :shrug: Ideally you only want one ‘slept-in’ bed design for each bed; otherwise it will become a nightmare to build.

029sleepr.gif
 
.Pixote. said:

SHIT! Well, better that you bring bad news, Pixote, than i waste hours to eventually figure it out myself. Thanks. ;)

Nevertheless, while this is bad, there will be some cases where it would still work out - where beds are away from the wall, or suitably small not to 'intefere' with the wall. I may have to replace some beds with the existing 'matress beds' as they are already flat.

Lexx said:
Why making it that complicated anyway? Wouldn't it be enough to just "use" the bed?

What do you mean? Maybe you think i am talking about the player using the beds? :scratch: If so, that part of the mod is solved. Now i'm exploring a way to make all/most critters in the game go to bed. The problem is that most beds are movement blockers - so there's no easy way for the critter to 'place' themselves on the bed (except Dareks clever method earlier in this thread, but unfortunately too complicated to be applied on a mass scale)


.Pixote. said:
I thought exchanging the artwork could be a solution, similar to what they do in Arcanum. The critter walks up to a bed and they disappear, then the beds change and the critter is soundly asleep. It’s a bit weird, but if the artwork is done well, it could be convincing, whether its script friendly, well that’s another issue. Shrug Ideally you only want one ‘slept-in’ bed design for each bed; otherwise it will become a nightmare to build.

This was another option i missed off the list of possible ways to go about this above. I suppose it work like this:

1) critter moves to bed
2) critter changes their ART_FID to a new one - a 'sleeping in bed' static critter
3) in the morning critter returns to original ART_FID.

two problems i can think of:

1) when the critter reaches the bed, the bed will 'move' to their location when the art changes and look awkward as the bed will be in a different place.

2) what if the player attacks the critter?!?
 
Ah okay. Thought it was with the player. :P

Pixote's bed image is great, btw. Would love to get more. :>
 
Back
Top