Scripting Engine built and tested with merges from latest master

This commit is contained in:
Sachith Hasaranga Seneviratne
2014-05-21 12:51:21 +05:30
parent 888c514dc7
commit 3023a12f2b
3 changed files with 5 additions and 4 deletions

View File

@@ -7,5 +7,5 @@ void onTrigger()
*/
displayMessage("Wow! Such Message. Very Script... wow");
disableAnimation("hayBail.b3d");
squashKart(0,35.0); //id of kart,time to squash
//squashKart(0,35.0); //id of kart,time to squash
}

View File

@@ -51,7 +51,7 @@ void disableAnimation(asIScriptGeneric *gen){
}
void squashKart(asIScriptGeneric *gen){
int id = (int)gen->GetArgAddress(0);
int id = (int)gen->GetArgDWord(0);
float time = gen->GetArgFloat(1);
AbstractKart* kart = World::getWorld()->getKart(id);
kart->setSquash(time,0.5); //0.5 * max speed is new max for squashed duration
@@ -193,8 +193,8 @@ int compileScript(asIScriptEngine *engine, std::string scriptName)
// For now we will load the script directtly from a file on the disk.
//TODO use filemanager to do this.
std::string load_dir = "D:\\Github\\stk\\stk-code\\src\\scriptengine\\";
//std::string load_dir = "//media//New Volume//Github//stk//stk-code//src//scriptengine//";
//std::string load_dir = "D:\\Github\\stk\\stk-code\\src\\scriptengine\\";
std::string load_dir = "//media//New Volume//Github//stk//stk-code//src//scriptengine//";
load_dir += scriptName + ".as";
FILE *f = fopen(load_dir.c_str(), "rb");
if( f == 0 )

View File

@@ -1,4 +1,5 @@
void onTrigger()
{
displayMessage("Bananas! Bananas! Everywhere!");
squashKart(0,35.0); //id of kart,time to squash
}