Page 1 of 1
Making generic rooms
Posted: Mon Mar 01, 2004 9:26 am
by JollyOrc
ok, here is the idea:
We have the necessity for 50 identical looking areas. A block of flats for instance.
The corridors and such are all there, and we have 50 doors which lead to the individual flats.
As the flats are all identical, and there is nothing important in there, behind some flavour decoration, why should one create and load all of those areas ?
So I plan to create just two of those. And when a PC goes through the doors, the door slaps a local variable onto the PC with the waypoint of the door he entered.
When he leaves the flat again, the script should look into this variable, and send him to the according exit.
Now, my question: Does OnAreaTransitionClick() provides me the hook I need for this ? Does this event allow me to send a pc to a waypoint, or do I have to change the destination tag entry of the AT ? (Is this possible ?)
Posted: Mon Mar 01, 2004 9:46 am
by Someone Else's Problem
if two people walk into different flats, then they'll end up in the same one. why not create a single area with all 50 flats inside - it'd take a bit longer to load (but, without anything actually in there, not much) and you'd have to do all the doors separately (and already visited rooms would appear on the map) but at least you wouldn't end up adding 50 new and practically useless areas and you wouldn't get the problem mentioned above.
Posted: Mon Mar 01, 2004 9:50 am
by Dirk Cutlass
And what happens if the player walks into one of the rooms and drops something on the floor... and then goes into the next room. The 'something' will be there too.
Posted: Mon Mar 01, 2004 10:04 am
by JollyOrc
SEP:
I think this could be overcome by adding, let's say 4 areas.
Then the teleporting script does this check:
(Warning, pseudocode following:)
Code: Select all
for each possibleArea
if anotherPCinArea()
if PCisFromSameTransition()
TeleportToArea()
break()
end if
else if IsAreaEmpty
TeleportToArea()
break()
end if
next
TeleportToLastArea()
giveErrorMessage()
As to the dropping of items: Perhaps a slightly more aggressive item cleanup script might help here. Would need an IC explanation though[/quote]
Posted: Mon Mar 01, 2004 10:30 am
by Titanium Dragon
Nah. You only need 3-4 of them... unless you expect EVERYONE to go in one at once.
Re: Making generic rooms
Posted: Mon Mar 01, 2004 1:33 pm
by Jordicus
JollyOrc wrote:Now, my question: Does OnAreaTransitionClick() provides me the hook I need for this ? Does this event allow me to send a pc to a waypoint, or do I have to change the destination tag entry of the AT ? (Is this possible ?)
1) OnAreaTransitionClick() will provide you with the GetClickingObject() which will returns the most recent object that clicked the door.
so yes, you can grab the correct info about the person using the transition.
2) as far as I can tell you would have to have waypoints setup for this to work properly and then use a ActionJumpToObject() to the specific waypoint you want to be the destination.
If I find anything further, i'll let you know.
Posted: Thu Mar 04, 2004 4:31 pm
by Arcsylver
On a large scale project such as say as an example Mikona, you could use something like 10 house areas and that way it reduces the chances of the accidental two players going to the same house from two different doors.
Of course you go too far and it sort of defeats the purpose of the script though.
Posted: Tue Mar 09, 2004 9:19 pm
by Chassagne
JollyOrc : the metacode you give here doesnt do it. The condition you (isPCInArea) is not correct since two PC can take the same door, and must end in the same flat.
What you need to do is the following.
1) put a local variable on the PC, that tells what waypoint he will jumped to on exit
2) put a local variable on the flat as an area, that tells what entering door this area is currently bound to.
When a 1st PC enters, you bound that flat to that door.
When an a PC leaves, if the area is empty, then you delete this local variable.
When a 2nd PC enter, you have to loop through all the flats, to check if a flat is already bound to that door. If not, take another flat.
If someone drops something on the floor, you cant do anything. But if there is a chest, you can add a local variable to the chest, that tells you what door was used to open that chest, so that you can decide to put some loot in the chest.
Another 2cp advice : dont allow PC that log off from these flats to have their location saved. I guess this can easily be done by not putting the avlis_onenter script on the flats.
Anyway, you have to make an assumption on the maximum number of flats that will be visited at a given time. I guess 5 is already a lot. If all the flats are bound to doors, and if a 6th player wish to enter through a 6th door, then you can just decide to leave him outisde.
My 2cp
Chassagne
Posted: Thu Mar 11, 2004 11:34 am
by Chassagne
I made a set of scripts to do that. We are going to use it in Hala, since we have like 50 different interior houses in Nagricth alone, that will be reduced to less than 10.
If anyone is interested, feel free to contact me.