Code Problem
Posted: Thu Feb 23, 2012 7:05 am
I am making an age called Skartov, and in it I have a sphere that is supposed to link to Relto. I know that the AlcScript is correct, but I do not know if the python is correct. It is a file called Skartov_IcoLink1.py in Skartov.pak:
- Code: Select all
from Plasma import *
from PlasmaTypes import *
from PlasmaNetConstants import *
actClickableObject = ptAttribActivator(1, 'Clickable object activator')
strObject = ptAttribString(2, 'Object string')
class Skartov_IcoLink1(ptModifier,):
def OnNotify(self, state, id, events):
if ((id == actClickableObject.id) and state):
print ('Object %s was clicked' % strObject.value)
#place your code here
agelink = ptAgeLinkStruct()
ageinfo = ptAgeInfoStruct()
ageinfo.setAgeFilename("Payiferen")
spawnpoint = ptSpawnPointInfo("Name","LinkInPointDefault")
agelink.setAgeInfo(ageinfo)
agelink.setLinkingRules(PtLinkingRules.kOriginalBook)
agelink.setSpawnPoint(spawnpoint)
linkmanager = ptNetLinkingMgr()
linkmanager.linkToAge(agelink)