Activate/Desativate special action with point

All discussions & material related to Command's Lua interface

Moderators: angster, RoryAndersonCDT, michaelm75au, MOD_Command

Post Reply
Norm49
Posts: 96
Joined: Fri Jun 05, 2015 3:59 pm

Activate/Desativate special action with point

Post by Norm49 »

I am trying to make a special action activate if a player have 100 point or less and i want the action to be repeatable because the special action cost point and i do not want the player to fall under 0 point. In this case the script had a dock DDG to a naval base.

So my script for the spacial action work fine and i was trying to use even to activate and deactivate the special action. So i have the trigger that activate if the player have over 99 points and the event action is a lua script witch should deactivate the even that prevent the player buying the destroyer.The trigger is the one we can chose in the trigger option and is not a lua script.

This is the action script

Code: Select all

ScenEdit_SetEvent ({DescriptionOrID ='DDG no longer available to buy', IsActive='False'})
 ScenEdit_SetSpecialAction ({ActionNameOrID ='Buy a Arleigh Burke DDG 100 VP', IsActive='True'})

and is have a event that activate when the player score fall under 100.

Code: Select all

ScenEdit_SetEvent ({DescriptionOrID ='DDG now avilabe to buy', IsActive='False'})
 ScenEdit_SetSpecialAction ({ActionNameOrID ='Buy a Arleigh Burke DDG 100 VP', IsActive='False'})

Also when i test this my game star lagging a lot and it is not because of the amount of unit I play bigger scenario with out problem.
User avatar
michaelm75au
Posts: 12467
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

RE: Activate/Desativate special action with point

Post by michaelm75au »

Can you add the scenario? Bit hard to tell why it starts to lag on when the event is activated when the details aren't available.
Michael
Norm49
Posts: 96
Joined: Fri Jun 05, 2015 3:59 pm

RE: Activate/Desativate special action with point

Post by Norm49 »

I have special action to add and remove point for testing purpose. I still have tonne of other stuff the mission is in early development.
Attachments
buyunit.zip
(161.61 KiB) Downloaded 11 times
Post Reply

Return to “Lua Legion”