Guest Dakati Posted October 18, 2009 Report Share Posted October 18, 2009 Hi.I made a script for the LA Mod, so i can manualy control some Trafficlights.This is the scriptconst char CMD_PUTRED[] = "OcmdPutRed";const char CMD_PUTAUTO[] = "OcmdPutAuto";object OcmdPutRed : CommandScript{ OcmdPutRed() { SetIcon("lighton"); SetCursor("lighton"); SetRestrictions(RESTRICT_SELFEXECUTE); SetPriority(50); } bool CheckGroupVisibility(GameObject *Caller) { if(!Caller->IsValid() || Caller->GetType() != ACTOR_OBJECT) return false; Object o(Caller); return !o.IsLightOn(); } void PushActions(GameObject *Caller, Actor *Target, int childID) { Object o(Caller); o.TrafficLightType(TLT_RED); o.AssignCommand(CMD_PUTAUTO); o.RemoveCommand(CMD_PUTRED); }};object PutAuto : CommandScript{ OcmdPutAuto() { SetIcon("lightoff"); SetCursor("lightoff"); SetRestrictions(RESTRICT_SELFEXECUTE); SetPriority(49); } bool CheckGroupVisibility(GameObject *Caller) { if(!Caller->IsValid() || Caller->GetType() != ACTOR_OBJECT) return false; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { Object o(Caller); o.TrafficLightType(TLT_NONE); o.AssignCommand(CMD_PUTRED); o.RemoveCommand(CMD_PUTAUTO); }};If I load the LA Mod, I have a CTD.Thats only happening with the LA Mod, and if i have that script in the commands folder.Any sugestions?Btw, I think you already saw, im a noob scripter. Nvm Quote Link to comment Share on other sites More sharing options...
randomperson139 Posted October 18, 2009 Report Share Posted October 18, 2009 Why is it Ocmd? Quote Link to comment Share on other sites More sharing options...
Guest Dakati Posted October 18, 2009 Report Share Posted October 18, 2009 Object Command.I First wanted to add the command to the trafficlight itself, but that dont work.Does anybody know, how to put a Trafficlight at Red from an other Object, eg. a Switch box Quote Link to comment Share on other sites More sharing options...
Guest Dakati Posted October 18, 2009 Report Share Posted October 18, 2009 I have changed the script a bit, but it still dont work:const char CMD_PUTRED[] = "OcmdPutRed";const char CMD_PUTAUTO[] = "OcmdPutAuto";object OcmdPutRed : CommandScript{ OcmdPutRed() { SetIcon("lighton"); SetCursor("lighton"); SetRestrictions(RESTRICT_SELFEXECUTE); SetPriority(50); } bool CheckGroupVisibility(GameObject *Caller) { if(!Caller->IsValid() || Caller->GetType() != ACTOR_OBJECT) { return false; } else { return true; } } void PushActions(GameObject *Caller, Actor *Target, int childID) { Object o(Caller); o.TrafficLightType(TLT_RED); o.AssignCommand(CMD_PUTAUTO); o.RemoveCommand(CMD_PUTRED); }};object PutAuto : CommandScript{ OcmdPutAuto() { SetIcon("lightoff"); SetCursor("lightoff"); SetRestrictions(RESTRICT_SELFEXECUTE); SetPriority(49); } bool CheckGroupVisibility(GameObject *Caller) { if(!Caller->IsValid() || Caller->GetType() != ACTOR_OBJECT) { return false; } else { return true; } } void PushActions(GameObject *Caller, Actor *Target, int childID) { Object o(Caller); o.TrafficLightType(TLT_NONE); o.AssignCommand(CMD_PUTRED); o.RemoveCommand(CMD_PUTAUTO); }};The strange is, id ont get a script error! Quote Link to comment Share on other sites More sharing options...
LACityFFengineCo287 Posted October 20, 2009 Report Share Posted October 20, 2009 I have changed the script a bit, but it still dont work:const char CMD_PUTRED[] = "OcmdPutRed";const char CMD_PUTAUTO[] = "OcmdPutAuto";object OcmdPutRed : CommandScript{ OcmdPutRed() { SetIcon("lighton"); SetCursor("lighton"); SetRestrictions(RESTRICT_SELFEXECUTE); SetPriority(50); } bool CheckGroupVisibility(GameObject *Caller) { if(!Caller->IsValid() || Caller->GetType() != ACTOR_OBJECT) { return false; } else { return true; } } void PushActions(GameObject *Caller, Actor *Target, int childID) { Object o(Caller); o.TrafficLightType(TLT_RED); o.AssignCommand(CMD_PUTAUTO); o.RemoveCommand(CMD_PUTRED); }};object PutAuto : CommandScript{ OcmdPutAuto() { SetIcon("lightoff"); SetCursor("lightoff"); SetRestrictions(RESTRICT_SELFEXECUTE); SetPriority(49); } bool CheckGroupVisibility(GameObject *Caller) { if(!Caller->IsValid() || Caller->GetType() != ACTOR_OBJECT) { return false; } else { return true; } } void PushActions(GameObject *Caller, Actor *Target, int childID) { Object o(Caller); o.TrafficLightType(TLT_NONE); o.AssignCommand(CMD_PUTRED); o.RemoveCommand(CMD_PUTAUTO); }};The strange is, id ont get a script error!Could it be another file in the game is messed up? It looks like a cool script, but, i'm not sure so i'm not going to try it. lol. Hope you can fix it ^^ Quote Link to comment Share on other sites More sharing options...
bennie900 Posted October 20, 2009 Report Share Posted October 20, 2009 Whats the error that comes up on screen? Quote Link to comment Share on other sites More sharing options...