P_Startscript Unknown Script

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
XASSASSINX
Posts: 377
Joined: Tue Dec 20, 2016 4:53 pm
Location: MURICAA BROTHER! Just kidding, Brazil.

P_Startscript Unknown Script

Post by XASSASSINX »

Hello everyone, I'm trying to run a script that if On, it spawns a baron of hell on a custom zombieman. (This is just a test, First time using custom Cvras and menu options). Hovewer, When i use A_JumpIf(CallACS), I get this error:

"P_StartScript: Unknown Script "Cl_Mancubus".

I have the whole menu On and Off defined. Why do i get that? It's just a simple option that jumps to the state if it's on then spawn a baron of hell. Here's the script:

Code: Select all

  Spawn:
 TNT1 A 0 
 Goto CheckSurprise
  CheckSurprise:
TNT1 A 0 A_JumpIf(CallACS("Cl_Mancubus") == 1, "SpawnRegular") 
 Goto Surprise
  SpawnRegular:
 POSS AB 10 A_Look
 Loop 
 Surprise:
 POSS A 4 A_SpawnItemEx("DoomImp", 2,  25, 10)
 Goto SpawnRegular
Any help??
User avatar
TDRR
Posts: 815
Joined: Sun Mar 11, 2018 4:15 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Debian 12/ Manjaro
Graphics Processor: nVidia with Vulkan support
Location: Venezuela

Re: P_Startscript Unknown Script

Post by TDRR »

XASSASSINX wrote:Hello everyone, I'm trying to run a script that if On, it spawns a baron of hell on a custom zombieman. (This is just a test, First time using custom Cvras and menu options). Hovewer, When i use A_JumpIf(CallACS), I get this error:

"P_StartScript: Unknown Script "Cl_Mancubus".

I have the whole menu On and Off defined. Why do i get that? It's just a simple option that jumps to the state if it's on then spawn a baron of hell. Here's the script:

Code: Select all

  Spawn:
 TNT1 A 0 
 Goto CheckSurprise
  CheckSurprise:
TNT1 A 0 A_JumpIf(CallACS("Cl_Mancubus") == 1, "SpawnRegular") 
 Goto Surprise
  SpawnRegular:
 POSS AB 10 A_Look
 Loop 
 Surprise:
 POSS A 4 A_SpawnItemEx("DoomImp", 2,  25, 10)
 Goto SpawnRegular
Any help??
The script name in the ACS source has to be named inbetween quotes, you also need to use #library "insertthenameofthisfile" and create a file named LOADACS having the name of your ACS file. This is called using an ACS library, but real macho men call it Global ACS.
XASSASSINX
Posts: 377
Joined: Tue Dec 20, 2016 4:53 pm
Location: MURICAA BROTHER! Just kidding, Brazil.

Re: P_Startscript Unknown Script

Post by XASSASSINX »

Yeeahhh... Problem is, It's not really a script. It's just a Cvar. I'm studying colorfullhell custom options menu and trying to make my own. First time using it. The script is just a Cvar, not really a

Script 1 open blabla stuff, But still, does that count as script?
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

Re: P_Startscript Unknown Script

Post by wildweasel »

What does your ACS source look like?
User avatar
TDRR
Posts: 815
Joined: Sun Mar 11, 2018 4:15 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Debian 12/ Manjaro
Graphics Processor: nVidia with Vulkan support
Location: Venezuela

Re: P_Startscript Unknown Script

Post by TDRR »

Then just use GetCvar instead of CallACS.

The ACS method is only useful if you are going for Zandronum support, otherwise just use GetCvar which is slightly faster than ACS.
XASSASSINX
Posts: 377
Joined: Tue Dec 20, 2016 4:53 pm
Location: MURICAA BROTHER! Just kidding, Brazil.

Re: P_Startscript Unknown Script

Post by XASSASSINX »

YESSS! That's exactly what i was looking for. "A_JumpIfCvar". I was looking for something like that, but i couldn't find it anywhere. Thanks man!
XASSASSINX
Posts: 377
Joined: Tue Dec 20, 2016 4:53 pm
Location: MURICAA BROTHER! Just kidding, Brazil.

Re: P_Startscript Unknown Script

Post by XASSASSINX »

No... Wait what?? Is something wrong with the A_SpawnItemEx? Why it still not spawning?

Code: Select all

  Spawn:
 TNT1 A 0 
 Goto CheckSurprise
  CheckSurprise:
TNT1 A 3 A_JumpIf(GetCvar("Cl_Mancubus") == 0, "SpawnRegular") 
 Goto Surprise
  SpawnRegular:
 POSS AB 10 A_Look
 Loop 
 Surprise:
 POSS A 4 A_SpawnItemEx("DoomImpNewAi")
 Goto SpawnRegular
So... Yeah, I'm trying to use like this:

Code: Select all

TNT1 A 0 GetCvar("Ml_mancubus")
Now it goes to Death state (Which i put to on). How do i make it so it does not go there?

Code: Select all

TNT1 A 3 GetCvar("Ml_Mancubus")
 Goto Death
User avatar
TDRR
Posts: 815
Joined: Sun Mar 11, 2018 4:15 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Debian 12/ Manjaro
Graphics Processor: nVidia with Vulkan support
Location: Venezuela

Re: P_Startscript Unknown Script

Post by TDRR »

"GetCvar("Ml_mancubus")" Won't work. It HAS to be A_JumpIf(GetCvar("Cl_Mancubus") == 0, "SpawnRegular")

Also this doesn't make much sense, what does each state do? I can't see any sense in this code.
XASSASSINX
Posts: 377
Joined: Tue Dec 20, 2016 4:53 pm
Location: MURICAA BROTHER! Just kidding, Brazil.

Re: P_Startscript Unknown Script

Post by XASSASSINX »

Okay. Let me break into pieces.

Code: Select all

Spawn:
 TNT1 A 0 
 Goto CheckSurprise
When he spawn, he immediatlys goes to the state that checks the "Surprise" (Spawning imp or no.)

Code: Select all

CheckSurprise:
TNT1 A 3 A_JumpIf(GetCvar("Cl_Mancubus") == 0, "SpawnRegular") 
 Goto Surprise
This state checks the Cvar. If it's on 0, it puts the regular Zombieman spawn state, Otherwise, it goes to the Imp spawning state.

Code: Select all

SpawnRegular:
 POSS AB 10 A_Look
 Loop 
A Crtl+c and Crlt+v of the Zombieman spawn state. Nothing else.

Code: Select all

Surprise:
 POSS A 4 A_SpawnItemEx("DoomImpNewAi")
 Goto SpawnRegular
Now THIS is the state that he spawns the Imp. Or at least he's supposed to. Nothing happens, as if he just goes to the regular Spawn state without checking the Cvar.
User avatar
TDRR
Posts: 815
Joined: Sun Mar 11, 2018 4:15 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Debian 12/ Manjaro
Graphics Processor: nVidia with Vulkan support
Location: Venezuela

Re: P_Startscript Unknown Script

Post by TDRR »

XASSASSINX wrote:Okay. Let me break into pieces.

Code: Select all

Spawn:
 TNT1 A 0 
 Goto CheckSurprise
When he spawn, he immediatlys goes to the state that checks the "Surprise" (Spawning imp or no.)

Code: Select all

CheckSurprise:
TNT1 A 3 A_JumpIf(GetCvar("Cl_Mancubus") == 0, "SpawnRegular") 
 Goto Surprise
This state checks the Cvar. If it's on 0, it puts the regular Zombieman spawn state, Otherwise, it goes to the Imp spawning state.

Code: Select all

SpawnRegular:
 POSS AB 10 A_Look
 Loop 
A Crtl+c and Crlt+v of the Zombieman spawn state. Nothing else.

Code: Select all

Surprise:
 POSS A 4 A_SpawnItemEx("DoomImpNewAi")
 Goto SpawnRegular
Now THIS is the state that he spawns the Imp. Or at least he's supposed to. Nothing happens, as if he just goes to the regular Spawn state without checking the Cvar.
Do you have this CVAR defined in CVARINFO?
XASSASSINX
Posts: 377
Joined: Tue Dec 20, 2016 4:53 pm
Location: MURICAA BROTHER! Just kidding, Brazil.

Re: P_Startscript Unknown Script

Post by XASSASSINX »

Yeah, here it is:

Code: Select all

user int cl_Mancubus = 1;
User avatar
TDRR
Posts: 815
Joined: Sun Mar 11, 2018 4:15 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Debian 12/ Manjaro
Graphics Processor: nVidia with Vulkan support
Location: Venezuela

Re: P_Startscript Unknown Script

Post by TDRR »

My only advice would be:

In CVARINFO, you should define the cvar as a bool, and replace 1 by "TRUE"
Invert the rules for the toggle: Have it check if cl_mancubus is on 1 and go to surprise if that's the case, if not, go to spawnregular.

If not then you may need to send me the PK3 so i can further investigate the problem, right now there's nothing outright visible that would make it not work.
XASSASSINX
Posts: 377
Joined: Tue Dec 20, 2016 4:53 pm
Location: MURICAA BROTHER! Just kidding, Brazil.

Re: P_Startscript Unknown Script

Post by XASSASSINX »

Damn its been over a year since i entered here... Anyways, i changed some minor stuff and now it looks like this:

Code: Select all

  Spawn:
 TNT1 A 0 
 Goto CheckSurprise
  CheckSurprise:
TNT1 A 3 A_JumpIf(GetCvar("Cl_Mancubus") == 0, "SpawnRegular") 
 Goto Surprise
  SpawnRegular:
 POSS AB 10 A_Look
 Loop 
 Surprise:
 POSS A 4 A_SpawnItemEx("DoomImpNewAi")
 Goto SpawnRegular
the Cvar Info looks like this:

Code: Select all

user int cl_Mancubus = "1";
And that's it. I don't know any more things to fix. Hovewer there is one more thing that i don't know if i said or not. In the Console whenever i boot up with the mod it says this:

"Could not find autoloaded ACS Library script".

If you wanna the .wad, just tell me.
User avatar
TDRR
Posts: 815
Joined: Sun Mar 11, 2018 4:15 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Debian 12/ Manjaro
Graphics Processor: nVidia with Vulkan support
Location: Venezuela

Re: P_Startscript Unknown Script

Post by TDRR »

Send it in, and i will tell you exactly what isn't working.
User avatar
Void Weaver
Posts: 724
Joined: Thu Dec 18, 2014 7:15 am
Contact:

Re: P_Startscript Unknown Script

Post by Void Weaver »

XASSASSINX wrote:TNT1 A 3 A_JumpIf(GetCvar("Cl_Mancubus") == 0, "SpawnRegular")
This one, in case if the wiki info is correct:
Seems that I got clash with a similar trouble.

So, IIUC in such case you should use GetCVar (ACS) or GetUserCVar instead.
Btw, whenever you spawn monster-actor via _SpawnItem, then better to set appropriate un-safety flag:

Code: Select all

POSS A 4 A_SpawnItemEx("DoomImpNewAi",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION)
Post Reply

Return to “Scripting”