Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
ellmo

some small ACS help needed :)

Recommended Posts

Well, I've almost finished the first episode for my "Doom: Mercenaries" Project, I'm not sure whether this is going to get any further, but I hope it will.

The point os this thread is as follows, before I'm going to upload it to /newstuff I want to implement some ACS scripting, for there is none, although it's designed or ZDoom.

I'd like to ask anyone knowing ACS language, to provide me with a single script file for map e1m1 Ultimate Doom, which will display a HUD message, let's say "HUD MESSAGE", with big white characters like the ones used in "Doom:Redemption" whenever a new map is entered. And also a glod/yellow text displayed ("TEST MESSAGE") when player crosses a specified lineDef on the map with "execute_ACS" special...

Thanks for any help.

Share this post


Link to post

Thanks, UD, I appreaciate, but you see, I have no idea how I'm supposed to input this string into the file. Beacuse I saw things like "script OPEN" in the ACS files or something... I dunno how the scripting begins, I suppose there are some brackets {}

Could someone prepare a demonstartion file and send it to me e-mail ? I would be very grateful.

Share this post


Link to post

This is the entire script from Redemption E1M1:

#include "zcommon.acs"

Script 1 OPEN
{
        SetFont("BigFont");
        HudMessage(s:"Level 1: Beginning Of The End"; HUDMSG_TYPEON, 0, 9, 0.5, 0.1, 4.0, 0.03, 1.0);
}
the OPEN behind the script tells the game to execute this script upon level start.
If you want to have the same script to execute by triggering a special it would be:
#include "zcommon.acs"

Script 1(void)
{
        SetFont("BigFont");
        HudMessage(s:"Level 1: Beginning Of The End"; HUDMSG_TYPEON, 0, 9, 0.5, 0.1, 4.0, 0.03, 1.0);
}
and then use ACS_Execute(1,0,0,0,0) as the line's special.

Share this post


Link to post

Save the damned thing as an ACS script, download XWE, then...

1.create a new entry named anything,

2.Entry->replace with the marker selected...

3.Then run the map

Share this post


Link to post

It should be said that just because it's for ZDoom doesn't mean you have to have scripting of any kind in it.

Share this post


Link to post
ellmo said:

Thanks, UD, I appreaciate, but you see, I have no idea how I'm supposed to input this string into the file. Beacuse I saw things like "script OPEN" in the ACS files or something... I dunno how the scripting begins, I suppose there are some brackets {}

Could someone prepare a demonstartion file and send it to me e-mail ? I would be very grateful.

Ahh, I didn't know you knew nothing about scripting. Ok, here's the full thing:

script 1 OPEN
{
setfont ("BigFont");
hudmessage (s:"test message", 0, 0, CR_GOLD, 0.5, 0.5, 3.0);
}
This will run on map startup, and will print the message in the centre of the screen for 3 seconds.

Share this post


Link to post

Mhm, I think I got it. I tried the (void) script and it's working fine, but I still have problems with the Hud message. Think I'll have to try once more; altough I don't see any difference, ACS tells me about "missing colon" :P

Great thanks to all aof you!

DooMBoy said:

It should be said that just because it's for ZDoom doesn't mean you have to have scripting of any kind in it.

Chill out... It's time I should learn the basics anyway. And 'DooM:Mercenaries' will have just a few scrpits, and beacuse of my lack of skill, these will be on-screen informations only.

EDIT: Oh, and one more question: can I use the hudmessage script with no other parameters than the text string, and text color? Because If I leave something like that hudmessage (s:"message", CR_GOLD); i get an error.

Share this post


Link to post

Nope - all scripts (not just hudmessages) have to have the correct number of parameters (also called arguments), even if you're not using them (in which case make them 0). In the case of hudmessage, the parameters are:

hudmessage (s:"test message", 0, 0, CR_GOLD, 0.5, 0.5, 3.0);

Message type (0 = normal, 1 = type on, 2 = fade out)
Message ID (used for special features, not needed here)
Colour (gold here, can be a few others too)
X-coordinate of the message on screen (0 = far left, 1 = far right)
Y-coordinate of the message on screen (0 = top, 1 = bottom)
Time that the message stays on screen for (secs)
If using a message type 1 or 2, these parameters are different.

Share this post


Link to post

Geez, thanks UD. Now I got both those messages working fine, so there's map name and a short briefing on start (what the fuck I'm talking about? briefing must be short... brief=short)

Two more questions (I think I'll need it for further maps). If I wanted to make a dialogue between the player and a scripted marine, I guess I would have to use 'hudmessage' with different colours to indicate who's talking what. How do I make pauses between two messages? Is a command 'break;' okay? Let's say the message appears for 3.0 seconds, so can I make a break (3.5); in the same script and go on with more messages?

And Is there a simple tutorial on how to script those marines?

Share this post


Link to post

hudmessage (s:"you talk", 0, 0, CR_GREEN, 0.5, 0.5, 3.0);
delay(35*3.5);
hudmessage (s:"he talks", 0, 0, CR_BLUE, 0.5, 0.5, 3.0);
This will put a delay of 3.5 seconds between the two messages (script time is measured in tics - 1/35 sec - so you times it by 35 to get seconds)

Scripted marines are just monsters without weapons (unless you choose one that does have a weapon - grab up-to-date editing stuff if you haven't already got them) so you can do anything to them that you can do to a monster (activate/deactivate them, set them up on patrol routes, make them run a script when they die etc.) See the ZDoom site for editing info, tutorials and the forums (which are especially good for newer stuff).

Share this post


Link to post

So If I want to make a marine help me out with the monsters, I must allow him to pickup a weapon, and script him to hate monsters, right? And If he's supposed to go somewhere, there must be a map spot, or a patrol route?

I'll experience with Marines later. Now I want to announce, that with your great help UD, I'm releasing the first episode of "DooM:Mercenaries" which has 9 maps for the Knee Deep in the Dead of the Ultimate Doom, and some simple ACS scripting along with other ZDoom features. And yes! There are nine maps, no matter what is written on the page.

Grab it here: http://doomos.webpark.pl/index.html
Oh, and don't mind the screens, they are a bit obsolete, and not very informative.

Once again Ultimate, great thanks.

Share this post


Link to post

Scripted marines can't actually pick up weapons, but there are 2 ways to give them weapons:

1. There are 11 new scripted marines with weapons available in your editor (thing numbers 9101-9111), in addition to the weaponless one.

2. Use this special in a script, and apply it to a weaponless marine:

setmarineweapon (tag, weapon)
Weapon types are: (use the name or the number)

MARINEWEAPON_Dummy 0 (no weapon)
MARINEWEAPON_Fist 1
MARINEWEAPON_BerserkFist 2
MARINEWEAPON_Chainsaw 3
MARINEWEAPON_Pistol 4
MARINEWEAPON_Shotgun 5
MARINEWEAPON_SuperShotgun 6
MARINEWEAPON_Chaingun 7
MARINEWEAPON_RocketLauncher 8
MARINEWEAPON_PlasmaRifle 9
MARINEWEAPON_Railgun 10
MARINEWEAPON_BFG 11

Share this post


Link to post

LOL, I made my hero get killed in almost every available way while trying out the Railgun Scripted Marine. First, I made him just sit, wtihout a script, so he shot me on sight. Blam - ellmo's dead :)
I made a demon near him, thinking that when attacked by a demon, marine will help me in his own self-defence. I was mistaken. ellmo was again shot on sight.

Next I scripted the marine to hate the demon, so he killed it first, and then I was shot on sight LOL... Another attempt: I made the demon to hate the marine also, but the same thing happened (ellmo died). I made the Marine hate all monsters on map, and I made the script being restarted each 1 tick... Well, do you know what happens then? Guess you do, but what the hell - all monsters including the marine were travelling around the map with their speed about 10x faster, but since each frame was reset each 1/35 second, they couldn't do any harm to each other, for only one frame was displayed all the time :D

It really made me laugh. Maybe you'd like to see the effect, I could e-mail it to you UD.
Anyways, can you tell me what is supposed to be done, to make the marine rather help me, than kill me at sight?

Share this post


Link to post

Oh, so I was close. Do you know where can I find an index of ACS scripts? Not a tutorial, neither a demostration wad, just a plain index of options and scripts with explanations?

Share this post


Link to post
ellmo said:

Oh, so I was close. Do you know where can I find an index of ACS scripts? Not a tutorial, neither a demostration wad, just a plain index of options and scripts with explanations?

There is something on ZDoom.org. UNfortunately it is not well organized because there are currently 2 lists of specials. One is rather old and the other incomplete.

Share this post


Link to post

Can you point me out what should I do to order my actors (marines and monsters used in a cutscene) follow their paths correctly?! And what is the command for adding different colours to my scripted marines. They're all balck after all...

Share this post


Link to post

Yeah, and I spet one hell of a time trying to guess what does the Translation function do.

Thanks once again UD, stay tuned, for I'll have more questions coming soon... :D

Share this post


Link to post

Did you get the thing hating properly? If not, the correct script is:

Thing_Hate (tag, 5)
5 is the one that makes him hate the tag and ignore the player. If you want him to start looking for the hated before he's woken up, use 6 instead.

Unfortunately, marines often zigzag (like monsters) and sometimes lose their way on a path, milling around for a bit before finding the path again. (it's a ZDoom bug that can't be fixed)

Share this post


Link to post

er, thing_hate takes three arguments

thing_hate(hater, hated, type);

hater is who does the attacking/hunting, hated is the tid of things he hates, type describes how the hater behaves:

http://doom.vect.org:8080/acs/hate.txt

if you only pass it two args, like you described, it will use the default of 0 for the 3rd arg

if you want to make a monster totally ignore the player after he's already been woken (or in a room the player has already been in) just make him hate a non-existant tid (9999 or whatever) with hate type 5 or 6, then he'll just sit there and not care

Share this post


Link to post

Now, This is what I needed. Think you've been using arg no. 5 in Helm's Deep Cyb, right?

Great thanx.

Share this post


Link to post

actually I used type 6 (for the marines), since it doesn't require los, so enemies will hunt as long as the specified tid exists on the map. for the enemies I used type 4

Share this post


Link to post

ACS is fantastic, I made a small map with a grey Cyber helping you out with a pair of demons. That rocks, but unfortunately makes me think about starting another project, before I finish my actual :P

Share this post


Link to post

Yeah, I did start a new project.

I'm going to need a hand (or a pair :P) again. First, I read in Cyb's scripting tutorial that with Actor_Property I can change monsters speed. I guess it works only with ZDoom 2.0.48; Is the same with invetory_take/give and such?

And how do I make a script being run only once. I mean there's a bllody pond in my map and there's a Baron near it. When I cross pond's edge the Baron tells me to stay away of it, but he does this again every time I cross one of the LineDefs there, things like ACS_Terminate or Suspend just don't work. Any ideas how to turn of those damn scripts after playing them once?

Share this post


Link to post

1. Nope, the inventory specials work in earlier versions, but not that many of them. (I think it's 2.0.43 and up but I'm not sure)

2. Put a sector round the pool (if there already isn't one), and place an 'actor enters sector' thing (with a tid) in it. Set this thing's special to run the message script, but also make the script remove the 'actor enters sector' thing (so it can't be triggered again).

Share this post


Link to post

well if you have the script being executed by a line then you can just flag the linedef to not be repeatable, I dunno what editor you're using, but I'm pretty certain in most editors it's just a checkbox that says 'repeatable'

if it's being executed by a sector action thing (actor hits floor, or actor enters sector I assume) then give the sector action thing a tid and have the first line of the script remove it with thing_remove(tid)

edit: sorry I misread your post, it seems you have every line flagged to execute the script, you can do it the way ult doomer said (though creating a new sector isn't necessary) or something like:

int scr01 = 0;
script 1 (void)
{
   if(!scr01)
   {
      //do crap here
      scr01++;
   }
}
OR you can set all the lines to have the same lineid and then set their special with setlinespecial() in an open/enter script and then do:
script 1 (void)
{
   setlinespecial(lineid, 0);
   //do stuff here
}
etc, just giving you other possibilities heh

Share this post


Link to post

Cyb said:

int scr01 = 0;
script 1 (void)
{
   if(!scr01)
   {
      //do crap here
      scr01++;
   }
}

This checks if scr01 is equal to zero, and if it is, runs the script and then increases the scr01 with one point, so it's not zero anymore, so it won't be used again, right? Hm... I'll check it, the map's worth putting some serious ACS scripting work.

About the inventory, I don't think It runs probably on my maps. It's like:

Script 1 (void)
{
Inventory_Give ("shotgun", 1);
}

right? Well it does not work mith my scripts, as well as SetMarineSprite... are you sure those quotation marks are needed?

Share this post


Link to post

inventory (and any actor class for that matter, this goes for spawning things as well) items are case sensetive, it's "Shotgun", not "shotgun"; "Revenant" not "revenant" etc etc

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×