Help with some basic ACS :V

Discuss all aspects related to modding Zandronum here.
Post Reply
Lollipop
Zandrone
Posts: 1124
Joined: Tue Jul 24, 2012 10:34 am
Location: Denmark

Help with some basic ACS :V

#1

Post by Lollipop » Wed Apr 03, 2013 6:30 pm

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
Combinebobnt wrote:i can see the forum league is taking off much better than the ctf ones
GalactusToday at 1:07 PM
are you getting uncomfortable jap
feeling something happen down there

Ijon Tichy
Frequent Poster Miles card holder
Posts: 901
Joined: Mon Jun 04, 2012 5:07 am

RE: Help with some basic ACS :V

#2

Post by Ijon Tichy » Wed Apr 03, 2013 6:33 pm

first off, use [ code ]

second off, where the hell is your switch block

Lollipop
Zandrone
Posts: 1124
Joined: Tue Jul 24, 2012 10:34 am
Location: Denmark

RE: Help with some basic ACS :V

#3

Post by Lollipop » Wed Apr 03, 2013 6:35 pm

well, the what? I think I removed the thing?...
Combinebobnt wrote:i can see the forum league is taking off much better than the ctf ones
GalactusToday at 1:07 PM
are you getting uncomfortable jap
feeling something happen down there

xrgman
 
Posts: 43
Joined: Mon Feb 25, 2013 12:04 pm
Location: about 1,4 KM away from stiff

RE: Help with some basic ACS :V

#4

Post by xrgman » Wed Apr 03, 2013 8:31 pm

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!
Last edited by xrgman on Wed Apr 03, 2013 8:36 pm, edited 1 time in total.

User avatar
ibm5155
Addicted to Zandronum
Posts: 1641
Joined: Tue Jun 05, 2012 9:32 pm
Location: Somewhere, over the rainbow

RE: Help with some basic ACS :V

#5

Post by ibm5155 » Wed Apr 03, 2013 9:05 pm

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
Last edited by ibm5155 on Wed Apr 03, 2013 9:08 pm, edited 1 time in total.
Projects
Cursed Maze: DONE, V2.0
Zombie Horde - ZM09 map update: [3/15/13]
Need help with English? Then you've come to the right place!

<this post is proof of "Decline">

Lollipop
Zandrone
Posts: 1124
Joined: Tue Jul 24, 2012 10:34 am
Location: Denmark

RE: Help with some basic ACS :V

#6

Post by Lollipop » Thu Apr 04, 2013 7:34 am

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
Last edited by Lollipop on Thu Apr 04, 2013 8:31 am, edited 1 time in total.
Combinebobnt wrote:i can see the forum league is taking off much better than the ctf ones
GalactusToday at 1:07 PM
are you getting uncomfortable jap
feeling something happen down there

Post Reply