10-22-2009, 10:25 AM
|
#1 | |||
|
Member
|
Post rating: rate
Ok guys, here's the problem: I don't get how I'm supposed to use the lua bindings.
For example I needed to work with the active percentage during the song, I found on the StepMania theming wiki that GetPercentDancePoints was added in PlayerStageStats, then I luckily found the STATSMAN:GetCurStageStats():GetPlayerStageStats(pn ):GetCaloriesBurned() line in other.lua and modified it for my needs, but I still don't understand how to build that "address". Can somebody please explain it to me? |
|||
|
|
10-23-2009, 02:09 PM
|
#4 |
|
Member
|
Post rating: rate
I know that, what I need to know is how the STATSMAN:GetCurStageStats():GetPlayerStageStats(pn ):GetCaloriesBurned() line was determined. What I mean is: GetCaloriesBurned() is listed on this page http://www.stepmania.com/wiki/Lua_sc...Actor_commands under the PlayerStageStats class. How can I understand in wich singleton is every class comprised?
Let's say I need to get the highest machine score for the currently playing song. I see a GetPercentDP( ) function in the HighScore class, but how can I actually refer to it in the lua scripts? |
|
|
10-30-2009, 04:32 AM
|
#6 |
|
Angry Old Lady
|
Post rating: rate
Getting PlayerStageStats:
@STATSMAN:GetCurStageStats():GetPlayerStageStats(P LAYER_1):GetCaloriesBurned(); should return something. like: <BitmapText File="Blah" NoteCrossed250Command="@function(self) self:settext(STATSMAN:GetCurStageStats():GetPlayer StageStats(PLAYER_1):GetCaloriesBurned()); end;" /> that is, if I recall correctly. I could be wrong and might have to try it out but I dont have anything to do with at this time
__________________
cool, I have a forum ( GO JOIN ALREADY )
http://midiman.darkskystudios.net/forum/ also join #midiman on irc.badnik.net. |
|
|
11-03-2009, 05:29 PM
|
#8 |
|
Member
|
Post rating: rate
Ok I'll try to be more clear: I need to access the highest score for the current song while inside of ScreenGameplay. I've been reading the source code for hours and still haven't got a clue on how to build the function call. Can somebody please help me?
|
|
|
11-03-2009, 05:52 PM
|
#9 |
|
REAL STEPPING ROOTS '09
|
Post rating: rate
the high score list requires a profile, so this is a multi-step process.
First, you need to get the correct profile. I use this function to do that: Code:
function Profile(pn) if PROFILEMAN:IsPersistentProfile(pn) then -- player profile return PROFILEMAN:GetProfile(pn); else -- machine profile return PROFILEMAN:GetMachineProfile(); end; end; From there... Code:
<BitmapText
File="Blah"
OnCommand="@playcommand,Set"
SetCommand="@function(self)
local SongOrCourse, StepsOrTrail;
local scorelist;
local text = "";
local profile;
if GAMESTATE:IsCourseMode() then
SongOrCourse = GAMESTATE:GetCurrentCourse();
StepsOrTrail = GAMESTATE:GetCurrentTrail(pn);
else
SongOrCourse = GAMESTATE:GetCurrentSong();
StepsOrTrail = GAMESTATE:GetCurrentSteps(pn);
end;
if SongOrCourse then
if StepsOrTrail then
profile = Profile(pn);
scorelist = profile:GetHighScoreList(SongOrCourse,StepsOrTrail);
assert(scorelist);
local scores = scorelist:GetHighScores();
local topscore = scores[1];
if not topscore then
text = string.format("%.2f%%", 0);
else
text = string.format("%.2f%%", topscore:GetPercentDP()*100.0);
end;
else
text = "";
end;
else
text = "";
end;
self:settext(text);
end;"
/>
Hope this helps.
__________________
Event mode exists for a reason. Use it. ![]() We're doing it for fun, we're doing it because we can, we're doing it because we're SSC. Follow @kki_ssc on Twitter for KKI Labs/spinal shark collective news as it breaks! |
|
|
11-03-2009, 06:13 PM
|
#10 |
|
Member
|
Post rating: rate
I love you.
Also I've been using this but it looks outdated and incomplete. Thank you very much for your advice =) It is EXACTLY what I needed! EDIT: Sadly it doesn't really work. I think there is something wrong as the GetHighScoreList function is nowhere to be seen in OpenITG's source code =( Last edited by dj jack; 11-04-2009 at 01:47 PM.. |
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Changing the key bindings screen | DarkX9 | Theme/Noteskin Help/Questions/Requests | 1 | 06-06-2009 10:10 PM |
| OpenITg help!? | blacksausage666 | Other music games | 1 | 04-06-2009 06:27 AM |
| OpenITG alpha 8 | sicklyboy | 3rd-Party builds | 0 | 01-16-2009 08:05 PM |
| OpenITG Help | dancingcactus27 | 3rd-Party builds | 5 | 12-16-2008 02:16 AM |
| 3.95 and openITG | NeoSpearBlade | 3rd-Party builds | 29 | 05-28-2008 06:10 AM |
|
|
All times are GMT. The time now is 01:14 PM.
|