I can't attack Shootmania bots

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

Post Reply
User avatar
BigBang1112
Posts: 388
Joined: 20 Jul 2015, 12:44
Location: Czech Republic
Contact:

I can't attack Shootmania bots

Post by BigBang1112 »

I have this code:

Code: Select all

Void SpawnZombie(CSmMapBotPath spawn) {
	declare CSmPlayer bot = CreateBotPlayer(NullId, 0);
	bot.ArmorMax = 400;
    bot.Armor = bot.ArmorMax;
	bot.Driver.Behaviour = CSmPlayerDriver::ESmDriverBehaviour::Patrol;
	bot.Driver.AggroRadius = 1000.;
	SpawnBotPlayer(bot, 1, 400, spawn, Now + 50);
}
Dat spoiler tho

I'm trying to spawn a bot on BotPath, but I also want to attack that bot. He can attack me normally, but I can't him. I think I need to add something so the bot can be attackable, but I'm not sure. Tested a lot of things, nothing has worked.
Also, PendingEvents doesn't return OnHit when I hit a bot, so I think there's a different problem. Bots can normally kill each other. :D
I'm using custom weapon that I made in Action Maker, but there's nothing to set about damage.

Offtopic: Somehow, even though the rockets bot shoots are red, the bot itself is blue. What's the problem here?

Thanks in advance.
Creator and competent racer. YouTube Discord
- ENVIMIX (out in open-source)
- Challenge (OUT NOW)
- Leaderboards (OUT NOW)
- Compute Shadows
User avatar
Eole
Nadeo
Nadeo
Posts: 1265
Joined: 26 Apr 2011, 21:08

Re: I can't attack Shootmania bots

Post by Eole »

Custom weapons created with the Action maker do not trigger the OnHit event.
The script of the action must use the SendRulesEvent() function to send a custom event (a hit for example) to the game mode. Then you will receive an OnActionCustomEvent event in your mode script when the action trigger an event.
Contribute to the ManiaPlanet documentation on GitHub
A question about ManiaScript? Ask it here!
User avatar
Dommy
Translator
Translator
Posts: 1866
Joined: 25 Aug 2011, 21:45
Location: Poland
Contact:

Re: I can't attack Shootmania bots

Post by Dommy »

Check how I manage custom actions weapons in my Invasion mode:
https://github.com/domino54/title-packs ... t.txt#L542
Ryzen 7 2700X, GTX 1070 Ti, 16 GB RAM, Windows 10 Insider Build
FORUM MODERATOR • CREATOR OF SHOOTMANIA GALAXY & TRACKMANIA² PURSUIT

Contact me via GALAXY & PURSUIT DISCORD
User avatar
BigBang1112
Posts: 388
Joined: 20 Jul 2015, 12:44
Location: Czech Republic
Contact:

Re: I can't attack Shootmania bots

Post by BigBang1112 »

Thanks a lot both! I'll check soon :1010
Creator and competent racer. YouTube Discord
- ENVIMIX (out in open-source)
- Challenge (OUT NOW)
- Leaderboards (OUT NOW)
- Compute Shadows
Post Reply

Return to “ManiaScript”

Who is online

Users browsing this forum: No registered users and 1 guest