Server Totals
Deglos - (3)
Mikona - (2)
Le'Or - (2)
Ferrell - (1)
Elysia - (1)
M'Chek - (1)
Wilderness - (1)
Visimontium - (0)
Underdark - (0)
Total players: 11
Gallery

Links Menu

Making generic rooms

Moderators: Nighthawk4, Dungeon Masters

Making generic rooms

PostAuthor: JollyOrc » Mon Mar 01, 2004 9:26 am

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 ?)
User avatar
JollyOrc
QA Resource
 
Posts: 3900
Joined: Fri Jan 17, 2003 11:41 am
Location: Germany
Timezone: GMT+1

PostAuthor: Someone Else's Problem » Mon Mar 01, 2004 9:46 am

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.
User avatar
Someone Else's Problem
Whiney Peasant
 
Posts: 15
Joined: Tue Feb 10, 2004 9:32 pm

PostAuthor: Dirk Cutlass » Mon Mar 01, 2004 9:50 am

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.
User avatar
Dirk Cutlass
Elder Sage
 
Posts: 4703
Joined: Mon Jan 27, 2003 9:42 am
Location: GMT

PostAuthor: JollyOrc » Mon Mar 01, 2004 10:04 am

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]
User avatar
JollyOrc
QA Resource
 
Posts: 3900
Joined: Fri Jan 17, 2003 11:41 am
Location: Germany
Timezone: GMT+1

PostAuthor: Titanium Dragon » Mon Mar 01, 2004 10:30 am

Nah. You only need 3-4 of them... unless you expect EVERYONE to go in one at once.
Gilkin> ouch. how often do you roll a 20?
Cath> once every 20 rolls?
User avatar
Titanium Dragon
Sage
 
Posts: 2917
Joined: Sun Apr 27, 2003 5:18 pm
Location: Corvallis, OR (GMT - 7)

Re: Making generic rooms

PostAuthor: Jordicus » Mon Mar 01, 2004 1:33 pm

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.
You see things and you say, "Why?" But I dream things that never were and say, "Why not?" George Bernard Shaw
User avatar
Jordicus
Team Member; Retired with Honors
 
Posts: 8048
Joined: Tue Jan 21, 2003 3:46 pm
Location: Whitehall, PA (GMT -4)

PostAuthor: Arcsylver » Thu Mar 04, 2004 4:31 pm

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.
User avatar
Arcsylver
Scholar
 
Posts: 1130
Joined: Mon Jan 27, 2003 7:54 pm
Location: Elysium

PostAuthor: Chassagne » Tue Mar 09, 2004 9:19 pm

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
User avatar
Chassagne
Squire of Babble
 
Posts: 47
Joined: Sun Nov 30, 2003 9:29 pm
Location: Paris, France

PostAuthor: Chassagne » Thu Mar 11, 2004 11:34 am

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.
User avatar
Chassagne
Squire of Babble
 
Posts: 47
Joined: Sun Nov 30, 2003 9:29 pm
Location: Paris, France


Return to NWN Scripting

Who is online

Registered users: Bing [Bot], Google [Bot], Talwin Hawkins