Privateer GG talking heads

Forum for discussing various mods for the VS-engine based upon Privateer. (Please play nice now, and extinguish all flaming materials.
Sincerely, The Management)

Re: Privateer GG talking heads

Postby log0 » Sat Dec 22, 2012 3:25 pm

Updated more complete version. There are a few bits that could be enhanced, like the inheritance relations(comp, launcher and co derived from link).
Attachments
vspython.txt
(7.39 KiB) Downloaded 66 times
log0
 

Share On:

Share on Facebook Facebook Share on Twitter Twitter Share on Digg Digg

Re: Privateer GG talking heads

Postby Herr_Koos » Sun Dec 23, 2012 11:17 am

That will help quite a bit, thanks. Question: Does Base.Video work in the VS of 1.03 stable or was it only added later?
Herr_Koos
Trader
Trader
 
Posts: 31
Topics: 1
Joined: Wed Dec 12, 2012 3:43 am

Re: Privateer GG talking heads

Postby Herr_Koos » Sun Dec 23, 2012 11:19 am

And then another thing:

# Add a script object
# Script is executed until object is erased
# room: room id (int)
# index: script id (string)
# pythonfile: script string / filename (string)
# time: delay till/between script execution (float)
Base.RunScript(room, index, pythonfile, time)

What is the purpose of the index/script id argument?
Herr_Koos
Trader
Trader
 
Posts: 31
Topics: 1
Joined: Wed Dec 12, 2012 3:43 am

Re: Privateer GG talking heads

Postby klauss » Sun Dec 23, 2012 12:13 pm

Herr_Koos wrote:# Add a script object
# Script is executed until object is erased
# room: room id (int)
# index: script id (string)
# pythonfile: script string / filename (string)
# time: delay till/between script execution (float)
Base.RunScript(room, index, pythonfile, time)

What is the purpose of the index/script id argument?


It's an identifier you have to use when erasing or modifying an element.

Herr_Koos wrote:That will help quite a bit, thanks. Question: Does Base.Video work in the VS of 1.03 stable or was it only added later?


I believe it should, though I could remember wrong.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
User avatar
klauss
Elite
Elite
 
Posts: 7243
Topics: 55
Joined: Mon Apr 18, 2005 7:40 am
Location: LS87, Buenos Aires, República Argentina

Re: Privateer GG talking heads

Postby log0 » Sun Dec 23, 2012 12:31 pm

Herr_Koos wrote:And then another thing:

# Add a script object
# Script is executed until object is erased
# room: room id (int)
# index: script id (string)
# pythonfile: script string / filename (string)
# time: delay till/between script execution (float)
Base.RunScript(room, index, pythonfile, time)

What is the purpose of the index/script id argument?

The id is a way to identify/reference an object after its creation.

Simple example:
# Add a texture. Change texture position.
roomid = Base.GetCurRoom()
Base.Texture(roomid, "mypic", "../somepic.texture", 0.0f, 0.0f)
Base.SetTexturePos(roomid, "mypic", 0.5f, 0.0f)

Other example:
# Add a script object that will execute a script every 2 seconds. Erase it after first run.
roomid = Base.GetCurRoom()
scriptid = "myscript"
script = "#\nimport Base\nprint 'bla'\nBase.EraseObj(%(rid)d, %(sid)s)" % {'rid' : roomid, 'sid' : scriptid}
time = 2.0f
Base.RunScript(roomid, scriptid, script, time)
log0
 


Previous

Return to Privateer Universe

Who is online

Users browsing this forum: No registered users and 1 guest

cron