Guest Overland Posted August 22, 2009 Report Share Posted August 22, 2009 Hello guys. I am looking the ability to turn traffic lights on/off by simply clicking on them. I am going to go about this by creating a command: /Scripts/Game/Command. My question is firstly, is there a tutorial on this subject? (not found using the search function). And has anyone seen this done before?Thanks, Overland Quote Link to comment Share on other sites More sharing options...
Hoppah Posted August 22, 2009 Report Share Posted August 22, 2009 Traffic lights can't have commands because they are non playable gameobjects. What you can try is making a command for the engineer so he can disable the lights or something. I am just not sure how to do this. Quote Link to comment Share on other sites More sharing options...
Xplorer4x4 Posted August 22, 2009 Report Share Posted August 22, 2009 Unless you have quite extensive knowledge of C++ I woudlnt waste my time. Hell I know a little C++ but couldnt dream of scripting the things Hoppah has done. Quote Link to comment Share on other sites More sharing options...
Hoppah Posted August 22, 2009 Report Share Posted August 22, 2009 Unless you have quite extensive knowledge of C++ I woudlnt waste my time. Hell I know a little C++ but couldnt dream of scripting the things Hoppah has done.Something is really wrong with you when you dream of my scripting experience... Quote Link to comment Share on other sites More sharing options...
Xplorer4x4 Posted August 22, 2009 Report Share Posted August 22, 2009 Well aside from Tim from the NY Mod I cant think of any one else on the forums that can make the things you do possible. I just hope you can get the tiller 100% functional before the release of 1.9% Quote Link to comment Share on other sites More sharing options...
Guest Overland Posted August 23, 2009 Report Share Posted August 23, 2009 I am a Software Engineer. But Java not C++, but the syntax shouldn't be a problem. It's just getting started, I see you guys declare the variables at the top of the page - but are the traffic lights and object with properties? E.g. have the lights got a go/stop property?Cheers guys, OverlandP.s I have edited + commented a winterberg script, just see whether you think I have the "right idea"object CheckVictim : CommandScript{ CheckVictim() { // Setting a valid target. SetValidTargets(ACTOR_PERSON); // Setting a priority SetPriority(1000); // Setting a exit SetPossibleExists(CPE_INJURED_PERSON); // Setting required equipment. SetPossibleEquipment(EQUIP_NONE); } bool CheckPossible(GameObject *Caller) { // If the caller is not valid or the caller is not an actor person. Return false. if(!Caller->IsValid() || Caller->GetType() != ACTOR_PERSON) { return false; } else { return true; } } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { // Is the caller is not valid OR if the caller is equiped OR is the target is not valid OR if the target ID is equal to the caller ID if(!Caller->IsValid() || Caller->IsEquipped() || !Target->IsValid() || Target->GetID() == Caller->GetID()) { return false; } // Declaring a variable previously called P, renamed to callerVariable. Person callerVariable(Caller); // Declaring a variable previously T, renamed to targetVariable. Person targetVariable(Target); // IS the target has a name prefix of "Corpse" if (Target->HasNamePrefix("leiche")) { return true; } // IF the caller is valid AND the target is valid AND the target is dead AND the target is not carried AND the target is not an animal AND the target is not a rescue dog AND the target is not drowning. if(callerVariable.IsValid() && targetVariable.IsValid() && targetVariable.IsDead() && !targetVariable.IsCarried() && targetVariable.GetRole()!=ROLE_ANIMAL && !targetVariable.IsRescueDog() && !targetVariable.IsDrowning()) { // IF the callers get entered car ID NOT EQUALS -1 AND the callers get entered car target ID NOT EQUAL targets get entered house ID RETURN FALSE. if (callerVariable.GetEnteredCarID() != -1 && callerVariable.GetEnteredCarTargetID() != targetVariable.GetEnteredHouseID()) { return false; } // If the callers get entered car ID EQUALS -1 AND the targets get house ID NOT EQUAL -1 AND the targets get entered house ID NOT EQUAL the the callers get entered house ID and the target is NOT in house with ground enterance. if (callerVariable.GetEnteredCarID() == -1 && targetVariable.GetEnteredHouseID() != -1 && targetVariable.GetEnteredHouseID() != callerVariable.GetEnteredHouseID() && !targetVariable.IsInHouseWithGroundEntrance()) { return false; } // Is the target is NOT victim AND the target is NOT bulldozable return FALSE if (!targetVariable.IsVictim() && !targetVariable.IsFlagSet(OF_BULLDOZABLE)) { return false; } // Else return TRUE else { return true; } } // Else return FALSE. else { return false; } } Quote Link to comment Share on other sites More sharing options...
Guest miked9372 Posted August 23, 2009 Report Share Posted August 23, 2009 you can turn the lights on off shift + b and b Quote Link to comment Share on other sites More sharing options...
Guest Overland Posted August 23, 2009 Report Share Posted August 23, 2009 On Winterberg? Quote Link to comment Share on other sites More sharing options...
Guest miked9372 Posted August 23, 2009 Report Share Posted August 23, 2009 i think it works on all mods Quote Link to comment Share on other sites More sharing options...
Guest Overland Posted August 23, 2009 Report Share Posted August 23, 2009 Traffic lights? really... How do you go about it... I clicked shift + b didn't ask me what set of lights to turn off etc... Quote Link to comment Share on other sites More sharing options...
randomperson139 Posted August 23, 2009 Report Share Posted August 23, 2009 Shift and B is for blue lights on vehicles not traffic lights Quote Link to comment Share on other sites More sharing options...
Guest Overland Posted August 23, 2009 Report Share Posted August 23, 2009 I thought I had it then Back to the code.P.s. in winterberg mod there is an event where the traffic lights break and someone has to come and fix them. Any idea where I could find the code for the events in the mod structure? Quote Link to comment Share on other sites More sharing options...
Newfoundking Posted August 23, 2009 Report Share Posted August 23, 2009 That isn't just winterburg, that is the base game's events, traffic light failure. Quote Link to comment Share on other sites More sharing options...
Xplorer4x4 Posted August 24, 2009 Report Share Posted August 24, 2009 And since it is part of the game it is likley hard coded into the game. Now being a software engineer, you may be able to reverse the games files to revel the code. I had a program to do it but i forgot what it was now. Anyways if you can do that you can see the code for the traffic light failure and perhaps modify this to suit your needs. Quote Link to comment Share on other sites More sharing options...
Newfoundking Posted August 25, 2009 Report Share Posted August 25, 2009 Me a software engineer, or someone else?And also, you could just simply create a new event, instead of going through all this to edit one event... Kinda quicker if you can script Quote Link to comment Share on other sites More sharing options...
Xplorer4x4 Posted August 25, 2009 Report Share Posted August 25, 2009 No the op said he was software engineer. Quote Link to comment Share on other sites More sharing options...
Guest miked9372 Posted August 25, 2009 Report Share Posted August 25, 2009 i know go to my computer > c: drive > program files > what ever > emergency 4 > mods > winterbergspecs > open "freeplayparameters" with notepad find:<!-- DG --> <TrafficLightFailure AverageFrequency="0.1"/> <!-- AverageFrequency: average number of events per 10 minutes -->change "0.1" to what ever you want ex "0.0" no traffic light failureex2: 9.9 a lot of traffic light failure's hope that helps Quote Link to comment Share on other sites More sharing options...