Using Different PRP's

If you feel like you're up to the challenge of building your own Ages in Blender or 3ds Max, this is the place for you!

Using Different PRP's

Postby andylegate » Thu Feb 28, 2008 11:03 am

Okay, I'm rubbing my eyes here and my brain is starting to throb........

Without giving too much away about what I'm doing, let me describe the situation:

Let's say I have an Age I'm working on, and it's like Gahreesen. Meaning, I've got this really big looking building that you can see from the outside. To make things simple, the building is not rotating, or anything like the Training Center in Gahreesen is.

Okay, now as was talked about on another thread: you want your avie to be able to enter this building, BUT, you don't want to have the inside the the building in the same scene as the outside (makes the PRP file too big, or hampers performance, whatever your reasons are) scene.

So you've got the outside all done, nice a pretty, you're ready to work on the inside.

You know that you'd like to do something like Cyan did do with Gahreesen, which is have an animation of the avie entering the door, and then the animation cuts to your inside scene. The discussion on the other thread partially showed how to do that with some ALCscripting.

Wondering what Cyan did about that, you take a look at their python files, specifically grsnTrnCtrDoorExit.py and grsnTrnCtrDoorEnter.py and you'll see some very interesting things in the python script. All sorts of nifty things like:

Code: Select all
door2CloseResponder = ptAttribResponder(7, 'door 2 close responder', netForce=1)
behaviorWalkIn = ptAttribBehavior(8, 'walk in behavior', netForce=1)
behaviorWalkOut = ptAttribBehavior(9, 'walk out behavior', netForce=1)
subWorld = ptAttribSceneobject(10, 'subworld')
startCamera = ptAttribSceneobject(11, 'enter door camera')
endCamera = ptAttribSceneobject(12, 'exit door camera')


and things like:

Code: Select all
if (id == door1CloseResponder.id):
            if (avatarEntering != PtGetLocalAvatar()):
                return
            print 'door closed, teleport and open other door'
            endCamera.value.pushCameraCut(PtGetLocalAvatar().getKey())
            PtGetLocalAvatar().avatar.enterSubWorld(subWorld.value)
            PtGetLocalAvatar().physics.warpObj(arrivePt.value.getKey())
            door2OpenResponder.run(self.key, avatar=PtGetLocalAvatar())
            return


All sorts of goodies, like PtGetLocalAvatar().physics.warpObj(arrivePt.value.getKey()) and then you realize....."Woah, jeez, it kinda looks like I'm over my head here......let me look at the prp files...."

So you go and import one single PRP file into Blender...like lets say Garrison_District_grsnTrainingCenterHalls.prp, only there was nothing in Blender to see... :shock: .
Okay, okay, I know, each PRP file will be a seperate page in the book!........only, how do I look at it? I have to import the entire Age? What the hell is the "Import Single PRP" good for then? Der......... :roll:

All right, then....uhm, trying to see if I get this right:
You want your inside building to be on a seperate PRP, okay, that means adding a page, and making sure each and everything you add has a logic property that indicates that page number, right? But you'll be building it right there in the same Scene as everything else on the outside? Right? But because you've added a page, and made sure that everything inside the building has a Page_num 2 property, etc, when you export the Age, the guts of the building will have it's own PRP file? Correct? Or not?

"What we have here, is a failure to communicate." that line from the Movie 'Cool Hand Luke' just popped in my mind. There are tutorials for how to add a page to your book. But nothing very clear on how you're doing that to have those objects in a different PRP file.
"I'm still trying to find the plKey for Crud!"
Image
Blender Age Creation Tutorials
3DS Max Age Creation Tutorials
User avatar
andylegate
 
Posts: 2348
Joined: Mon Oct 01, 2007 7:47 am

Re: Using Different PRP's

Postby Grogyan » Thu Feb 28, 2008 2:05 pm

When importing you need to delete the current scene, its not enough to delete all objects, lights, cameras etc.
There is a menu on the top bar with text like "add new scene", you'll find it.

There are 6 doors, yes, I can't find out right now as I am at work. Is there seperate code for each door?
Other than that the code is pretty straight forward, D'lanor can tell you how that code works better than I can, from my mobile.
Better to have loved and lost than never to have loved at all
User avatar
Grogyan
 
Posts: 1203
Joined: Thu Oct 11, 2007 1:27 am

Re: Using Different PRP's

Postby andylegate » Thu Feb 28, 2008 3:09 pm

Nope, sorry, No go, still does not show a thing. I've deleted the scene and everything. Blender says it imported it (a 6 MB file) in just 1.43 seconds, which makes me very suspicious in the first place.
"I'm still trying to find the plKey for Crud!"
Image
Blender Age Creation Tutorials
3DS Max Age Creation Tutorials
User avatar
andylegate
 
Posts: 2348
Joined: Mon Oct 01, 2007 7:47 am

Re: Using Different PRP's

Postby Grogyan » Thu Feb 28, 2008 4:15 pm

I know that when you import a prp that is known to have animations in it, blender shows nothing but i'm sure that the doors for the training centre are kept seperate from the corridors.
I don't know, as the plugin is incomplete.

But to get an object on another page, you just simply add a logic property
string
type: page_num
value: (the page number you want)

This is what I have to do for my shell in Ahra Pahts for every object, light, camera and region etc
Better to have loved and lost than never to have loved at all
User avatar
Grogyan
 
Posts: 1203
Joined: Thu Oct 11, 2007 1:27 am

Re: Using Different PRP's

Postby Chacal » Thu Feb 28, 2008 5:09 pm

Actually Andy, you're probably better off looking at the Python code and correlating with what you see in game.
Importing the Age into Blender will not show you everything, but it is interesting for objects and regions.

Don't forget that Gahreesen is a very special and complicated case. Subworlds were just a dirty trick to get the revolving worlds working. Also there are lots of separate prps in Gahreesen because of that requirement of a revolving, multi-player world.

I'd suggest starting with a simple case and adding to it when it works.
First just get the teleport working, not bothering about animations. This looks interesting:

Code: Select all
if (id == door1CloseResponder.id):
            if (avatarEntering != PtGetLocalAvatar()):
                return
            PtGetLocalAvatar().physics.warpObj(arrivePt.value.getKey())
            return
Chacal


"The weak can never forgive. Forgiveness is an attribute of the strong."
-- Mahatma Gandhi
User avatar
Chacal
 
Posts: 2515
Joined: Tue Nov 06, 2007 2:45 pm
Location: Quebec, Canada

Re: Using Different PRP's

Postby Grogyan » Thu Feb 28, 2008 8:25 pm

I just imported the prp, and switched scenes, and I can see the hall/corridor, but the airlocks are NOT part of it.
Better to have loved and lost than never to have loved at all
User avatar
Grogyan
 
Posts: 1203
Joined: Thu Oct 11, 2007 1:27 am

Re: Using Different PRP's

Postby Nadnerb » Fri Feb 29, 2008 12:39 pm

A) Gahreesen isn't about having the insides and outsides in different pages. That technically shouldn't affect performance. The trick with Gahreesen is actually that the interior of the rotating building 1 is physically several miles below the exterior, and is not rotating at all. The reason for all of the trickery is because of the rotating buildings, not because of performance.
B) From your description, I'm not entirely sure why you want to do what you're proposing, (ie putting the interior in a different prp page) because, as noted in a, it won't really have any performance impact.

For further clarity: When you walk out of a rotating building in Gahreesen, the following occurs.
1) You start out in a completely stationary area floating in space somewhere, and walk into the interior copy of the "airlock". The door closes.
2) Once your avatar is out of sight, the game warps it several miles upward to the location of the exterior models, into one of the external airlock copies.
3) Then it inserts you into a subworld, which contains the rotating portion of the building. When you are in a subworld, the game is pretending that you are moving relative to the rest of the world, while you're "really" standing in one spot, watching the rest of the world move around you.
4) upon entering the subworld, a camera region or behavior is activated, which snaps the camera to the appropriate location. You are now looking at the exterior of the building. (several miles away from where yous started)
5) The doors of the second copy of the airlock open, and your avatar walks out. You are now standing outside on a rotating building.
Image
Live KI: 34914 MOULa KI: 23247 Gehn KI: 11588 Available Ages: TunnelDemo3, BoxAge, Odema
Nadnerb
 
Posts: 1057
Joined: Fri Sep 28, 2007 8:01 pm
Location: US (Eastern Time)

Re: Using Different PRP's

Postby Grogyan » Fri Feb 29, 2008 6:33 pm

Nadnerb wrote:3) Then it inserts you into a subworld, which contains the rotating portion of the building. When you are in a subworld, the game is pretending that you are moving relative to the rest of the world, while you're "really" standing in one spot, watching the rest of the world move around you.


This true for "The Well" and the top section of the building which is entered from the, Prison?

However when you on the outside, with the Training Centre and The Well rotating buildings, this too is a sub-world, and when on the ramp of the TC or on the roof of The Well you are in fact moving with the object in full 3D space.

If not then you have in this scene 3 sub world objects, the Scenery, The Well rooftop and the TC, and what you would be suggesting is that the avatar is standing still and all 3 objects are rotating in their own circles orbiting the avatar.
Forgive my ignorance, but that doesn't sound efficient at all, and would surely confuse Cyan more than us, but it is plausable, as is the earth and moon orbiting and circling and orbiting the sun while we observe that we stand till and everything else is moving, which was the general understanding since before the the 1950's.

If the avatar is indeed a non moving object, despite what the animations say then its the regions intersecting the avatar, not the avatar intersecting the regions.
Better to have loved and lost than never to have loved at all
User avatar
Grogyan
 
Posts: 1203
Joined: Thu Oct 11, 2007 1:27 am

Re: Using Different PRP's

Postby Paradox » Fri Feb 29, 2008 8:17 pm

Subworlds are a hack designed to prevent the avatar from picking up angular momentum from a rotation. Using subworlds, the avatar is considered to be "standin still", so no momentum is gained.
Paradox
 
Posts: 1295
Joined: Fri Sep 28, 2007 6:48 pm
Location: Canada

Re: Using Different PRP's

Postby Nadnerb » Fri Feb 29, 2008 8:37 pm

Grog: If you don't believe me and Paradox (or even if you do, this is a cool effect ;)) then try using flymode while standing on top of one of the rotating buildings. when you move off of the roof of the building, because physics, and therefore detectors, have been disabled, the game will never remove you from the subworld and everything will continue rotating around you, even after restoring normal physics.

Oh, and while you're at it, fly downward for a few minutes until you reach the interior of the large building. ;)
Image
Live KI: 34914 MOULa KI: 23247 Gehn KI: 11588 Available Ages: TunnelDemo3, BoxAge, Odema
Nadnerb
 
Posts: 1057
Joined: Fri Sep 28, 2007 8:01 pm
Location: US (Eastern Time)

Next

Return to Building

Who is online

Users browsing this forum: No registered users and 1 guest

cron