I have this cog,
And I want it to use a random saber color when it is created, any ideas on how to make it work?
I know about adding all the stuff to the symbols section, but I can't figure out how to make it random...
------------------
Look for my current project, The Force in Your Soul.
Last week I cudn't evn spel grajuat, but now I is one.
*Takes out his blaster and fires shots at the wall, the blastmarks leave the words "S-TROOPER WUZ 'ERE!!!"
Code:
# Jedi Knight Cog Script # # ACTOR_JEDI.COG # # JEDI Script - Actor Version, No Force # # [ST] # # NOT SUPPORTED BY LucasArts Entertainment Co. symbols message damaged message killed message created message skill thing darkjedi mask=0xfff local flex damage local int damageType local material tip_mat=saberblue0.mat local material side_mat=saberblue1.mat local template tpl_wall=+ssparks_wall local template tpl_blood=+ssparks_blood local template tpl_saber=+ssparks_saber local int victim local end # ======================================================================================== code created: darkjedi = GetSenderRef(); Print("test"); jkSetPersuasionInfo(darkjedi, 8, 16); //copied from newplayer message jkSetSaberInfo(darkjedi, side_mat, tip_mat, 0.003, 0.001, 0.100, tpl_wall, tpl_blood, tpl_saber); jkSetFlags(darkjedi, 0x5); //copied from newplayer message return; # ........................................................................................ killed: darkjedi = GetSenderRef(); ClearActorFlags(darkjedi, 0x80); jkClearFlags(darkjedi, 0x20); SetThingCurGeoMode(darkjedi, GetThingGeoMode(darkjedi)); jkSetFlags(darkjedi, 0x8); Return; # ........................................................................................ damaged: darkjedi = GetSenderRef(); damage = GetParam(0); damageType = GetParam(1); if(damageType & 1) // IMPACT damage = damage / 2; else if(damageType & 2) // ENERGY damage = damage / 2; else if(damageType & 4) // FIRE damage = damage / 10; else if(damageType & 8) // FORCE damage = damage; else if(damageType & 16) // SABER damage = damage; ReturnEx(damage); Return; # ........................................................................................ skill: bin = GetParam(0); if(bin = 24) // Force Pull { ReturnEx(-1); Return; } ReturnEx(-1); Return; end
And I want it to use a random saber color when it is created, any ideas on how to make it work?
I know about adding all the stuff to the symbols section, but I can't figure out how to make it random...
------------------
Look for my current project, The Force in Your Soul.
Last week I cudn't evn spel grajuat, but now I is one.
*Takes out his blaster and fires shots at the wall, the blastmarks leave the words "S-TROOPER WUZ 'ERE!!!"