Talk:Dota 2 Workshop Tools/Scripting/Abilities Data Driven

From Valve Developer Community
Jump to: navigation, search

About RunScript...

There are several parameters passed in you function.

function AbilityRunScript (param)

The 'param' is a table with (string, table (or value)). The first parameter is a string which describes value of second parameter, take a look:

"target_points" "caster" "target_entities" "Target" "attacker" "caster_endindex" "ScriptFile" "unit" "Function" "ability"

I will try to explain what it all values means. Types in C standart.

1. target_points

Second parameter is a table {

   int id;
   Vector3 point

}

2. caster

Second parameter is a table {

   string name
   handle value

}

3. target_entities Probably a table like "target_points", in my script there is a nill

4. Target

Second parameter is a string

String TargetType; //A target type that you entered in RunScript "Target" token. In my script there is a "POINT"

5. attacker

Second parameter is a table Table looks like a "caster" table

6. caster_entindex

Second parameter is a int int entIndex; //Entity index of caster, i guess)

7. ScriptFile

Second parameter is a string String ScriptFileName; // Name of script file that you entered in RunScript "ScriptFile" token.

8. unit

Second parameter is a table Table looks like a "caster" table, but i think that's diffrent.

9. Function

Second parameter is a string String FunctionName; // Name of function that you entered in RunScript "function" token.

10. ability

Second parameter is a table {

   string Name;
   Handle value;

}