Please help with calling ACS in decorate - Working with flaw

Discuss all aspects related to modding Zandronum here.
User avatar
S_Andrew_S
 
Posts: 37
Joined: Fri May 29, 2015 11:21 pm
Location: San Nicholas Island
Contact:

Please help with calling ACS in decorate - Working with flaw

#1

Post by S_Andrew_S » Wed Apr 06, 2016 11:41 pm

I fixed it: please move. Although, I do wonder what tics would be good to ensure all monsters spawn, sometimes I'm still a few short one numbers over 20 it seems...

EDIT: Okay, now it all works 99%, but--- when going to the next level in a play through, Zand 2.1.1 crashes but --- quite ironically --- it crashed offline, not online. Even though it will be used mostly online, I still won't stand for this. I may have this fixed before anyone reads this, but hell, it's very ironic.
Last edited by S_Andrew_S on Mon Apr 11, 2016 11:55 pm, edited 14 times in total.

Catastrophe
Retired Staff / Community Team Member
Posts: 2569
Joined: Sat Jun 02, 2012 2:44 am

Re: Please help with calling ACS in decorate

#2

Post by Catastrophe » Wed Apr 06, 2016 11:48 pm

I'm guessing it works offline but not online?

User avatar
S_Andrew_S
 
Posts: 37
Joined: Fri May 29, 2015 11:21 pm
Location: San Nicholas Island
Contact:

Re: Please help with calling ACS in decorate

#3

Post by S_Andrew_S » Wed Apr 06, 2016 11:52 pm

Neither

Catastrophe
Retired Staff / Community Team Member
Posts: 2569
Joined: Sat Jun 02, 2012 2:44 am

Re: Please help with calling ACS in decorate

#4

Post by Catastrophe » Wed Apr 06, 2016 11:58 pm

I'm just curious, does it work if you call script 10000 with acs_executealways?

User avatar
S_Andrew_S
 
Posts: 37
Joined: Fri May 29, 2015 11:21 pm
Location: San Nicholas Island
Contact:

Re: Please help with calling ACS in decorate

#5

Post by S_Andrew_S » Thu Apr 07, 2016 12:02 am

It does not, also I did add the lump name into LOADACS in case anyone asks.

Catastrophe
Retired Staff / Community Team Member
Posts: 2569
Joined: Sat Jun 02, 2012 2:44 am

Re: Please help with calling ACS in decorate

#6

Post by Catastrophe » Thu Apr 07, 2016 12:16 am

So, 10001 works with acs_executealways but 10000 doesn't?

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

Re: Please help with calling ACS in decorate

#7

Post by ibm5155 » Thu Apr 07, 2016 12:20 am

Code: Select all

Script 10000 (void)
{
  int levelnum;
  levelnum = GetLevelInfo(LEVELINFO_LEVELNUM);
  printbold(d:levelnum);
  SetResultValue(levelnum);   
}
Does it work?

EDIT: you could also add some print codes for debug your decorate like
GTIK A 0 A_Print("You got the golden ticket! Escape to the chocolate factory!")
Last edited by ibm5155 on Thu Apr 07, 2016 12:23 am, 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">

User avatar
S_Andrew_S
 
Posts: 37
Joined: Fri May 29, 2015 11:21 pm
Location: San Nicholas Island
Contact:

Re: Please help with calling ACS in decorate

#8

Post by S_Andrew_S » Thu Apr 07, 2016 12:23 am

Nope. It does if I puke it however.

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

Re: Please help with calling ACS in decorate

#9

Post by ibm5155 » Thu Apr 07, 2016 12:27 am

If I understand, you cannot execute any code after SetResultValue being called (it's like a return from functions), so your print code was never called (printbold(d:levelnum); )
Also I belive there was something related about doing some code in the first Spawn frame (ignoring the one with zero tic)
Try this one

Code: Select all

TNT1 A 5 NoDelay A_JumpIf(ACS_ExecuteWithResult(10000) == 1, "Level1Spawn")
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">

User avatar
S_Andrew_S
 
Posts: 37
Joined: Fri May 29, 2015 11:21 pm
Location: San Nicholas Island
Contact:

Re: Please help with calling ACS in decorate

#10

Post by S_Andrew_S » Thu Apr 07, 2016 12:31 am

NoDelay appears to be unsupported by 2.1.2.

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

Re: Please help with calling ACS in decorate

#11

Post by ibm5155 » Thu Apr 07, 2016 12:45 am

(facepalm)

Code: Select all

Spawn:
         TNT1 A 1
         TNT1 A 4  A_JumpIf(ACS_ExecuteWithResult(10000) == 1, "Level1Spawn")
         (bunch of other checks)
         stop
It's 1 tic invisible, but it'll not hurt anyone
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">

User avatar
S_Andrew_S
 
Posts: 37
Joined: Fri May 29, 2015 11:21 pm
Location: San Nicholas Island
Contact:

Re: Please help with calling ACS in decorate

#12

Post by S_Andrew_S » Thu Apr 07, 2016 12:49 am

That doesn't work either. I'm under the impression it might be something stupid, like I forgot to add the decorate file or something.

User avatar
SwordGrunt
Forum Regular
Posts: 377
Joined: Thu Jun 07, 2012 8:43 pm

Re: Please help with calling ACS in decorate

#13

Post by SwordGrunt » Thu Apr 07, 2016 2:46 am

I'm pretty sure support for script numbers over 1000 was added alongside support for named scripts (ZDoom 2.7.1), which means it's not in the current official Zandronum version yet.

Change the script number to something like 900 instead and try it.

User avatar
S_Andrew_S
 
Posts: 37
Joined: Fri May 29, 2015 11:21 pm
Location: San Nicholas Island
Contact:

Re: Please help with calling ACS in decorate

#14

Post by S_Andrew_S » Thu Apr 07, 2016 3:58 am

I changed the script to 850 for the level number and 851 for the spawner. It still didn't work. The thing is, I made a horribly ugly script once that allowed one faction to be set for each level, it used the same numbers and worked. The only differences was what was being executed in the scripts. I have no idea why this has to be any different.

Catastrophe
Retired Staff / Community Team Member
Posts: 2569
Joined: Sat Jun 02, 2012 2:44 am

Re: Please help with calling ACS in decorate

#15

Post by Catastrophe » Thu Apr 07, 2016 5:17 am

Can you post the script that worked, and the one that didn't? Lets compare.

User avatar
S_Andrew_S
 
Posts: 37
Joined: Fri May 29, 2015 11:21 pm
Location: San Nicholas Island
Contact:

Re: Please help with calling ACS in decorate

#16

Post by S_Andrew_S » Thu Apr 07, 2016 5:29 am

Oh god, once you open this you will see why I want a less crude script
acs.zip
. Very crude, but it works, for the most part. The thing was, the original spawn system where every faction spawned at random only worked half of the time.

EDIT: Well, I did what IBM said and added the print line, yet it did not work. It appears it may not even be detecting the monsters, at all. I added #include "actors/Spawn/S-DOOMADV1.txt" (file name) in a decorate file. This issue has is pretty weird if you ask me, as if it doesn't want to work.
You do not have the required permissions to view the files attached to this post.

Catastrophe
Retired Staff / Community Team Member
Posts: 2569
Joined: Sat Jun 02, 2012 2:44 am

Re: Please help with calling ACS in decorate

#17

Post by Catastrophe » Fri Apr 08, 2016 1:16 am

Does ur original problem occur in zdoom?

User avatar
S_Andrew_S
 
Posts: 37
Joined: Fri May 29, 2015 11:21 pm
Location: San Nicholas Island
Contact:

Re: Please help with calling ACS in decorate

#18

Post by S_Andrew_S » Fri Apr 08, 2016 3:23 am

I just downloaded ZDoom 2.5, and I tried making this work there; it doesn't work on GZDoom 1.5 either; It still doesn't work. And if I puke script 10000 in my console, it will crash; GZDoom won't crash, however, it won't pull up the number. Zandronum pukes script 10000 correctly, however. GG ZDoom & GZDoom! Here is the test file by the way.

https://drive.google.com/file/d/0B2yXvg ... sp=sharing

EDIT: I remember that Zandronum 2.1 added support for scripts higher than 10000. So...

Catastrophe
Retired Staff / Community Team Member
Posts: 2569
Joined: Sat Jun 02, 2012 2:44 am

Re: Please help with calling ACS in decorate

#19

Post by Catastrophe » Fri Apr 08, 2016 5:19 am

You're definitely doing something wrong if it crashes on latest version of Zdoom.

User avatar
S_Andrew_S
 
Posts: 37
Joined: Fri May 29, 2015 11:21 pm
Location: San Nicholas Island
Contact:

Re: Please help with calling ACS in decorate

#20

Post by S_Andrew_S » Fri Apr 08, 2016 4:35 pm

I'm thinking it is a decorate issue. But what can it possibly be?

Post Reply