KnightHawk75 -> RE: Need some Lua halp with a Special Action (2/8/2022 3:29:02 AM)
|
quote:
Yeah, this gets me the same thing, nothing. I ran the scenario using this in the SA You do not run that in the SA itself, that Creates an Action, it does NOT execute it. Go look in your actions you'll see it's there (remove it though). Actions must be tied to triggers if you want them to execute, or if you were like re-using or manually wanted to call the actions you could use ExecuteEventAction('thename') after creating it. Anyway doing either is making it more complicated then it needs to be. quote:
So I'm trying to do two things in one SA, allow the player to grant nuclear release at a cost of a certain number of VPs (likely -2,500). Seems like the first option will take away any points they gained and set the score to -2,500 which I don't want to do Nope, it first gets the current score and removes 2500 from the current score and is the simplest way to do what you want. Put this in your SA and you should be good to go: ScenEdit_SetDoctrine({side="Russia"}, {use_nuclear_weapons="yes" }); ScenEdit_SetScore("Russia", ScenEdit_GetScore("Russia") - 2500,"Nuclear release authority granted"); [img]https://i.postimg.cc/v4NWWLz9/Auth-Nukes-SA.jpg[/img]
|
|
|
|