Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

Lua script for changing points

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> Lua script for changing points Page: [1]
Login
Message << Older Topic   Newer Topic >>
Lua script for changing points - 8/29/2021 2:14:16 PM   
AdmiralSteve


Posts: 270
Joined: 3/28/2011
From: Red Bluff, CA
Status: offline
I'm wanting to create a Special Action but I'm preferring a Lua script that can add/deduct points and be placed within the Special Action and thought that their was a script awhile ago but can't seem to locate it. Any ideas?

Thanks, Steve

< Message edited by AdmiralSteve -- 8/29/2021 2:15:04 PM >


_____________________________

“There are no extraordinary men...just extraordinary circumstances that ordinary men are forced to deal with.”
Admiral William Frederick Halsey Jr. 1882-1959

Post #: 1
RE: Lua script for changing points - 8/30/2021 12:53:26 PM   
KLAB


Posts: 355
Joined: 2/27/2007
Status: offline
This works from one of my special action scripts but as ever there is probably a cleverer way of doing it,

a=ScenEdit_GetScore("Side A")
ScenEdit_SetScore('Side A',(a-4000),'-4000 Points for whatever')

k

(in reply to AdmiralSteve)
Post #: 2
RE: Lua script for changing points - 8/30/2021 4:42:58 PM   
Kushan04


Posts: 683
Joined: 6/29/2005
Status: offline
No need to assign the side as a variable unless you really need to.

ScenEdit_SetScore('YourSideHere', NumberOfPointsHere, 'ReasonHere')

Example
ScenEdit_SetScore('USA', 1000, 'You destroyed something')

http://commandlua.github.io/#ScenEdit_SetScore



_____________________________


(in reply to KLAB)
Post #: 3
RE: Lua script for changing points - 8/30/2021 6:18:04 PM   
KnightHawk75

 

Posts: 1450
Joined: 11/15/2018
Status: offline

see the example at the bottom of the function specs (though it doesn't need the tonumber() around it).

(in reply to Kushan04)
Post #: 4
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> Lua script for changing points Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

2.172