[ACS] How do you use EVENT ?

Discuss all aspects related to modding Zandronum here.
Post Reply
LordOZ_98
 
Posts: 43
Joined: Thu Feb 02, 2017 10:32 am

[ACS] How do you use EVENT ?

#1

Post by LordOZ_98 » Sun Feb 19, 2017 10:01 pm

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.
Kind Regards
- LordOZ_98

User avatar
Hypnotoad
Retired Staff / Community Team Member
Posts: 528
Joined: Tue May 29, 2012 8:50 pm
Location: Britland

[ACS] Re: How do you use EVENT ?

#2

Post by Hypnotoad » Sun Feb 19, 2017 10:57 pm

It should be more like:

Code: Select all

Script 353 (int type, int arg1, int arg2 ) EVENT
{
	if (type == GAMEEVENT_CAPTURES)
		Points[PlayerNumber()] += 50;
}

LordOZ_98
 
Posts: 43
Joined: Thu Feb 02, 2017 10:32 am

[ACS] Re: How do you use EVENT ?

#3

Post by LordOZ_98 » Mon Feb 20, 2017 4:27 pm

Still no luck :/, it said Identifier has not been declared this time.
Kind Regards
- LordOZ_98

User avatar
Sean
IRC Operator
Posts: 952
Joined: Thu Jan 16, 2014 9:09 pm
Location: United Kingdom
Contact:

[ACS] Re: How do you use EVENT ?

#4

Post by Sean » Mon Feb 20, 2017 6:59 pm

Full error, pls?
<capodecima> i dont say any more word without my loyer jenova

LordOZ_98
 
Posts: 43
Joined: Thu Feb 02, 2017 10:32 am

[ACS] Re: How do you use EVENT ?

#5

Post by LordOZ_98 » Mon Feb 20, 2017 10:23 pm

Identifier has not been declared GAMEEVENT_CAPTURES.
Kind Regards
- LordOZ_98

User avatar
Kaminsky
Developer
Posts: 195
Joined: Sun Apr 14, 2013 7:17 pm
Location: Canada

[ACS] Re: How do you use EVENT ?

#6

Post by Kaminsky » Tue Feb 21, 2017 1:03 am

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.

LordOZ_98
 
Posts: 43
Joined: Thu Feb 02, 2017 10:32 am

[ACS] Re: How do you use EVENT ?

#7

Post by LordOZ_98 » Tue Feb 21, 2017 6:44 am

Oh, that clears up few things, Thank you.
Kind Regards
- LordOZ_98

Post Reply