mirror of
https://bitbucket.org/seefoe/dsrc.git
synced 2026-07-31 01:15:55 -04:00
44 lines
919 B
Plaintext
44 lines
919 B
Plaintext
/* Title: systems.beast.cs_dna.script
|
|
*/
|
|
|
|
|
|
|
|
//Script on Enzymes
|
|
include library.incubator
|
|
include library.utils;
|
|
|
|
|
|
|
|
trigger OnAttach()
|
|
{
|
|
messageTo(self, "handleInitializeValues", null, 1, false);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnInitialize()
|
|
{
|
|
messageTo(self, "handleInitializeValues", null, 1, false);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
messageHandler handleInitializeValues ()
|
|
{
|
|
if(hasObjVar(self, incubator.DNA_TEMPLATE_OBJVAR))
|
|
{
|
|
string template = getStringObjVar(self, incubator.DNA_TEMPLATE_OBJVAR);
|
|
if(template != null && !template.equals(""))
|
|
{
|
|
removeObjVar(self, incubator.DNA_TEMPLATE_OBJVAR);
|
|
|
|
int crcTemplate = incubator.convertStringTemplateToCrC(template);
|
|
if(crcTemplate != 0)
|
|
{
|
|
setObjVar(self, incubator.DNA_TEMPLATE_OBJVAR, crcTemplate);
|
|
attachScript(self, "systems.beast.dna");
|
|
detachScript(self, "systems.beast.cs_dna");
|
|
}
|
|
}
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|