Page 1 of 1

Help with some basic ACS :V

Posted: Wed Apr 03, 2013 6:30 pm
by Lollipop
Hi, it appears to me that I'm more stupid than I thought (Again), but here my problem ,ill put all the stuff on the table for you:

#include "zcommon.acs"

script 698 (void) {
int MechType = 1;
if (CheckInventory ("FirebatWeapons")) MechType = 1;

}

int x = GetActorX(0);
int y = GetActorY(0);
int z = GetActorZ(0);
int angle = GetActorAngle (ActivatorTID ());

case 1:
// Firebat
if(GetActorProperty(0,APROP_Health) >= 1000)
Spawn ("EjectedRaven", x, y, z, 0, angle);
else
Spawn ("DamagedRaven", x, y, z, 0, angle);
break;
}

somewhy it tell me the following errors:
Syntax error in constant expression.
Missiing semicolon.

But this is a ripped off code, where I just removed what I didnt need, so how can it not Work? :V

RE: Help with some basic ACS :V

Posted: Wed Apr 03, 2013 6:33 pm
by Ijon Tichy
first off, use [ code ]

second off, where the hell is your switch block

RE: Help with some basic ACS :V

Posted: Wed Apr 03, 2013 6:35 pm
by Lollipop
well, the what? I think I removed the thing?...

RE: Help with some basic ACS :V

Posted: Wed Apr 03, 2013 8:31 pm
by xrgman
I don't really get what u want with ur code but I changed it to make atleast a little sense:
(sorry that i pasted code like text im not really familiar with the zan forums when it comes to code blocks)

#include "zcommon.acs"

script 698 (void)
{
int MechType = 1;
int x = GetActorX(0);
int y = GetActorY(0);
int z = GetActorZ(0);
int angle = GetActorAngle (ActivatorTID ());

if(CheckInventory ("FirebatWeapons")) == (vaulue of the firevatweapon, could be one to check if he has it dunno what u want :V) && MechType = 1)
{
switch(\\add this ureself)
{
case 1:
// Firebat
{
if(GetActorProperty(0,APROP_Health) >= 1000)
{
Spawn ("EjectedRaven", x, y, z, 0, angle);
}
else
{
Spawn ("DamagedRaven", x, y, z, 0, angle);
break;
}
}
}
}

If u still can't figure it out than u can always contact me on irc, i can be found in #zandronum with the same name as here :P

Anyways Good Luck!

RE: Help with some basic ACS :V

Posted: Wed Apr 03, 2013 9:05 pm
by ibm5155

Code: Select all

#include "zcommon.acs"

script 698 (void) {
	int MechType = 1;
	if (CheckInventory ("FirebatWeapons")) MechType = 1;//if the if is true it´ll only execute mechtype=1
	
	// This guy '}' is closing the script and the rest is not inside of script 698
	
	int x = GetActorX(0);
	int y = GetActorY(0);
	int z = GetActorZ(0);
	int angle = GetActorAngle (ActivatorTID ());
        
        //I think some switch should be here
 switch(angle)//New switch, because there wasn´t one
 {//add
	case 1: //Cases require switches to work
		// Firebat
		if(GetActorProperty(0,APROP_Health) >= 1000)
			Spawn ("EjectedRaven", x, y, z, 0, angle);
		else
			Spawn ("DamagedRaven", x, y, z, 0, angle);
		break;
       //add a '}' here to close the switch case
	}
}//Need a new one because the up was closing the switch one
I don´t get it right, but well, no errors lol

EDIT: this didn´t worked because when you removed some parts you should have removed somethings that should stayed on the code xD

RE: Help with some basic ACS :V

Posted: Thu Apr 04, 2013 7:34 am
by Lollipop
Thank you all, you have really helped this noob out :P
This is an eject script for a custom aow mech, wich I'll have to change a bit to give a custom eject item instead of the usual one, but Again, thank you :D

EDIT: Just noticed that the script refuse to Work, I got it in a LOADACS lump, wich loads the acs file, but if I activate teh script in any way, nothing happens :V