Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
ViperGTS96

ACS is being dumb

Recommended Posts

ACS METHOD 1:

Script 961 (void)
{
PlaySound(0,"TAUNT1",CHAN_BODY,1,False,ATTN_NONE);
}

ACS METHOD 2:

Script 961 (void)
{
ThingSound(0,"TAUNT1",127);
}

ACS METHOD 3:

Script 961 (void)
{
AmbientSound("TAUNT1",127);
}

ACS FINAL METHOD:

#include "zcommon.acs"

Script 961 (void)
{
Thing_Remove(227);
SpawnSpotForced ("TAUNT1", 0, 227, 0);
}

DECORATE :

ACTOR TAUNT1 8422
{
States
{
Spawn:
TNT1 A 1 A_PlaySound("workdamnit",CHAN_BODY,1,True,ATTN_NONE)
Loop
}

SNDINFO : (workdamnit WRKDMNT)


(Tested Zandronum 2 & 3 & GZDoom)

If you summon the actor manually via the console it works fine. But if called with the scripts it either plays some other sound from a different script (no criss-crossed numbers or ids, I triple checked) or doesn't work at all. Same thing happens using any of the above ACS Methods.

Can ACS be this glitchy?

Any Ideas, thoughts?

Thanks

Share this post


Link to post

1. Is the latest version of the script compiled and loaded on the map that you're playing?
2. How is the script being called? Is the player actually the script's activator? If not, the "spottid 0" would not refer to him.
3. I'm not even sure if "spottid 0" refers to the activator of the script in spawn functions, I can't find it explicitly stated on zdoom wiki.
4. Put one more state into the DECORATE, right before the state that plays the sound. The very first state after an actor is spawned doesn't execute its action.

Share this post


Link to post

addkeysection "Special" SpecialKeysection

addmenukey "Play Sound" specialbind
alias specialbind "puke 78"
defaultbind J specialbind

script 78 (void)
{

AmbientSound("ThisWorks", 127);

}

This is in a different ACS script tho. Same thing in a new script and it doesn't work. I don't get it. Calling the scripts with keyconf.

just added #library "name" to each of my scripts didnt make a differnece. I'm noticing this get even weirder if I change their order in LoadACS . I am missing some key information it seems..?

Share this post


Link to post

So, is the script written into a specific map's SCRIPTS lump and compiled into the map's own BEHAVIOR lump (without being a library)? Or is the script written into a custom-named lump as a library, compiled into another custom-named lump, this compiled lump placed into ACS namespace (between A_START and A_END markers in a wad, or into an "acs" folder in a pk3), and loaded via LOADACS? It should be either one or the other.

Share this post


Link to post

I did not know that the first frame doesn't use actions. Very useful information! Thanks lol. I can prolly make it work with spawning sound actors, seems silly tho. I'd really like to know why the scripts are behaving so odd.

The Scripts are compiled into the ACS Folder in my pk3, and loaded with the LOADACS lump in the main directory.

Share this post


Link to post

Just making sure: You are actually putting the compiled bytecode versions of the scripts into the ACS folder, not their text-based source codes, right?

Share this post


Link to post

yep.

So I have no clue what happened but its all working now. Using the AmbientSound protocol in a script. I really wish it didn't because I still don't know what was holding it back..

Do the lumps have to be in order in the folder to match the loadacs order?

What could cause a library to erroneously read from another library?

Weird stuff..

Thanks for the help scifista42

Much appreciated.

Share this post


Link to post
ViperGTS96 said:

Do the lumps have to be in order in the folder to match the loadacs order?

What could cause a library to erroneously read from another library?

1. No.
2. I don't know. Just make sure that each of your libraries has a unique #library name, and that each compiled lump in your ACS folder has the exact same filename as the #library name of its source library (the zdoom wiki article makes it easy to miss that this is actually required).

Share this post


Link to post
ViperGTS96 said:

What could cause a library to erroneously read from another library?

If you do not define a library as a library (#library as the wiki page indicates) then its string table will be garbaged and use the core BEHAVIOR in its place, if it even exists, among other anomalies. For strings to work properly, their compiled table and references must much up, and that can only work if you tell the compiler in advance where they need to be, thus the library header.

Share this post


Link to post

A separate question still related to ACS:

I'd really like to change the player's view height for a specific weapon. APROPVIEWHEIGHT Doesn't work for me. I can morph into another actor and the height changes, but I get an empty screen (no hud or weapons) and can only look around. (No dice)

Anyway to do this?

Share this post


Link to post

If you want the player to always have a specific custom view height, create a new player class with a different value of Player.ViewHeight property.

If you want the player to only temporarily change his view height, use SetActorProperty with APROP_ViewHeight, while making sure that you have ZDoom 2.8.1 or later, because this feature doesn't work in older versions of the port.

Share this post


Link to post

I was trying to swap between two custom playerpawns.

I used the stable Zandronum 2.1.2

Will Aprop_Viewheight work in gzdoom or zandronum 3?

all the newer ports cause problems for my mod tho. zandronum 3 has no sound unless someone elses mod uses it.

Thanks again.

Share this post


Link to post
ViperGTS96 said:

I was trying to swap between two custom playerpawns.

Define each one as a separate player class, and use morphing to swap between them.

ViperGTS96 said:

Will Aprop_Viewheight work in gzdoom or zandronum 3?

Latest GZDoom: Yes.
Latest Zandronum: Maybe.

Share this post


Link to post

I forgot I can't even get it to compile in slade.

#library "SPECIAL"
#include "zcommon.acs"

Script 11 (void)
{
SetActorProperty(0,APROP_ViewHeight,32);
}

-----------------------
Error Report:
-----------------------

Line 76 in file "C:\Program Files (x86)\SLADE\temp\SPECIAL.acs" ...
C:\Program Files (x86)\SLADE\temp\SPECIAL.acs:76: aprop_viewheight : Identifier has not been declared.
> SetActorProperty(0,APROP_ViewHeight,3
> ^

Share this post


Link to post

your zspecial.acs is out of date

redownload acc from zdoom.org, it'll have the most recent zcommon/zspecial/zdefs files

Share this post


Link to post

Instead of adding yet another thread from myself, I figure it's better to add here.

I Have a pretty nice melee attacks script going, press f to punch, press b to boot (kick) . Only problem is when I melee a barrel or something that gives damage it freezes zandronum like a wobbled snes cartridge. lol . If I use Iddqd it doesn't freeze, so I know it's not liking the health while using melee.

Upon keypress the players inventory is stored, cleared then given the fist or boot, which is then used and then taken away. Then it restores inventory. I added the health and armor in too but it didn't help. the health and armor seem to stay and not change regardless of inventory change or clearing. They don't seem to be needed in the script. So I'm scratchin' my head a lil, something's missing.

*Tested a little further, I can take damage while melee attacking, its just the player's death that freezes it. (I let some zombiemen shoot me while I punched the wall)


*The regular inventory fist variation works just fine.

-------------------------------Solved-------------------------------------------

I found the issue. *Using a framerate of 0 with a loop in the deselect state causes the freezing. 1 tic per second minimum apparently.

Deselect:
KICK A 0 A_Lower
Loop

/\ (before)
\/ (after)

Deselect:
KICK A 1 A_Lower
Loop




Cheers!

Share this post


Link to post
ViperGTS96 said:

1 tic per second

It's not "tic per second", it's "delay before entering next frame" (in tics, where 1 tic = 1/35 of a second), where 0 would mean to enter the next frame immediately, causing an infinite loop (freezing the engine) if looped, and A_Lower is apparently so unfortunately implemented that looping it within the same tic (0 delay) would not lead to any progress (at least if the player was dead), therefore looping infinitely.

Share this post


Link to post

Not when you're dead, anyway. A_Lower can never deselect when you're dead in ZDoom, causing the state to become trapped if in a 0 tic loop. It'll work when the weapon is actually swapping, however.

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
×