Making generic rooms
Moderator: Event DM
- JollyOrc
- Elder Sage
- Posts: 3984
- Joined: Fri Jan 17, 2003 11:41 am
- Timezone: Europe, CE(S)T
- Location: Germany
- Contact:
Making generic rooms
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 ?)
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 ?)
- Someone Else's Problem
- Whiney Peasant
- Posts: 15
- Joined: Tue Feb 10, 2004 9:32 pm
- Contact:
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.
- Dirk Cutlass
- Elder Sage
- Posts: 4691
- Joined: Mon Jan 27, 2003 9:42 am
- Location: GMT
- JollyOrc
- Elder Sage
- Posts: 3984
- Joined: Fri Jan 17, 2003 11:41 am
- Timezone: Europe, CE(S)T
- Location: Germany
- Contact:
SEP:
I think this could be overcome by adding, let's say 4 areas.
Then the teleporting script does this check:
(Warning, pseudocode following:)
As to the dropping of items: Perhaps a slightly more aggressive item cleanup script might help here. Would need an IC explanation though[/quote]
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()
- Titanium Dragon
- Sage
- Posts: 2916
- Joined: Sun Apr 27, 2003 5:18 pm
- Location: Corvallis, OR (GMT - 7)
- Contact:
- Jordicus
- Team Member; Retired with Honors
- Posts: 8042
- Joined: Tue Jan 21, 2003 3:46 pm
- Location: Whitehall, PA (GMT -4)
- Contact:
Re: Making generic rooms
1) OnAreaTransitionClick() will provide you with the GetClickingObject() which will returns the most recent object that clicked the door.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 ?)
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.
You see things and you say, "Why?" But I dream things that never were and say, "Why not?" George Bernard Shaw
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.
Of course you go too far and it sort of defeats the purpose of the script though.
- Chassagne
- Squire of Babble
- Posts: 47
- Joined: Sun Nov 30, 2003 9:29 pm
- Location: Paris, France
- Contact:
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
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