[Help] [Solved] SkillPoints number in Manialink

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

User avatar
adamkooo2
Posts: 1275
Joined: 13 Jun 2014, 08:43
Location: Slovakia // Slovensko
Contact:

[Help] [Solved] SkillPoints number in Manialink

Post by adamkooo2 » 31 Aug 2017, 10:24

Hello guys!


Thanks to my poor skill in maniascript, I have another problem:
I want to show amount of skillpoints in campaign in label in manialink.
I've done it before, but with leaderpoints, so I know the way how to do it already.
I have started searching and I've found this:
https://maniaplanet.github.io/maniascri ... c301b7aef4
I have this script:

Code: Select all

(Page.GetFirstChild("SP") as CMlLabel).SetText(""^ ScoreMgr.Campaign_GetSkillPoints(0, 0));
An error is shown:

Code: Select all

Incorrect arguments to call the function Campaign_GetSkillPoints
And here comes the question:
What is campaign id and player id?


I hope that will be easy to solve it :)
Last edited by adamkooo2 on 02 Feb 2018, 10:15, edited 3 times in total.
/\rkady
Image

User avatar
Qlex
Nadeo
Nadeo
Posts: 239
Joined: 03 Jun 2012, 13:17

Re: [Help] SkillPoints number in Manialink

Post by Qlex » 04 Sep 2017, 13:27

Hi,

PlayerId is generally taken with UserMgr.MainUser.Id .

CampaignId is found in one of the several campaigns of DataFileMgr.Campaigns, which return a class of type CCampaign.

Your code would be :

Code: Select all

(Page.GetFirstChild("SP") as CMlLabel).SetText(""^ ScoreMgr.Campaign_GetSkillPoints(UserMgr.MainUser.Id, DataFileMgr.Campaigns[0].CampaignId));
I hope that helps!

User avatar
adamkooo2
Posts: 1275
Joined: 13 Jun 2014, 08:43
Location: Slovakia // Slovensko
Contact:

Re: [Help] SkillPoints number in Manialink

Post by adamkooo2 » 06 Sep 2017, 15:21

Hello,

I have done CTRL + C and replace my code but it seems it does not work.
The game always say that:

Code: Select all

ERROR [5, 93] The member or variable UserMgr does not exist.
ERROR [5, 93] The dot operator '.' must be applied to a class or a vector
ERROR [5, 102] The dot operator '.' must be applied to a class or a vector
ERROR [5, 61] Incorrect arguments to call the function Campaign_GetSkillPoints
I've tested it to convert it to script, but the manialink seems to be too big to be in the declared in text in script.

I've also tested this code:

Code: Select all

(Page.GetFirstChild("Rank") as CMlLabel).SetText(""^ ScoreMgr.CampaignLeaderBoard_GetPlayerRanking(UserMgr.MainUser.Id, DataFileMgr.Campaigns[0].CampaignId, LocalUser.ZonePath, False));
:arrow: and again the game says:

Code: Select all

ERROR [6, 108] The member or variable UserMgr does not exist.
ERROR [6, 108] The dot operator '.' must be applied to a class or a vector
ERROR [6, 117] The dot operator '.' must be applied to a class or a vector
ERROR [6, 63] Incorrect arguments to call the function CampaignLeaderBoard_GetPlayerRanking


I hope there's a solution, thanks for that CampaignId that is working :thx:
/\rkady
Image

User avatar
Qlex
Nadeo
Nadeo
Posts: 239
Joined: 03 Jun 2012, 13:17

Re: [Help] SkillPoints number in Manialink

Post by Qlex » 06 Sep 2017, 16:32

Ah, indeed, you are in a game mode, so that does not work.

Can you try log(ManiaPlanet.UserMgr)? If it's Null try Users[0].Id and tell me the results :)

User avatar
adamkooo2
Posts: 1275
Joined: 13 Jun 2014, 08:43
Location: Slovakia // Slovensko
Contact:

Re: [Help] SkillPoints number in Manialink

Post by adamkooo2 » 06 Sep 2017, 17:54

Qlex wrote:
06 Sep 2017, 16:32
Ah, indeed, you are in a game mode, so that does not work.
No, I am not in gamemode, I do not have the skill to do the whole gamemode :mrgreen:
Qlex wrote:
06 Sep 2017, 16:32
Can you try log(ManiaPlanet.UserMgr)? If it's Null try Users[0].Id and tell me the results
OK, I've tried toedit the code as you wrote. Here're results:
Image
Image
both are errors :/

Thank you for wasting your time with my problem, even it's not fixed :thx:
/\rkady
Image

zocka
Posts: 205
Joined: 15 Jun 2010, 17:56

Re: [Help] SkillPoints number in Manialink

Post by zocka » 06 Sep 2017, 17:55

If you have LocalUser try using this one? (LocalUser.Id)
manialink minigame shatter
my manialink: zockaml
my maniaflash: maniaflash?zocka

User avatar
adamkooo2
Posts: 1275
Joined: 13 Jun 2014, 08:43
Location: Slovakia // Slovensko
Contact:

Re: [Help] SkillPoints number in Manialink

Post by adamkooo2 » 06 Sep 2017, 18:07

zocka wrote:
06 Sep 2017, 17:55
If you have LocalUser try using this one? (LocalUser.Id)
I've tried LocalUser, but not LocalUser.Id
It works!!! :yes:
Thank you both :thx:
Image
/\rkady
Image

User avatar
adamkooo2
Posts: 1275
Joined: 13 Jun 2014, 08:43
Location: Slovakia // Slovensko
Contact:

Re: [Help] SkillPoints number in Manialink

Post by adamkooo2 » 06 Sep 2017, 18:16

When I try to open it in manialink, I always get an error:
Image
/\rkady
Image

User avatar
Qlex
Nadeo
Nadeo
Posts: 239
Joined: 03 Jun 2012, 13:17

Re: [Help] SkillPoints number in Manialink

Post by Qlex » 08 Sep 2017, 10:22

Can you try calling

Code: Select all

wait(50);
just before ?

User avatar
adamkooo2
Posts: 1275
Joined: 13 Jun 2014, 08:43
Location: Slovakia // Slovensko
Contact:

Re: [Help] SkillPoints number in Manialink

Post by adamkooo2 » 10 Sep 2017, 19:25

Qlex wrote:
08 Sep 2017, 10:22
Can you try calling

Code: Select all

wait(50);
just before ?
yes, it gives me an error:

Code: Select all

ERROR [7, 9] wait condition has to be Boolean
/\rkady
Image

Post Reply

Return to “ManiaScript”

Who is online

Users browsing this forum: No registered users and 1 guest