Page 1 of 1
[ACS] How do you use EVENT ?
Posted: Sun Feb 19, 2017 10:01 pm
by LordOZ_98
I set up a script to reward points depending on type, But it seems like that thing affects every event type and not just the ones I specify ?
Code: Select all
script "CapturedFlag" (int GAMEEVENT_CAPTURES, int arg1, int arg2) EVENT
{
Points[PlayerNumber()] = Points[PlayerNumber()] + 50;
}
Keeps giving random points, and doesn't add just what I specify, I'm i using it right ? (Zandronum 3.0), It also activates itself on killing other players for no reason.
[ACS] Re: How do you use EVENT ?
Posted: Sun Feb 19, 2017 10:57 pm
by Hypnotoad
It should be more like:
Code: Select all
Script 353 (int type, int arg1, int arg2 ) EVENT
{
if (type == GAMEEVENT_CAPTURES)
Points[PlayerNumber()] += 50;
}
[ACS] Re: How do you use EVENT ?
Posted: Mon Feb 20, 2017 4:27 pm
by LordOZ_98
Still no luck :/, it said Identifier has not been declared this time.
[ACS] Re: How do you use EVENT ?
Posted: Mon Feb 20, 2017 6:59 pm
by Sean
Full error, pls?
[ACS] Re: How do you use EVENT ?
Posted: Mon Feb 20, 2017 10:23 pm
by LordOZ_98
Identifier has not been declared GAMEEVENT_CAPTURES.
[ACS] Re: How do you use EVENT ?
Posted: Tue Feb 21, 2017 1:03 am
by Kaminsky
The ACC version you're using to compile the code does not have the proper Zandronum definitions including those for the event scripts. You can open the zdefs.acs file in your ACC folder and add:
Code: Select all
#define GAMEEVENT_PLAYERFRAGS 0
#define GAMEEVENT_MEDALS 1
#define GAMEEVENT_CAPTURES 2
#define GAMEEVENT_TOUCHES 3
#define GAMEEVENT_RETURNS 4
#define GAMEEVENT_ROUND_STARTS 5
#define GAMEEVENT_ROUND_ENDS 6
#define GAMEEVENT_ROUND_ABORTED 7
to make the compiler recognize those definitions, or substitute a 2 in place of GAMEVENT_CAPTURES.
[ACS] Re: How do you use EVENT ?
Posted: Tue Feb 21, 2017 6:44 am
by LordOZ_98
Oh, that clears up few things, Thank you.