Writing Ages for Shards

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!

Re: Writing Ages for Shards

Postby diafero » Mon Jul 20, 2015 3:58 am

The Max plugin (I think) superficially scans the beginning of the Python file for the attribute declarations. So to make it show up there, one would have to make them look exactly like the declarations in Cyan's files.
I prefer e-mails to "diafero arcor de" (after adding the at and the dot) over PMs.

"Many people's horizon is a circle with a radius of zero. They call it their point of view."

Deep Island Shard | Offline KI
diafero
Deep Island Admin
 
Posts: 2966
Joined: Mon May 05, 2008 5:50 am
Location: Germany

Re: Writing Ages for Shards

Postby Sirius » Mon Jul 20, 2015 5:46 am

Yup, it's right there in the beginning of the file.
Sirius wrote:# things that will show up in Max
activator = ptAttribActivator(1, "Activator: Clickable or trigger region")
spawnPoint = ptAttribSceneobject(2, "Spawn point to fakelink to", "")

ptAttribSomething tells Max it should look for an object, or an activator, etc. This is what tells it to create drop down boxes or input fields. Then these objects are reused from within the script, under the names "activator" and "spawnPoint".

Edit: By the way, Python scripts are the same for both Blender and Max, since Blender doesn't even scan the Python itself (at least, not in ol' PyPRP). The only way a "valid" script wouldn't be "valid" in Max is because it would miss a unique id (for instance, "self.id = 46343")
User avatar
Sirius
 
Posts: 1506
Joined: Mon Jul 26, 2010 4:46 am
Location: France

Re: Writing Ages for Shards

Postby Tsar Hoikas » Mon Jul 20, 2015 12:43 pm

The max plugin actually loads the file and fetches the attributes using the infamous glue. The `self.id` is added to a lookup table, so it needs to be unique. Korman can't load the file because of the 2/3 version mismatch. However, we do scan for lines containing attributes and visit them using some AST magic. Then they're converted into node sockets. PyPRP does none of this.

Non-tech: if the script doesn't look like what Sirius provided, it ain't gonna work.
Image
Tsar Hoikas
Councilor of Technical Direction
 
Posts: 2180
Joined: Fri Nov 16, 2007 9:45 pm
Location: South Georgia

Re: Writing Ages for Shards

Postby Karkadann » Sat Jul 25, 2015 12:54 pm

Sirius wrote:I assume the link is done automatically on entering a region or clicking something ? (not a book, I mean)
Then you could try using this script:
Show Spoiler

Don't forget to add the Python glue at the end of the file, and it should work in Max. I didn't test the script, though. Hopefully it will work without problem... :P


It works great thank you, I also learned Python is case sensitive after about an hour of messing around :lol: and since its not in drizzle I had to add it to Uru manually :)
challenging educational but most of all fun, all I gotta do now is add some spit and polish to my project and figure out the details concerning the how to maintain the larger on the inside illusion

I couldn't figure out how the do the camera region as good as I would have liked, however I did figure out how to keep the screen dark long enough to hide the AV moving from place to place.
Although I wonder..............are there any variables that would change the time it takes to go from place to place, pc or server related?
The Optimist see's the glass half full, The Pessimist see's the glass half empty.
Its the Realist who see's the glass is half full with air, half full with water
User avatar
Karkadann
 
Posts: 1223
Joined: Sun Aug 02, 2009 10:04 am
Location: Earth

Re: Writing Ages for Shards

Postby Sirius » Sun Jul 26, 2015 7:13 am

Ah, so it's for a bigger-on-the-inside illusion ? Then you don't need to bother with fakelink: you can just warp the avatar without any linking sound or black screen effect, just like the doors to the main building in Gahreesen. Since it doesn't play any sound, it will be more immersive as the transition will be harder to notice ;)

About the camera: I just had an idea for a workaround, but it's quite hacky. I would recommend trying to find out how to setup a camera region with "cut position" and "cut point-on-avatar" attributes, as it's the "proper" way to do things.
You'll notice Max will show an option in the script's parameters to toggle the camera hack on or off. If you find out how to setup the camera region, set it to false, otherwise leave it at true.

Show Spoiler

Put that in a xSimpleWarp.py script, don't forget to deindent (shift-tab) the code, put the glue, blah, blah blah. Hopefully this will work.

Anyway, good job getting the previous script working ! 8-) Normally this one should prove as simple to use.
User avatar
Sirius
 
Posts: 1506
Joined: Mon Jul 26, 2010 4:46 am
Location: France

Re: Writing Ages for Shards

Postby Karkadann » Sun Aug 02, 2015 10:38 am

The xSimplewarp worked out great Thanks, I also got the Camara regions working however I cant see any difference with the camera hack being on or off.
now im gonna try a bit of experimenting with the xSimplePanel with some symbols that already exist in the age, make it a bit of a challenge getting in.
I noticed its easier then it looks just very repetitious or at least that's the impression im getting so far
The Optimist see's the glass half full, The Pessimist see's the glass half empty.
Its the Realist who see's the glass is half full with air, half full with water
User avatar
Karkadann
 
Posts: 1223
Joined: Sun Aug 02, 2009 10:04 am
Location: Earth

Re: Writing Ages for Shards

Postby Karkadann » Tue Aug 11, 2015 8:59 am

About the xSimplePanel I got everything figured out except the sdl file, Is their a way to set up the panel so a you enter a correct combination press an enterkey and activate the xSimpleWarp.py?
also not being a coder I was wondering if i could get a more detailed explanation of the sdl file needed so I can try to write one for this task

Thanks in advance
The Optimist see's the glass half full, The Pessimist see's the glass half empty.
Its the Realist who see's the glass is half full with air, half full with water
User avatar
Karkadann
 
Posts: 1223
Joined: Sun Aug 02, 2009 10:04 am
Location: Earth

Re: Writing Ages for Shards

Postby Sirius » Wed Aug 12, 2015 1:48 pm

From what I understand from the xSimplePanel code, I think this is the SDL you should have:
Code: Select all
STATEDESC YourAgeNameHere
{
    VERSION 1
   
    VAR INT     panelButtonsPressed[1] DEFAULT=0
    VAR BOOL    panelSolved[1] DEFAULT=0
}
... with "panelButtonsPressed" and "panelSolved" the SDL names you give to the Python file.

About how to use SDL files: usually it's not easy to know how to set it up without having a look at how the Python script works. But usually you should be able to guess this way:
You always need the STATEDESC and VERSION things. Usually, whenever you modify the SDL, you increase the number next to VERSION.
Then you need to write the variables the Python script needs in the following way:
Code: Select all
VAR <type> <name of variable>[<number of elements>] DEFAULT=<default number>
<Name of variable> is obviously the name you enter in the Python's script parameters.
<Default number> is the default value used when the element has never been interacted with. Usually 0=off, 1=on.
<Type> is what the variable should store. If it's an on-off value, you should use BOOL, if it's a small number (between 0 and 255 I believe), you use BYTE, if it's a bigger number, you use INT, and lastly if it's a text message of some kind, you use STRING32. These are the most commonly used values. Also, an INT can replace a BOOL or BYTE value, it's just bigger but works the same. So if you really have no idea what the type is, use INT.
<Number of elements> determine how many values of type <Type> should be stored. You must always set it to 1, except in a very few, rare, cases.
If you don't know which type to use for your SDL variables, the best way is to have a look in existing Age files using the same script.

As for linking this script to xSimpleWarp: do you mean the panel should enable a button which would warp the avatar when clicked ? Or maybe teleport the avatar as soon as the panel is solved ?
In any case, you want to use a third Python script to retrieve the event of the panel being solved, in order to enable or disable physics for the button or region warping the player. It shouldn't be very tricky to setup, the script already exists. It's xAgeSDLBoolRespond.
I never used it, but it should work as follow: the script monitors a SDL variable (panelSolved), if the variable is set to FALSE (not solved), it runs a responder which disables the clickable or region. If it's set to TRUE (solved), it runs another responder which enable the clickable or region.
The script has four other parameters, just leave them at their default value.

I hope this helps you :)
User avatar
Sirius
 
Posts: 1506
Joined: Mon Jul 26, 2010 4:46 am
Location: France

Re: Writing Ages for Shards

Postby Karkadann » Thu Sep 17, 2015 11:17 am

almost finished, although its still in three pieces,
Show Spoiler
not counting the Stonehenge.
Ive just got a few more details to finish and some spare time coming up to finish them, although with all these
wonderful new ages coming out I hope it does not get lost in the shuffle,
luckly I did leave plenty of room for expansion. something I learned from wondering threw Cyan ages,
they always seem to leave someplace you want to go but can't just in case they want to add to it latter on.

I still might need someone to go threw it before I send it into the Drizzle servers.
its got a few new odds and ends and I wanna make sure it doesn't screw any thing up.

then I'll start as new thread for this as requested in the next post
Last edited by Karkadann on Thu Nov 05, 2015 1:48 pm, edited 1 time in total.
The Optimist see's the glass half full, The Pessimist see's the glass half empty.
Its the Realist who see's the glass is half full with air, half full with water
User avatar
Karkadann
 
Posts: 1223
Joined: Sun Aug 02, 2009 10:04 am
Location: Earth

Re: Writing Ages for Shards

Postby diafero » Wed Sep 30, 2015 11:19 am

Please keep this thread on topic - age building progress is interesting, but it belongs elsewhere :)
I prefer e-mails to "diafero arcor de" (after adding the at and the dot) over PMs.

"Many people's horizon is a circle with a radius of zero. They call it their point of view."

Deep Island Shard | Offline KI
diafero
Deep Island Admin
 
Posts: 2966
Joined: Mon May 05, 2008 5:50 am
Location: Germany

Previous

Return to Building

Who is online

Users browsing this forum: No registered users and 0 guests

cron