Python in the shells?

A community Age for Uru.

Moderator: Aloys

Postby Tsar Hoikas » Wed May 24, 2006 9:48 pm

about the variables, the same thing. just have all the variables start with shell# and then the variable name. shell#[varname] like that. unsure.gif


Nope if you read that above. You cannot have vars like that in python.
Image
Tsar Hoikas
Councilor of Technical Direction
 
Posts: 2180
Joined: Fri Nov 16, 2007 9:45 pm
Location: South Georgia

Postby Robert The Rebuilder » Thu May 25, 2006 10:28 am

Looks like everyone is agreeing on the same thing.

Adam: you're right - Python variables cannot start with a number. And Zib realizes this as well. His notation "shell#[varname]" would translate to (e.g. for shell 132 and original variable named AvatarKey) "shell132AvatarKey", which is still valid.

Perhaps we can use a shorthand for the prefix: s# (e.g. s132AvatarKey (for a variable), s132MyScript.py (for Python scripts)?
Can we rebuild it? Yes, we can - here's how.

MOULagain KI# 1299

Myst Movie coming soon - spread the word!
User avatar
Robert The Rebuilder
 
Posts: 1383
Joined: Sat Sep 29, 2007 7:24 am
Location: Virginia, US

Postby Tsar Hoikas » Thu May 25, 2006 11:55 am

Oh sorry ;)
Image
Tsar Hoikas
Councilor of Technical Direction
 
Posts: 2180
Joined: Fri Nov 16, 2007 9:45 pm
Location: South Georgia

Postby Robert The Rebuilder » Wed May 31, 2006 6:47 am

I've noticed that, in the age scripts, each ptModifier/ptResponder subclass assigns itself a unique ID in the __init__() method. This begs the question: how do we guarantee a unique ID for each script... in each shell... in each age?

One suggestion is to combine the age sequence prefix and the shell number, and also allow for up to 10 scripts per shell. So, the proposed ID would have the form:

AAASSSX

where AAA is the age sequence prefix (i.e. 189), SSS is the shell number, and X is the script number. For example, if you were writing 3 scripts for shell number 121, the self.id values for each script would be:

1891210
1891211
1891212

This should steer clear of the IDs for each of the Cyan ages; they tend to be under 6000.
Can we rebuild it? Yes, we can - here's how.

MOULagain KI# 1299

Myst Movie coming soon - spread the word!
User avatar
Robert The Rebuilder
 
Posts: 1383
Joined: Sat Sep 29, 2007 7:24 am
Location: Virginia, US

Postby Tsar Hoikas » Wed May 31, 2006 10:18 am

QUOTE ("Robert")

This should steer clear of the IDs for each of the Cyan ages; they tend to be under 6000.
[/quote]

The go into the 7,000 in PotS and since Volcano uses PotS clients....

But I don't think that your id convention will cause any problems there. Perhaps a modified id-convention should be posted on the alcugs (Not AB) wiki and only scripts that conform to that model be allowed on UAM.
Image
Tsar Hoikas
Councilor of Technical Direction
 
Posts: 2180
Joined: Fri Nov 16, 2007 9:45 pm
Location: South Georgia

Previous

Return to Ahra Pahts

Who is online

Users browsing this forum: No registered users and 0 guests

cron