Lost with Python

Help bring our custom Ages to life! Share tips and tricks, as well as code samples with other developers.

Re: Lost with Python

Postby D'Lanor » Wed May 07, 2008 12:31 am

Grogyan wrote:Oh and when you figured it out, can ya let the rest of us know what the end script was as I too have to have clickable crystals, but not directly, so a a question would be, is it possible to attach a clickable script to an invisible collision or invisible mesh?

Can't say I ever tried that. You can always make "normal" objects invisible by giving them a fully transparent texture.

But how would the player know there was a clickable? I believe that is called pixel hunting in adventure games, a practise that is generally looked down upon.
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: Lost with Python

Postby Nadnerb » Wed May 07, 2008 12:44 am

They wouldn't be truly invisible, because in the case of incorrect Z-Sorting, they would "x-ray" other objects. I think that setting the object type to "region" or something like that will stop it from exporting a drawable at all, and just leave the physical. (which is the only thing necessary for a clickable)
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: Lost with Python

Postby Trylon » Wed May 07, 2008 1:47 am

actually, you should use "collider" and not "region".
One day I ran through the cleft for the fiftieth time, and found that uru held no peace for me anymore.
User avatar
Trylon
 
Posts: 1446
Joined: Fri Sep 28, 2007 11:08 pm
Location: Gone from Uru

Re: Lost with Python

Postby Valdez » Wed May 07, 2008 5:56 pm

Hello everyone, well, Python has once again stumped me with its dirty charms. :cry: I have made a journal with D'Lanor's template and it is finished. Only when I pack it with URUPython (the latest version) It gives me errors. Whilyam has helped me get two of the files to work. One still doesn't: the PageDefs file. I keep getting an error with the BookPages entry. This is the error message i get when it tries to compile and pack:

Out file not created
File "E:/Program Files/Blender Foundation/Blender/.blender/Blender Scripts/TINA_Testing/TINA_TestingPageDefs.py", line 58
BookPages = {'<TINA_Testing>Journal': ((Def<TINA_Testing>Journal))}
^
SyntaxError: invalid syntax

Whilyam has done everything he could to help me, but now I must turn to you guys. This is the coding for my ENTIRE Python FIle:

Code: Select all
# For each occurance of *YourAge* and *YourTexture* you have to replace this with
# the actual name of your age and your textures.

from Plasma import *
from PlasmaNetConstants import *
# Due to their length journal texts are usually stored in external Python files.
# The line below imports them. Remove this line if you do not use external journals.
from TINA_Testing_Journals import *

# Variables that can be used in BookPages:
PageStart = '<pb>'
ImgStart = '<img src="'
TransImgStart = '<img opacity=0.7 src="'
ImgEnd = '" align=center link=%d blend=alpha>'
ImgEndNoLink = '" align=center blend=alpha>'
AlignCenter = '<p align=center>'
AlignLeft = '<p align=left>'
AlignRight = '<p align=right>'
# Retrieve local player name in case you want to fake a "personal" note
plyrName = PtGetLocalPlayer().getPlayerName()

###############################################################################
# AgeBooks Dictionary Section:                                                #
# 1 =    same names as the clickable book objects!                            #
# 2 =    book cover and margin                                                #
# 3 =    main font                                                            #
# 4 =    start book open or closed. 0 closed book, 1 open book                #
# 5 =    force owned setting. 0 off, 1 on                                     #
# 6 =    book GUI. 'BkBook' or 'bkNotebook'                                   #
# 7 =    width                                                                #
# 8 -    height                                                               #
#                                                                             #
# Notes: - The cover can have the same texture as the book object itself.     #
#        - The main font can be changed later in the BookPages definition.    #
#          If you don't need a main font (because you are changing it later), #
#          you can set an empty string.                                       #
#        - force owned: If set to 1 the code checks if the original book has  #
#          been found. A player who does not own the age will not see the     #
#          linking panel. If you need this restriction set force owned to 1.  #
#        - the 'bkBahroRockBook' GUI should work as well but it may not be a  #
#          good idea to use it with this multi-page template.                 #
###############################################################################

AgeBooks = {'good_journal': ('<cover src="ValJournal"><margin right=32 left=32>', '<font size=12 face=Arial color=000000>', 0, 0, 'BkBook', 0.8, 1.0)

###############################################################################################
# BookPages Dictionary Section:                                                               #
# 1 =    Same names as link destinations!                                                     #
# 2 =    The page layout: for linking books insert the name of your linking panel image here. #
#        This can be a seperate texture in your age prp file on a hidden Blender object.      #
#        (or use PRP Explorer to add a plain texture to the prp without modeling an object)   #
#        Once you get the hang of this you can mix and match layouts into your pages.         #
#                                                                                             #
# Notes: - AlignCenter is used to center text, for example to place below a linking panel.    #
#        - Use ImgEndNoLink to add images without a hotspot.                                  #
###############################################################################################

BookPages = {'<TINA_Testing>Journal':  ((Def<TINA_Testing>Journal))}


###############################################################################
# LinkDestinations Dictionary Section:                                        #
# 1 =    Same names as book pages!                                            #
# 2 =    age name                                                             #
# 3 =    spawnpoint                                                           #
# 4 =    spawnpoint title                                                     #
# 5 =    linkingrule                                                          #
#                                                                             #
# Notes: - Variables for journals are dummies and must be set to None.        #
#        - Spawnpoint title None is only allowed for LinkInPointDefault       #
#          (although it would be better to set it to 'Default')               #
#          CleftFissureDrop in this example will fail due to a missing title  #
#          (the correct title is 'FissureDrop')                               #
#        - You can tie special actions to linking panels or other journal     #
#          images by defining only the age name. The other definitions must   #
#          be set to None (see 'CleftSpecial')                                #
###############################################################################

LinkDestinations = {'<TINA_Testing>Journal': (None, None, None, None)}


Any suggestions? If you need anymore info I can try to get it to you.

Thanks,

Valdez :geek:
Fighting, Horrible disposition to others based on beliefs... What's the point anymore? Was there ever a point? Dead is what it is and always will be until peace is achieved through everyone.
User avatar
Valdez
 
Posts: 106
Joined: Fri Jan 04, 2008 4:44 pm

Re: Lost with Python

Postby Nadnerb » Wed May 07, 2008 6:37 pm

You appear to be using operators (">" and "<") in a variable name. ("Def<TINA_Testing>Journal") Try something like: "DefTINA_TestingJournal".
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: Lost with Python

Postby Grogyan » Wed May 07, 2008 10:45 pm

Nadnerb wrote:You appear to be using operators (">" and "<") in a variable name. ("Def<TINA_Testing>Journal") Try something like: "DefTINA_TestingJournal".



I was about to say the same thing
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: Lost with Python

Postby Grogyan » Wed May 07, 2008 10:53 pm

Well after I have finished my shell of, I might leave it there for released level building, mainly due to the use of python, no matter how I try it annoys me to try in vain, yet I know that a lot of applications use python over other scripting languages.

It pains me to say that, but that is indeed the truth of how I see it.

A scripting language should be simple and flexible, which AlcScript does, but apparently not enough when it comes to Uru.


I'll keep tryin
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: Lost with Python

Postby Chacal » Thu May 08, 2008 10:15 am

Or maybe you could deliver the unwired Age to someone willing to do the python work.
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: Lost with Python

Postby Grogyan » Thu May 08, 2008 11:05 am

Chacal wrote:Or maybe you could deliver the unwired Age to someone willing to do the python work.


I've had to do that. I have Lonatahv that will help me soon, as I prepare my shell to the level that gives him the best idea of what i'm trying to achieve.
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: Lost with Python

Postby D'Lanor » Sat May 10, 2008 6:37 am

Nadnerb wrote:This has come up every time someone has tried to use the simpleclick quickscript, and almost every time it has resulted in them setting up the full logic mod manually. Is this not a good indicator that the quickscript should be set up to not require a python file? :? (The real question: is anyone actually using the quickscript in it's current form that would object to it's being changed?)

Nadnerb, could you review my SVN contrib (revision 156)? I have implemented this in a way that leaves current alcscripts functional. So there is really nothing to object to. ;)

Description:
  1. Simpleclick no longer requires pythonfile so that sound and avatar animation can be used independently.
  2. Option autorun added so that avatar animation can bypass behavior pythonfilemod. If there is no pythonfile autorun is forced to true. If a pythonfile is specified autorun defaults to false (important: this avoids breaking of old alcscripts) but it can be set to true.
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

PreviousNext

Return to Scripting

Who is online

Users browsing this forum: Google [Bot] and 1 guest