Page 1 of 1

I can't attack Shootmania bots

Posted: 25 Jan 2017, 20:21
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.

Re: I can't attack Shootmania bots

Posted: 30 Jan 2017, 14:12
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.

Re: I can't attack Shootmania bots

Posted: 30 Jan 2017, 14:17
by Dommy
Check how I manage custom actions weapons in my Invasion mode:
https://github.com/domino54/title-packs ... t.txt#L542

Re: I can't attack Shootmania bots

Posted: 31 Jan 2017, 18:08
by BigBang1112
Thanks a lot both! I'll check soon :1010