Demon
Register | User Profile | Member List | F.A.Q | Privacy Policy | New Blog | Search Forums | Forums Home
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Doom Editing > Few questions about ACS script
 
Author
All times are GMT. The time now is 15:08. Post New Thread    Post A Reply
ExIm
Warming Up


Posts: 17
Registered: 09-11


I have been writing ACS script to make events in my map for a while but I still have something that I curious about.

1. If it possible to declare Class like in programming languages that support object-oriented or Subroutine other than script and function?
Well, from my research, the first one may not possible but I want to know if there a way to make something similar to it.
For the subroutine (the function that return nothing), I know that it can be done with script but I don't like a bit that it has to be bounded with number. In my map, there are many scripts in it and sometimes I have a problem to rearrange the script number (I want the scripts with similar action to be together). Maybe I should add this to wishlist (script that can be declared with name, number and both together)?

2. How can I get the number of members in array? Is there any function like .length or .count? Or I have to define it myself?

3. Some imported ACS scripts don't show blue color in coding. This is not a big deal but I wonder why? It make me think the compiler doesn't know this script for the first time -_-"

4. Is there anyway to count the untagged projectiles (rocket, fireballs) that released from monsters and get their coordinates in specific tagged sector? I think this may be hard (or even not possible for now). I want to make the event related to this if possible.

Sorry if it seems like I complain and ask for something too much. I don't want to blame the developers since they have already done a great program for everyone to make Doom map with very easy way. It's ok for me now but it will be great if there are more features.

Old Post 10-14-11 16:28 #
ExIm is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Gez
Why don't I have a custom title by now?!


Posts: 7036
Registered: 07-07


I assume it's for ZDoom or a derivative, or maybe Vavoom. There's no other port at the moment which has both ACS and rockets.

ACS is very limited, and is definitely not an object-oriented language.

1. Nope. No classes, no structs, nothing. There's only one variable type in ACS, and it's int. Even the strings are really ints.
2. You're supposed to already know them. Arrays are static and will have the time they're given at compilation.
3. If you mean syntax highlighting, it just means that your configuration isn't up to date. Syntax highlighting is not made by the compiler.
4. Yes, with ThingCountNameSector or ThingCountSector.

Old Post 10-14-11 16:59 #
Gez is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
ExIm
Warming Up


Posts: 17
Registered: 09-11


Oh! Thanks a lot for info! Now I know more about ACS language. And thanks for ThingCount function (I used ZDoom in UDMF format).

Anyway, I forgot to ask another thing. As I said, right now my code have many scripts and that result in many lines of code in SCRIPT page. Can I separated these script to other pages? I have tried to create new file from toolbar but don't know how to link the pages (i.e. scripts don't be found if I place them in other pages).

Old Post 10-14-11 17:54 #
ExIm is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
EarthQuake
9.5 on the Richter!


Posts: 2745
Registered: 05-03


To link to other source files, using the #include directive, like when including zcommon.acs:

code:
#include "zcommon.acs" // Main definitions #include "myscripts1.acs" // Your stuff. #include "myscripts2.acs" #include "myscripts3.acs"


The contents of those files will literally be inserted where your include directives are, so make sure if you have any constants or variables, that you don't try to use them before declaring them. Sometimes it's easy to miss when using #includes.

Old Post 10-14-11 19:29 #
EarthQuake is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Gez
Why don't I have a custom title by now?!


Posts: 7036
Registered: 07-07


Yeah, but there are a few problems IIRC. For example I've heard that Doom Builder tends to delete these files, thinking they were the temporary files it created to feed them to the compiler. So be sure to keep backups, or mark them as read-only.

Old Post 10-14-11 19:33 #
Gez is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
EarthQuake
9.5 on the Richter!


Posts: 2745
Registered: 05-03


Ah, thanks. I don't use Doombuilder so I've not ran into such things. Honestly, I prefer compiling from the command line. :p

Old Post 10-14-11 19:34 #
EarthQuake is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
ExIm
Warming Up


Posts: 17
Registered: 09-11


Hmm. I must did something wrong here. I try to include my file but the error appears after compiling, saying that "Invalid Identifier" in zspecial.acs file (I think this is from SCRIPT page). Can you tell me in more detail about importing the file (like how to properly create a file, where or which folder to put a file).

http://img27.imageshack.us/img27/5789/doomiierrormsg.png

Old Post 10-15-11 05:07 #
ExIm is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Gez
Why don't I have a custom title by now?!


Posts: 7036
Registered: 07-07


They'll have to be in <your Doom Builder directory>\Compilers\ZDoom.

Old Post 10-15-11 05:39 #
Gez is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
ExIm
Warming Up


Posts: 17
Registered: 09-11


Still have the same problem even though I put it in the Complilers/ZDoom folder -_-" (I even tried to edit acc.cfg to include my file.)
Anyway, I decide not to separate the scripts for now because, although it is working, this means that when I release a wad I have to upload these files together with wad file in order to make it work (am I right?). And as you said, there may be a possibility that these files may be deleted by the program. I think I don't want to deal with that problem.

By the way, thanks you two very much!

Old Post 10-15-11 11:20 #
ExIm is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Edward850
Member


Posts: 325
Registered: 08-07


Have you accidentally included zcommon.acs twice? (Does Fafrotskies.acs also have '#include "zcommon.acs"'?)

Old Post 10-15-11 11:46 #
Edward850 is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
ExIm
Warming Up


Posts: 17
Registered: 09-11


Wow! That solve the error problem. I tried deleting #include zcommon.acs in main page and keep it in Fafrotskies.acs and it works! Thanks Edward.

Oh! And about bounding script with number, after I rethink about it I comes up with an idea. I declare a constant, use it as temporally script name, and assign script number to it. This way I can use ACS_Execute with script name. When I rearrange script numbers, I just have to change only 2 places: at value of constant and script number so it will be less problem for me now (but it should be better if I know this earlier, at this moment I almost reach 1000 lines of code -_-").

Old Post 10-15-11 13:45 #
ExIm is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
CodeImp
Moderator


Posts: 1461
Registered: 12-03


For the record: You don't have to put anything in your Complilers/ZDoom folder. You can put the .acs file in the same folder as your .wad file and the compiler should be able to find it there. Also, you can use subdirectories, but you will have to specify them in your #include statement ofcourse: #include "Map01Scripts\\Fafrotskies.acs"

Old Post 10-16-11 15:26 #
CodeImp is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
EarthQuake
9.5 on the Richter!


Posts: 2745
Registered: 05-03


Is that a rather new addition to ACC? I don't remember ACC accepting paths to files other than in the same directory.

Old Post 10-16-11 15:29 #
EarthQuake is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
CodeImp
Moderator


Posts: 1461
Registered: 12-03


Well it has been in there for a year or so I guess ;) I added it to make scripting in DB2 easier (so you don't have to mess around with paths). Although DB2 doesn't give you options for the include paths, it automatically provides the path of your .wad file as an "include path" where the compiler will look for includes.

Old Post 10-16-11 16:28 #
CodeImp is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
ExIm
Warming Up


Posts: 17
Registered: 09-11


I've tried putting Fafrotskies.acs in the same folder as my wad again, now fix the #include part, and it works. So, it's only the #include part that cause of this error message. No need to put a file in compilers folder. Thanks you guys :D

Old Post 10-17-11 16:40 #
ExIm is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
All times are GMT. The time now is 15:08. Post New Thread    Post A Reply
 
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Doom Editing > Few questions about ACS script

Show Printable Version | Email this Page | Subscribe to this Thread

 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are OFF
[IMG] code is ON
 

< Contact Us - Doomworld >

Powered by: vBulletin Version 2.2.5
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Forums Directory