Jump to content
Guest Stressed

Scripting : EM4's API

Recommended Posts

Guest Stressed

Hey people,

Seeing sixteen tons didn't give a list of the methodes availlable on EM4 I propose to make a list of them here and explain what they do... I am sure that can help a lot.

The best way right now is I think to find them on the 20scripts they made for the 20missions...

Of course you can help me by replying and I will edit this first post to be kept updated.

System

System::Log(const char * msg,...) : print to the log file the msg. Use the printf syntax.

Game

GameObjectList Game::GetGameObjects() : ???

GameObjectList Game::GetGameObjects(const char * name) : ???

Mission

Mission::PlayHint(const char * msg) : Show the hint called msg

Audio

Audio::SetMusicLevel(float f) : Change the sound level of the music to f.

Audio::PlaySoundtrack("1", 0.0f) : ???

Audio::PlaySample(const char* filepath) : Play the audio sample at the filepath (eg "mod:Audio/FX/misc/newobjective.wav")

int Audio::PlaySample3D(const char * filepath, Vector position, bool ???) : Start playing the filepath sound at the position and return the id.

Audio::StopSample(int i) : Stop the sample with id i

Camera

Camera::DisableCameraXYMovement()

Camera::DisableCameraZMovement()

Camera::DisableCameraRotation()

ScriptInterface

ScriptInterface::HideRadar()

ScriptInterface::HideMap()

ScriptInterface::HideNavigator()

ScriptInterface::HideInfoBar()

ScriptInterface::HideVehicleBrowser()

Classes

class GameObject {
bool HasName(const char * name) : check the name of the object
void Show()
void Hide()
???
}
class GameObjectList {
GameObject GetObject(int i) : return the object [i]i[/i]
int GetNumObjects() : return the number of object
???
}
class Person {
???
}
class Vehicle {
Vector GetPosition() : return the position of the vehicle in the map.
void AddPassenger(Person* pers) : Add the [i]pers[/i] as passager
???
}
class Path {
???
}

Link to comment
Share on other sites

Too much work. You didn't really explain how to actually use this in scripts. For example this:

Mission::PlayHint(const char * msg) : Show the hint called msg

you need to use brackets or a constant (const char...) to make that work ingame. For example:

Mission::PlayHint("Test 1234");

Link to comment
Share on other sites

Guest Stressed
you need to use brackets or a constant (const char...) to make that work ingame. For example:

Mission::PlayHint("Test 1234");

I only used the prototype, what I want to do is some kind of header of their api... That really can help scripter to begin... I am sure when you script you always go to the old scripts to know how you did that or that... with this you can easily see all the possibilities and exactly know what you can or can not do

"Test 123" is a const char * so with that prototype each programmer knows he can use a const char * and not a string or cstring or whatever

Link to comment
Share on other sites

Guest Stressed

Wow... ok finally that already exists... http://www.emergency4spektrum.de/index.php/Kategorie:Scripts

It is not english, I am not speaking a word of german but I can understand the c++ on it :P

Thank you everyone anyways..

Hoppah, are you going to make a script soon for LAMod... I can maybe try to help... of course there is no garantie but there is nothing to lose

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...