How to increase Hitpoints by script?

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

Post Reply
deamon23
Posts: 2
Joined: 26 Feb 2013, 14:34

How to increase Hitpoints by script?

Post by deamon23 »

Hi, I'd posted before, but it wasn't published - donno why.

I wanna eddit the TeamSurvival.script due increasing Hitpoints. I'm quite a noob as for scripting but I really try it hard because I wanna have the best possible gamingexperience on my maps.

Please, can anyone help me with this problem - I'm really despreate!

Is it possible to change the amount of HP, like in Joust? Could anyone say how it can be done?

Thx a lot!
User avatar
Eole
Nadeo
Nadeo
Posts: 1265
Joined: 26 Apr 2011, 21:08

Re: How to increase Hitpoints by script?

Post by Eole »

You can increase the number of armors when you spawn a player. In the TeamSurvival script you can search for the SM::SpawnPlayer() function.

Code: Select all

Void SpawnPlayer(CSmPlayer _Player, Integer _ClanNum, Integer _Armor, CSmBlockSpawn _BlockSpawn, Integer _ActivationDate)
This function takes up to five parameters:
- _Player, the player to spawn
- _ClanNum, in which clan to spawn the player. Can be 0 (if it's a free for all mode) 1 or 2 (if it's a team mode)
- _Armor, the number of armor points given to the player. 100 = 1 armor, 200 = 2 armors, 300 = 3 armors, etc ...
- _BlockSpawn, the spawn where the player will start
- _ActivationDate, when the player will be spawned

In TeamSurvival there's three calls to SpawnPlayer()

Code: Select all

SM::SpawnPlayer(Player, Player.RequestedClan, ClanSpawnAnchors[Player.RequestedClan], Now + RespawnTime);
So you just have to add the number of armor points between Player.RequestedClan and ClanSpawnAnchors[Player.RequestedClan].

Code: Select all

SM::SpawnPlayer(Player, Player.RequestedClan, 700, ClanSpawnAnchors[Player.RequestedClan], Now + RespawnTime);
Another thing to change is the maximum number of armor of the player. By defaul it's 200. To change that you have to alter Player.ArmorMax. Let's say you want that the players have a maximum of 10 armor points but spawn with only 6. You can do that

Code: Select all

Player.ArmorMax = 1000;
SM::SpawnPlayer(Player, Player.RequestedClan, 600, ClanSpawnAnchors[Player.RequestedClan], Now + RespawnTime);
Contribute to the ManiaPlanet documentation on GitHub
A question about ManiaScript? Ask it here!
deamon23
Posts: 2
Joined: 26 Feb 2013, 14:34

Re: How to increase Hitpoints by script?

Post by deamon23 »

I thank you so much!! It wokrs very well! If i just knew it earlier... Only a damn value made me happy at the end ;-)
Post Reply

Return to “ManiaScript”

Who is online

Users browsing this forum: No registered users and 1 guest