if you all are curious as to what the actual scripts might look like for modifying the game, here's an example.
I'll be sure to release some documentation with the demo for this, but I'll leave it to you to figure it out.
This is the lua file used for setting Nicolas's sprites for his attacks depending on what weapon he has equipped.
I'll be sure to release some documentation with the demo for this, but I'll leave it to you to figure it out.
This is the lua file used for setting Nicolas's sprites for his attacks depending on what weapon he has equipped.
Code:
function ScriptInit(id)
Entity = id
dir = GetDir(Entity);
weapon = GetWeaponIndex(Entity);
animation_index = GetAnimationIndex(Entity);
end
function Nico_Attack_Index_Script
if(GetFlag(Entity, Flag_isclimbing)==false) and (GetFlag(Entity, Flag_ishanging) == false) and (GetFlag(Entity, Flag_ishurt) == false)
then
if (weapon == 0) --case 0
then
if (GetFlag(Flag_onground)
then
if (animation_index >=4 )
then
SetFlag(Entity, Flag_isattacking, false);
end
SetHsp(Entity, 0);
SetSprite(Entity,spr_slingshot);
else
if (animation_index >=3 )
then
SetFlag(Entity, Flag_isattacking,false);
end
SetSprite(Entity,spr_slingshot_air);
if (dir==LEFT) then SetHsp(Entity, 3);
if (dir==RIGHT) then SetHsp(Entity, -3);
end --break
elseif (weapon == 1) --case 1
if (Getflag(Entity, Flag_onground))
SetHsp(Entity, 0);
SetSprite(Entity,spr_yoyo_ground);
else
SetSprite(Entity,spr_yoyo_air);
end --break
end
end
end