ACS string in functions call problems

Discuss all aspects related to modding Zandronum here.
Theshooter7
Forum Regular
Posts: 262
Joined: Wed Jun 06, 2012 2:15 am

RE: ACS string in functions call problems

#21

Post by Theshooter7 » Fri Jul 20, 2012 1:33 pm

Ijon Tichy wrote:
Theshooter7 wrote: Getting to this topic really late, but after seeing the first couple posts about the problem I knew right away it was because of the lack of #library. Way to go folks. :/
as someone who knows acs pretty well, what the hell does that have to do with anything? if it's being used through LOADACS and it doesn't have #library, why is it even being loaded? if it's a BEHAVIOR lump, why would it need #library?
itt: acs makes no goddamn sense at times
Yeah. It does that because it's ACS. :P It'll attempt to load whatever is in LOADACS, whether it is a library or not. It just seems that without #library, string tables are not setup correctly, along with a few other things. I actually ran into this issue recently myself when I forgot to add the library line and was getting hilarious results on different maps when trying to run a script.
Ijon Tichy wrote:I started off with python and came to ACS (and will end up learning C or D for unrelated reasons), does that count?
Sure. My point though is, with all the people ending up with silly, really simple questions like how you've stated, how many people are actually taking note from what they learn and are improving? I'm not starting any argument or anything (if you had that in mind by chance), I'm just genuinely curious. You don't get to be a guru at a programming language, or even a scripting language like ACS, without first learning things and getting better. Asking a thousand questions all the time doesn't help you, it just gets people to do the work for you (granted a question now and then never hurts but you get what I'm saying). Programming is something that takes research, patience, and above all, experimentation. The same applies for something like ACS.
Image

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

RE: ACS string in functions call problems

#22

Post by ibm5155 » Fri Jul 20, 2012 3:17 pm

I don´t anderstand alot but, i got some problens doing a function that you just put a string or char and it print what you whant, for some reason the number of all strings up, and then it converts to char lol, i solved that problem checking wit strlen if in the second work have the \o and then things went back working =D.

I really think in functions acs is easier than C itself, like it´s easier to a function call itself then in c

SickSadWorld
New User
Posts: 4
Joined: Fri Jul 20, 2012 3:59 am
Location: Not Skulltag
Contact:

RE: ACS string in functions call problems

#23

Post by SickSadWorld » Fri Aug 03, 2012 7:43 pm

Ijon Tichy wrote:
SickSadWorld wrote: Remember, ACS isn't a true programming language. I use case/ switch a lot but I'm not sure "default" is a valid keyword for the ACC compiler, as it typically is in real programming languages. That said, it's probably not the cause of your error but something to consider.
'default' is legal
What version of ACC are you using?

I tried it today for some unrelated reason and got

Code: Select all

Line 211 in file "/home/compaq/Downloads/acc/GLOBAL.acs" ...
/home/compaq/Downloads/acc/GLOBAL.acs:211: Syntax error in constant expression.
>  case default:
> 
I'm trying to figure out if it's an error with my approach, or version of ACC compiler.

Theshooter7
Forum Regular
Posts: 262
Joined: Wed Jun 06, 2012 2:15 am

RE: ACS string in functions call problems

#24

Post by Theshooter7 » Fri Aug 03, 2012 7:53 pm

Remove the word "case". It should just say:

Code: Select all

default:
Image

Post Reply