soulbody Posted May 24, 2010 Report Share Posted May 24, 2010 ?(_LACenterCamera8c534): Error: Unexpected EOF G__exec_statement()?(_LACenterCamera8c534): FILE:mod:/scripts/game/command/LACenterCamera.script8c534 LINE:75?(_LACenterCamera8c534): Advice: You may need to use +P or -p option?Could not load script mod:/scripts/game/command/LACenterCamera.script?(_LACenterCamera8c534): Error: Symbol this_definitely_is_an_evil_workaround_1505_6713 is not defined in current scope ?(_LACenterCamera8c534): FILE: LINE:0?(_LACenterCamera8c534): !!!Dictionary position rewound... ?(_LACenterCamera8c534): !!!Error recovered!!!i just made a script and get this message in the log file.the script is://******************************************************************************************// #Version 1.0#//// Includes: Command to center the camera on a moving unit//// - VcmdCenterCamera//// Script by Soulbody//// Usage of this script in other mods is NOT allowed without permission of Soulbody////******************************************************************************************object VcmdCenterCamera : CommandScript( VcmdCenterCamera() { SetIcon("scoutmine"); SetCursor("scoutmine"); SetValidTargets(ACTOR_VEHICLE); SetRestructions(RESTRICT_NOTDESTROYED); SetPriority(998); SetSelfClickActivation(true); SetHighlightingEnabled(false); } bool CheckPossible(GameObject *Caller) { if (!Caller->IsValid()) return false; if (!Game::IsFreeplay() && !Game::IsMultiplayer()) return false; Vehicle v(Caller); if (v.IsCollidingWithVirtualObject(VO_SQUAD01)) return false; return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (!Caller->IsValid() || !Target->Valid() || (Caller->GetID() != Target->GetID())) return false; Vehicle v(Caller); Setpriority(0); if (v.GetNumTransported() > 0) SetPriority(999); return true; } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { Vector Pos = Caller->GetPosition(); Vehicle v(Caller); void SetCameraToLocation(Const char *Target); void FollowTarget(const GameObject *Target, const Vector &Pos, bool useCurrentCamPos = false); void LookAtTarget(const GameObject *Target, bool smoothTransition = false, float zoomspeed = 0.0f, float zoomDuration = 1.0f); }};the script supposed to center the camera at any vehicle, so when you hit the icon it automaticly follows that unit... Quote Link to comment Share on other sites More sharing options...
Xplorer4x4 Posted June 6, 2010 Report Share Posted June 6, 2010 If you still need a fix, you have:object VcmdCenterCamera : CommandScript(It should be:object VcmdCenterCamera : CommandScript{You put a ( rather then a { Quote Link to comment Share on other sites More sharing options...
Ami89E1234 Posted June 7, 2010 Report Share Posted June 7, 2010 Lol I looked over the entire script and couldn't find anything wrong (the rest is good). Nice eyes, Xplorer. Without the first bracket, the entire script is null Quote Link to comment Share on other sites More sharing options...
Hoppah Posted June 7, 2010 Report Share Posted June 7, 2010 void SetCameraToLocation(Const char *Target);void FollowTarget(const GameObject *Target, const Vector &Pos, bool useCurrentCamPos = false);void LookAtTarget(const GameObject *Target, bool smoothTransition = false, float zoomspeed = 0.0f, float zoomDuration = 1.0f); This doesn't work that way. You need to define target and pos first. Look at other scripts to find examples.GameObject t(Target);Vector pos;Camera::SetCameraToLocation(&t);Camera::FollowTarget(&t, pos, false);Camera::LookAtTarget(&t, false, 0.0f, 1.0f);Try this instead, but I don't know if it works correctly. You apparently used the wikipage and just copied the codes. That's not how scripting works! The codes on that site do not show you how to use the codes, but what each part means. You have to compare your script with other scripts to see if you did it the right way. In this example I used lamod03.script where I did about the same thing. Quote Link to comment Share on other sites More sharing options...
soulbody Posted June 7, 2010 Author Report Share Posted June 7, 2010 void SetCameraToLocation(Const char *Target);void FollowTarget(const GameObject *Target, const Vector &Pos, bool useCurrentCamPos = false);void LookAtTarget(const GameObject *Target, bool smoothTransition = false, float zoomspeed = 0.0f, float zoomDuration = 1.0f); This doesn't work that way. You need to define target and pos first. Look at other scripts to find examples.GameObject t(Target);Vector pos;Camera::SetCameraToLocation(&t);Camera::FollowTarget(&t, pos, false);Camera::LookAtTarget(&t, false, 0.0f, 1.0f);Try this instead, but I don't know if it works correctly. You apparently used the wikipage and just copied the codes. That's not how scripting works! The codes on that site do not show you how to use the codes, but what each part means. You have to compare your script with other scripts to see if you did it the right way. In this example I used lamod03.script where I did about the same thing.thanks for codes this part is atleast what the game doesn't make crash, i tried it as far i fixed crashes from other message either.the new script is posted in the spoiler. there is only one thing i couldn't fix the command seems to want to select a vehicle and not automaticly operate on the caller. i compare the script with scripts as:VcmdToPoliceStation, Sirens, VcmdPatrol but couldn't find anything which would make the command get on the caller. also with the help of the wikipage i couldn't find anything usefullNew Script//******************************************************************************************// #Version 1.0#//// Includes: Command to center the camera on a moving unit//// - VcmdCenterCamera//// Script by Soulbody//// Usage of this script in other mods is NOT allowed without permission of Soulbody////******************************************************************************************const char VO_SQUAD01[] = "SQUAD01";object VcmdCenterCamera : CommandScript{ VcmdCenterCamera() { SetIcon("scoutmine"); SetCursor("scoutmine"); SetPriority(998); SetSelfClickActivation(true); SetRestrictions(RESTRICT_SELFEXECUTE); SetValidTargets(ACTOR_VEHICLE); } bool CheckPossible(GameObject *Caller) { if (!Game::IsFreeplay() && !Game::IsMultiplayer()) return false; Vehicle v(Caller); if (v.IsCollidingWithVirtualObject(VO_SQUAD01)) return false; return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (!Caller->IsValid() || (Caller->GetID() != Target->GetID())) return false; Vehicle v(Caller); if (v.GetNumTransported() > 0) SetPriority(999); return true; } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { Vehicle v(Caller); GameObject t(Target); Vector Pos = t.GetPosition(); Camera::SetCameraToLocation(&t); Camera::LookAtTarget(&t, false, 0.0f, 1.0f); Camera::FollowTarget(&t, pos, false); }}; Quote Link to comment Share on other sites More sharing options...
james23222000 Posted June 8, 2010 Report Share Posted June 8, 2010 Get rid of this line in the code:Vector pos;And You Need to move and edit this line:Vector Pos = Caller->GetPosition();This code should work://******************************************************************************************// #Version 1.0#//// Includes: Command to center the camera on a moving unit//// - VcmdCenterCamera//// Script by Soulbody//// Usage of this script in other mods is NOT allowed without permission of Soulbody////******************************************************************************************const char VO_SQUAD01[] = "SQUAD01";object VcmdCenterCamera : CommandScript{VcmdCenterCamera(){SetIcon("scoutmine");SetCursor("scoutmine");SetPriority(998);SetSelfClickActivation(true);SetRestrictions(RESTRICT_SELFEXECUTE);SetValidTargets(ACTOR_VEHICLE);}bool CheckPossible(GameObject *Caller){if (!Game::IsFreeplay() && !Game::IsMultiplayer())return false;Vehicle v(Caller);if (v.IsCollidingWithVirtualObject(VO_SQUAD01))return false;return true;}bool CheckTarget(GameObject *Caller, Actor *Target, int childID){if (!Caller->IsValid() || (Caller->GetID() != Target->GetID()))return false;Vehicle v(Caller);if (v.GetNumTransported() > 0)SetPriority(999);return true;}void PushActions(GameObject *Caller, Actor *Target, int ChildID){Vehicle v(Caller);GameObject t(Target);Vector Pos = t.GetPosition();Camera::SetCameraToLocation(&t);Camera::LookAtTarget(&t, false, 0.0f, 1.0f);Camera::FollowTarget(&t, Pos, false);}};That should work, but I would be careful with this script, I can see it having issues when you use it as a command script.Test it and let me know what happens.RegardsJames Quote Link to comment Share on other sites More sharing options...
soulbody Posted June 8, 2010 Author Report Share Posted June 8, 2010 still the same, i have to select a target but i can't nothing is called able to follow with the camera, everything got the disabled icon while the command is operate able...i will try to make a video if possibleAdditional info 1:I was testing again some parts adding and remove but the still didn't worki tried either this " Vehicle v(caller) = GameObject t(target);"this got the same result i still got to select a target, even the unit where i try it on (LAPD Motercycle) lights up but when i click the unit to select it as target the command close down as like the click on the cross when you want to stop operating the a command... Quote Link to comment Share on other sites More sharing options...
james23222000 Posted June 8, 2010 Report Share Posted June 8, 2010 Can you describe to me what you want the script to do? Quote Link to comment Share on other sites More sharing options...
soulbody Posted June 8, 2010 Author Report Share Posted June 8, 2010 Can you describe to me what you want the script to do?The script should let the camera center on a moving unit and follow until he stops.That last part will u do myself later to obtain some experiance but atleast i need to let script follow the unit which operate the command. Quote Link to comment Share on other sites More sharing options...
james23222000 Posted June 9, 2010 Report Share Posted June 9, 2010 Is the command button to center the camera on the vehicle you wish it to center on? Quote Link to comment Share on other sites More sharing options...
soulbody Posted June 9, 2010 Author Report Share Posted June 9, 2010 Is the command button to center the camera on the vehicle you wish it to center on?Yes, when you hit the icon it should automaticly center the camera on the unit you got selected and follow it...like this:''i got the dodge charger selected, hit the icon for the center camera and the camera center and follow my dodge charger'' Quote Link to comment Share on other sites More sharing options...
james23222000 Posted June 10, 2010 Report Share Posted June 10, 2010 //****************************************************************************************** // #Version 1.0# // // Includes: Command to center the camera on a moving unit // // - VcmdCenterCamera // // Script by Soulbody // // Usage of this script in other mods is NOT allowed without permission of Soulbody // //****************************************************************************************** const char VO_SQUAD01[] = "SQUAD01"; object VcmdCenterCamera : CommandScript { VcmdCenterCamera() { SetIcon("scoutmine"); SetCursor("scoutmine"); SetPriority(998); SetSelfClickActivation(true); SetRestrictions(RESTRICT_SELFEXECUTE); SetValidTargets(ACTOR_VEHICLE); } bool CheckPossible(GameObject *Caller) { if (!Game::IsFreeplay() && !Game::IsMultiplayer()) return false; Vehicle v(Caller); if (v.IsCollidingWithVirtualObject(VO_SQUAD01)) return false; return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (!Caller->IsValid() || (Caller->GetID() != Target->GetID())) return false; Vehicle v(Caller); if (v.GetNumTransported() > 0) SetPriority(999); return true; } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { Vehicle v(Caller); Vector Pos = v.GetPosition(); Camera::SetCameraToLocation(&v); Camera::LookAtTarget(&v, false, 0.0f, 1.0f); Camera::FollowTarget(&v, Pos, false); } };Try that Quote Link to comment Share on other sites More sharing options...
soulbody Posted June 10, 2010 Author Report Share Posted June 10, 2010 I used it but still need to select a ''target'' i even tried to remove all the target sections and still need to select a target. Quote Link to comment Share on other sites More sharing options...
james23222000 Posted June 11, 2010 Report Share Posted June 11, 2010 Get Rid of the bool(Check target...... section Quote Link to comment Share on other sites More sharing options...
soulbody Posted June 12, 2010 Author Report Share Posted June 12, 2010 as i saidi even tried to remove all the target sections and still need to select a target. Quote Link to comment Share on other sites More sharing options...
james23222000 Posted June 12, 2010 Report Share Posted June 12, 2010 Ok, this one has got me, Hoppah any ideas? Quote Link to comment Share on other sites More sharing options...
Guest Francis Posted June 12, 2010 Report Share Posted June 12, 2010 Try that one first.//******************************************************************************************// #Version 1.0#//// Includes: Command to center the camera on a moving unit//// - VcmdCenterCamera//// Script by Soulbody//// Usage of this script in other mods is NOT allowed without permission of Soulbody////******************************************************************************************const char VO_SQUAD01[] = "SQUAD01";object VcmdCenterCamera : CommandScript{ VcmdCenterCamera() { SetIcon("scoutmine"); SetCursor("scoutmine"); SetPriority(998); SetSelfClickActivation(true); SetRestrictions(RESTRICT_SELFEXECUTE); SetValidTargets(ACTOR_VEHICLE); } bool CheckPossible(GameObject *Caller) { if (!Game::IsFreeplay() && !Game::IsMultiplayer()) return false; Vehicle v(Caller); if (v.IsCollidingWithVirtualObject(VO_SQUAD01)) return false; return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (!Caller->IsValid() || (Caller->GetID() != Target->GetID())) return false; Vehicle v(Caller); if (v.GetNumTransported() > 0) SetPriority(999); return true; } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { Vector Pos = Caller->GetPosition(); Camera::FollowTarget(&Caller, Pos); // No need to LookAtTarget since the camera will be auto-centered on the caller, (last parameter = false) }}; Quote Link to comment Share on other sites More sharing options...
soulbody Posted June 12, 2010 Author Report Share Posted June 12, 2010 thanks but got the same result, at least i want to say something need to be changed either: Vehicle v(Caller); if (v.IsCollidingWithVirtualObject(VO_SQUAD01)) return false;(don't get mad, i deleted this in previous version either)this code was meaned to prevent the usage of code while the vehicle was standing into the firestation but according to if (!Game::IsFreeplay() && !Game::IsMultiplayer()) return false;i noticed (even in the begin) that this will only allow it when the vehicle is in the virtual object. even when i translate is this code a blocker: SetRestrictions(RESTRICT_SELFEXECUTE);strange enough i have seen several codes that use self execute, like the deploy swat command.i tried several changes but nothing seems to work. or the command get disabled (when i removed the hole target section) or i need to select a target, strange enough the Caller vehicle is the only vehicle that lights up and when you move the mouse on the vehicle you get the scoutmine icon (as requested) but when you click then instead of following the vehicle the command get destroyed is it would when you hit the cross... Quote Link to comment Share on other sites More sharing options...
Xplorer4x4 Posted June 12, 2010 Report Share Posted June 12, 2010 Is your log reporting any errors still? Quote Link to comment Share on other sites More sharing options...
soulbody Posted June 13, 2010 Author Report Share Posted June 13, 2010 Is your log reporting any errors still?no the script is working right (according the game/logfile, there is no crash), but i just can't select any target and and either can't make it to automaticly assign the caller as a target... Quote Link to comment Share on other sites More sharing options...