Python in the shells?

A community Age for Uru.

Moderator: Aloys

Tsar Hoikas
Councilor of Technical Direction
Posts: 2180
Joined: Fri Nov 16, 2007 9:45 pm
MOULa KI#: 23335
Location: South Georgia
Contact:

Post by Tsar Hoikas »

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
User avatar
Robert The Rebuilder
Posts: 1383
Joined: Sat Sep 29, 2007 7:24 am
MOULa KI#: 1299
Location: Virginia, US

Post by Robert The Rebuilder »

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!
Tsar Hoikas
Councilor of Technical Direction
Posts: 2180
Joined: Fri Nov 16, 2007 9:45 pm
MOULa KI#: 23335
Location: South Georgia
Contact:

Post by Tsar Hoikas »

Oh sorry ;)
Image
User avatar
Robert The Rebuilder
Posts: 1383
Joined: Sat Sep 29, 2007 7:24 am
MOULa KI#: 1299
Location: Virginia, US

Post by Robert The Rebuilder »

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!
Tsar Hoikas
Councilor of Technical Direction
Posts: 2180
Joined: Fri Nov 16, 2007 9:45 pm
MOULa KI#: 23335
Location: South Georgia
Contact:

Post by Tsar Hoikas »

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
Locked

Return to “Ahra Pahts”