Jump to content
b2bomber

Script error: class not defined in the current scope (Need help in general with understanding flow of program)

Recommended Posts

Hi all,

I have had 1-2 years now of scripting experience now and I have decided to try out working with emergency's base. I have two questions for you, one is a bit more specific than the other so here I go.

Q 1. Ok, well I know this script is missing a lot probably but basically I am looking for an answer of how to get it to start working in the game...

So here is the error in the log file that I am getting when I start up the editor and load the mod with the script in it.

?(_Airhornfc246a): Error: Symbol CLASS_AirHornAirHorn is not defined in current scope

its saying the the object/class that I have created is not defined in the current scope, is there some where that I need to be defining the script to something?

here's the script...


//==================================================================================================
//
// ///ENGLISH-USA setup///
//
// AirHorn.script
// By B2bomber
// on 9/16/11
//
// Usage of this script in any content is NOT allowed without the expressed
// written consent of Jacob McKim/B2bomber
//
// This script is used to make the air horn effect for emergency apparatus
// in em4
//
//
// Last Edit : 9/17/11
//
// Version #: 1.0.0
//
// ///DEUTSCH-Fertig mit Google Translate///
//
//
// AirHorn.script
// Von B2bomber
// Auf 17/9/11
//
// Aufruf des Skripts in beliebiger Inhalte ist ohne ausdrückliche erlaubt
// Zustimmung von Jacob McKim/B2bomber geschrieben
//
// Dieses Skript wird verwendet, um die Luft Horn-Effekt für den
// Notfall apparat machen In EM4
//
//
// Letzte Änderung: 17/9/11
//
// Version #: 1.0.0
//
//
//================================================================================================

// Start by creating the object
object AirHorn : CommandScript
{

VcmdAirHorn ()
{
SetIcon (Sirens);
SetPossibleCallers(ACTOR_VEHICLE);
SetValidTargets(ACTOR_VEHICLE);
SetRestrictions(RESTRICT_SELFEXECUTE);
SetDeselectCaller(false);
}

bool CheckGroupVisibility(GameObject *Caller)
{
if(!Caller->IsValid() || Caller->GetType() != ACTOR_VEHICLE)
{return false;}
else
{
return true;
}
}

bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
{
if(!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID())
{return false;}
else
{return true;}
}

void PushActions (GameObject *Caller, Actor *Target, int childID)
{
Vehicle v(Caller);
int soundID;

Vector VPos=v.GetPosition();

soundID = Audio::PlaySample3D("mod:Audio/FX/Sirens/airhorn.wav", VPos, false);

}
}

Q 2. Now In general can someone please describe to me how the flow of emergency's scripts work. I have worked with several different game engines some object oriented some not (Unity,Blitz,Torque,Unreal Engine). Although I really haven't found a good reference for how the flow of the program works. I can kind of see how it working but really would like to see if someone could clarify it for me. I have been using so far...

-Modding Studio 2012

-LA Mod Scripts as comparitive

-http://www.emergency...tegorie:Scripts

Thanks,

B2Bomber

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...