Mad Dal 85 Posted September 9 I'm trying to write a script that starts the moment the level starts, but this is what I get. Anyone any ideas what I am doing wrong? 0 Share this post Link to post
2 QuotePilgrim Posted September 9 I'm pretty sure it needs to be script 1 ENTER, no parenthesis. 2 Share this post Link to post
1 msx2plus Posted September 9 1 hour ago, Mad Dal 85 said: the custom monster won't spawn. Any ideas why that is? Standard Doom monsters will but not custom monsters. the coordinates in Spawn are fixed point. add a .0 to each of them 0 Share this post Link to post
1 Gothic Posted September 9 55 minutes ago, Doom-X-Machina said: https://zdoom.org/wiki/Thing_Spawn Does your customer monster have a SpawnID number in it's DECORATE file? Spawn does not need a SpawnID, just the actor/class name. 0 Share this post Link to post
1 Xaser Posted September 11 (edited) Almost everyone in this thread is missing the forest for the trees. For what the OP is trying to do in their map, the function they ought to be using is SpawnSpotFacing, not Spawn or Thing_Spawn or anything else -- they already have a MapSpot with a TID of 1 placed at the desired location, and spawning stuff at a map spot is preferable in the vast majority of circumstances since you can move it around freely without having to futz with all the manual coordinate nonsense in the script itself. Way simpler to set up, too -- no transcribing of numbers. Regular ol' Spawn is for when you want to do some fancy stuff like spawn FX in the general vicinity of something, rather than directly at an exact point; for general monster "summoning" purposes, SpawnSpotFacing is your bread and butter. [Thing_Spawn and SpawnIDs are ancient; nobody should be using these in 2024 unless they're targeting vanilla Hexen or a very very old port of some sort. Nobody is going to know what spawning a "79" means unless you leave a comment or #define something, at which point you may as well have used the actor name and saved yourself the extra steps.] 0 Share this post Link to post
0 Doom-X-Machina Posted September 9 Yep. ENTER and OPEN scripts have no parenthesis, but VOID scripts do. Took me a while to work that out myself when I started working with ACS. 1 Share this post Link to post
0 Mad Dal 85 Posted September 9 the custom monster won't spawn. Any ideas why that is? Standard Doom monsters will but not custom monsters. 0 Share this post Link to post
0 Doom-X-Machina Posted September 9 18 minutes ago, Mad Dal 85 said: the custom monster won't spawn. Any ideas why that is? Standard Doom monsters will but not custom monsters. https://zdoom.org/wiki/Thing_Spawn Does your customer monster have a SpawnID number in it's DECORATE file? 0 Share this post Link to post
0 jaeden Posted September 9 (edited) The condition may be the issue: Do you have at least two ChangeToken1 items? Didn't you mean to compare with '>=' instead of '>' ? Spawning function should also use fixed point coordinates. 0 Share this post Link to post
0 Mad Dal 85 Posted September 9 2 hours ago, Doom-X-Machina said: https://zdoom.org/wiki/Thing_Spawn Does your customer monster have a SpawnID number in it's DECORATE file? yes it does. Should I remove that? 0 Share this post Link to post
0 Mad Dal 85 Posted September 9 1 hour ago, msx2plus said: the coordinates in Spawn are fixed point. add a .0 to each of them I'll give that a try. 0 Share this post Link to post
0 Doom-X-Machina Posted September 10 10 hours ago, Mad Dal 85 said: yes it does. Should I remove that? Definitely NOT, it's required for Spawn_Thing strings. Did you not read the link I posted? 0 Share this post Link to post
0 jaeden Posted September 10 5 hours ago, Doom-X-Machina said: Definitely NOT, it's required for Spawn_Thing strings. Did you not read the link I posted? The function in link is irrelevant to OP, as he is using function Spawn, not Thing_Spawn. Spawn uses class name, not SpawnID number, so the SpawnID is not required for anything here (though removing it will not help anything). 0 Share this post Link to post
0 Mad Dal 85 Posted September 10 None of it is working. I'm starting to think custom monsters cannot be spawned into maps through ACS Scripting 0 Share this post Link to post
0 Mad Dal 85 Posted September 10 I've tried many different ways as directed on Zdoom Wiki and nothing is working. 0 Share this post Link to post
0 Redneckerz Posted September 10 36 minutes ago, Mad Dal 85 said: I've tried many different ways as directed on Zdoom Wiki and nothing is working. Translation: It isn't working because it wasn't implemented properly. Please post the script. You would be surprised how many it isn't working errors come down to parenthesis and syntax errors. 0 Share this post Link to post
0 Mad Dal 85 Posted September 10 (edited) Here, if you know how to fix it, be my guest.https://www.dropbox.com/scl/fi/1rwf3efevev11bcwppsnm/TextToken2B.pk3?rlkey=29eisyg55fwg64986u383piwa&st=ndyl0g7q&dl=0 0 Share this post Link to post
0 Doom-X-Machina Posted September 10 2 hours ago, Mad Dal 85 said: None of it is working. I'm starting to think custom monsters cannot be spawned into maps through ACS Scripting Yes they can. I do it all the time. And not just with monsters. It works with any actor that has a SpawnID number in it's DECORATE file. Thing_Spawn (X, SPAWNID, Y, Z); X is the mapspot tag to spawn it, SpawnID is assigned in the monster's DECORATE, Y is the byte angle to spawn it at and Z is if you want to assign a new tag to the monster after it spawns. 5 hours ago, jaeden said: The function in link is irrelevant to OP, as he is using function Spawn, not Thing_Spawn. Spawn uses class name, not SpawnID number, so the SpawnID is not required for anything here (though removing it will not help anything). Aaaaaaaaaaaaaaand it's not working so MAAAAAAAAAAAAYBE try another string option? There's more than one way to skin a cat. And if there's anything I've learnt in the last half decade with ACS is that there are multiple ways to achieve the exact same thing in a lot of instances. 0 Share this post Link to post
0 Mad Dal 85 Posted September 10 what part of "i have tried everything" isn't sinking in? i've posted the link to the test file (maps included) so if you want to fix it so i know how it's did in future, go for it. Monsters already in Doom can spawn but not the custom ones. So be my guest and show me how it's done seeing as you know everything and acting like I should already know what I am doing! 0 Share this post Link to post
0 jaeden Posted September 10 (edited) On 9/9/2024 at 4:41 PM, msx2plus said: the coordinates in Spawn are fixed point. add a .0 to each of them This is correct. And the token item should be derived from Inventory. Then it works for me. Tip for future: Use printinv console command to check if you actually have the token in your inventory. 0 Share this post Link to post
0 Mad Dal 85 Posted September 10 No custom monster has spawned, even with the item in the inventory using the 'printinv' in the console. 0 Share this post Link to post
0 Shepardus Posted September 10 You need to use fixed point, as @msx2plus pointed out earlier: On 9/9/2024 at 7:41 AM, msx2plus said: the coordinates in Spawn are fixed point. add a .0 to each of them 0 Share this post Link to post
0 Shepardus Posted September 11 Works for me if I get rid of the CheckInventory condition (not sure what you did to give yourself the "ChangeToken1"). Did you remember to save and recompile the script? The dot in the scripts tab in your script editor suggests that you haven't. 0 Share this post Link to post
0 Doom-X-Machina Posted September 11 (edited) 12 hours ago, Mad Dal 85 said: Monsters already in Doom can spawn but not the custom ones. So be my guest and show me how it's done seeing as you know everything and acting like I should already know what I am doing! Watch this. All those explosions... the flying debris... the tentacle orb... the sparks... the smoke... the portal.... ALL custom DECORATE actors (no different to a monster) activated via ACS with their SpawnID numbers. It IS possible. Here is the proof. I really do take umbridge to people telling me I'm wrong when I have proof, in writing, in code, in game that it DOES work. I spent about 30 minutes last night looking at your code in MAP03 and even after importing working code from my own WAD into yours, I could not get it work. I believe it may have something to do with your level progression setup and being able to jump from map to map via Linedef may be messing up the ability for the script to fire. Even changing it to a (VOID) script and setting it launch from a switch didn't activate it. There is something else amiss and unfortunately I didn't have any more time to spend on it as I have my own stuff to work on. But I assure you, as you can see above... custom actors CAN be spawned by ACS. Below is the code of that entire sequence. script 8 (Void) //ELEVATOR BOOM { ACS_Terminate (2, 8); SetLineBlocking (81, BLOCK_EVERYTHING); //BOOM Thing_SpawnNoFog (79, 158, 0, 0); //BIG BOOM AmbientSound ("SFX/SFXBOOM3", 127); Delay (8); AmbientSound ("SFX/SFXBOOM", 127); Delay (8); Thing_SpawnNoFog (80, 158, 0, 0); //BIG BOOM AmbientSound ("SFX/SFXBOOM2", 127); Delay (16); AmbientSound ("SFX/SFXBOOM2", 127); Thing_SpawnNoFog (12, 158, 0, 0); //BIG BOOM Thing_Activate (77); //BOOM SetLineTexture (64, SIDE_FRONT, TEXTURE_MIDDLE, "-"); //BOOM SetLineTexture (64, SIDE_BACK, TEXTURE_MIDDLE, "-"); //BOOM SetLineBlocking (64, BLOCK_NOTHING); //BOOM Thing_Remove (78); //LIGHTS OUT Delay (35); FloorAndCeiling_LowerByValue (39, 246, 2048); //ELEVATOR DROP AmbientSound ("SFX/ELEDROP", 127); Delay (8); AmbientSound ("SFX/FUCK", 127); Delay (65); Thing_SpawnNoFog (96, 300, 0, 0); //SMOKE Thing_SpawnNoFog (97, 300, 0, 0); //SMOKE Thing_Activate (40); //LOWER DOOR BOOM Thing_SpawnNoFog (88, 158, 0, 0); //BIG BOOM AmbientSound ("SFX/SFXBOOM3", 127); Delay (5); AmbientSound ("SFX/SFXBOOM", 127); FadeTo (0, 0, 0, 1.0, 0); //BLACKOUT SetPlayerProperty(1, 1, PROP_TOTALLYFROZEN); //FREEZE Delay (35*5); SetFont("BIGFONT"); HudMessage(s:"A SHORT TIME LATER..."; HUDMSG_TYPEON | HUDMSG_LOG, 1, CR_WHITE, 0.1, 0.9, 5.0); Delay (35*3); FadeTo (0, 0, 0, 0, 5.0); AmbientSound ("SFX/sfx004", 127); //DISTANT EXPLOSIONS Delay (35*5); SetPlayerProperty (0, 0, PROP_TOTALLYFROZEN); //UNFREEZE } Script 11 (void) //START WARPGATE { AmbientSound ("SFX/SFX001", 127); //COMPUTER Ceiling_LowerByValue (45, 16, 120); //CLOSE DOORS Thing_SpawnNoFog (85, 314, 0, 0); //SPAWN TENTACLE ChangeSky ("MARSORB", "MARSORB"); //CHANGE SKY Thing_Remove (40); //CLEAN UP DEBRIS Light_Fade (94, 160, 35*11); //LIGHT UP PORTAL Light_Fade (95, 160, 35*11); //LIGHT UP PORTAL Light_Fade (89, 255, 35*11); //LIGHT UP PORTAL RUNES Delay (35*3); AmbientSound ("SFX/SFX009", 127); SetLineTexture (10, SIDE_FRONT, TEXTURE_MIDDLE, "MCTC19A"); //TENTACLE CHAMBER Ceiling_RaiseByValue (86, 4, 196); //POWER RISE Delay (35*2); ChangeFloor (10, "MCTC291"); AmbientSound ("SFX/SFX009", 127); Delay (35*2); ChangeFloor (11, "MCTC291"); AmbientSound ("SFX/SFX009", 127); Thing_SpawnNoFog (92, 158, 0, 0); //ELEVATOR BOOM AmbientSound ("SFX/SFXBOOM", 127); //BOOM SetLineTexture (93, SIDE_FRONT, TEXTURE_MIDDLE, "DDUACG3"); //WINDOWS SMASH SetLineTexture (93, SIDE_BACK, TEXTURE_MIDDLE, "DDUACG3"); //WINDOWS SMASH SetLineTexture (9, SIDE_FRONT, TEXTURE_MIDDLE, "DDUACG3"); //WINDOWS SMASH SetLineTexture (9, SIDE_BACK, TEXTURE_MIDDLE, "DDUACG3"); //WINDOWS SMASH SetLineBlocking (93, BLOCK_NOTHING); //WINDOWS SMASH Thing_SpawnNoFog (6, 156, 0, 0); //STEAM Thing_SpawnNoFog (7, 157, 64, 100); //SPAWN SPARKERS Thing_SpawnNoFog (8, 157, 192, 100); //SPAWN SPARKERS Thing_SpawnNoFog (11, 157, 0, 101); //SPAWN SPARKERS Thing_SetSpecial (100, 0, 2, 512, 0); //ACTIVATE SPARKERS Thing_SetSpecial (101, 0, 0, 512, 0); //ACTIVATE SPARKERS Delay (35*2); ChangeFloor (13, "MCTC291"); AmbientSound ("SFX/SFX009", 127); Delay (35*2); ChangeFloor (14, "MCTC291"); AmbientSound ("SFX/SFX009", 127); Delay (35*2); Thing_SpawnNoFog (88, 170, 0, 88); //PORTAL Delay (35*1); ChangeCeiling (90, "F_SKY1"); //OPEN SKY ChangeCeiling (95, "F_SKY1"); //OPEN SKY ChangeFloor (90, "F_SKY1"); //OPEN FLOOR SetLineSpecial (89, ACS_Execute, 12); //SET EXIT LINES } script 12 (VOID) //EXIT { Thing_Remove (88); SetPlayerProperty(1, 1, PROP_TOTALLYFROZEN); //FREEZE FadeTo (255, 255, 255, 1.0, 5.0); //FADE TO WHITE Delay (35*2); AmbientSound ("SFX/SFXBOOM3", 127); Thing_SpawnNoFog (96, 158, 0, 0); //BOOM SetLineTexture (14, SIDE_FRONT, TEXTURE_MIDDLE, "DDUACG3"); //WINDOWS SMASH SetLineTexture (14, SIDE_BACK, TEXTURE_MIDDLE, "DDUACG3"); //WINDOWS SMASH Delay (35*1); AmbientSound ("SFX/SFXBOOM2", 127); Thing_SpawnNoFog (97, 158, 0, 0); //BOOM SetLineTexture (15, SIDE_FRONT, TEXTURE_MIDDLE, "DDUACG3"); //WINDOWS SMASH SetLineTexture (15, SIDE_BACK, TEXTURE_MIDDLE, "DDUACG3"); //WINDOWS SMASH Delay (35*5); Exit_Normal (0); //EXIT } Edited September 11 by Doom-X-Machina 0 Share this post Link to post
0 redEYE Posted September 11 On 9/9/2024 at 2:26 PM, Mad Dal 85 said: I'm trying to write a script that starts the moment the level starts, but this is what I get. Anyone any ideas what I am doing wrong? Two things that might play a part in this: Your wad is a hub? Then note that ENTER script is run only the very first time the player enters the map. If you don't have the item on the first time the monster will never be spawned even if you return to the map with the required inventory item. Secondly, the MAP03 script in the uploaded wad has this if clause. It might be outdated by now: script 1 ENTER { if (CheckInventory("ChangeToken1") >0) { Spawn("Sawcubus",-869,960,-48); } } It expects the player to have at least one ChangeToken1 but ... there's zero. It's not given to the player anywhere. By a script or thing. If it is replaced with this next in a normal gameplay started from MAP01 it'll print something at MAP03 and the sawcubus is spawned just fine. :P Fixed coordinates as msx2plus and jaeden suggested: script 1 ENTER { if (CheckInventory("ChangeToken1") == 0) { print(s:"hey, where's my ChangeToken1?!"); } Spawn("Sawcubus",-869.0, 960.0, -48.0); } 0 Share this post Link to post
0 Mad Dal 85 Posted September 11 fixed coordinates still do nothing as i have proved that already! Custom monsters do not spawn! 0 Share this post Link to post
0 redEYE Posted September 11 3 hours ago, Mad Dal 85 said: fixed coordinates still do nothing as i have proved that already! Custom monsters do not spawn! That's untrue. Here's one edit of the map. The sawcubus might spawn twice because the player starts MAP03 by facing a W1 script execute line which will run the ENTER script a second time. The spawn function should work if there are nothing to block the spawning monster. If you start walking right away the second sawcubus might be blocked. As Xaser said SpawnSpotFacing would be better. Make sure you don't test run it with -nomonsters on? Or have other mods that replace the 15000 sawcubus with an other item. Also in pk3 only the map files should be named as MAP01, MAP02, MAP03 and so on. Internally in UDB's F2 screen they all should have the level name "MAP01". Other ways warping to maps doesn't work. TextToken2B_(edited).zip 0 Share this post Link to post
0 Shepardus Posted September 11 3 hours ago, Mad Dal 85 said: tried it. still nothing. 3 hours ago, Mad Dal 85 said: fixed coordinates still do nothing as i have proved that already! Custom monsters do not spawn! As I said before, make sure you're compiling the script after editing it. You didn't do that for your previous video. Even if you put something that you know would work (like printing a message), it would do nothing if you don't compile the script. 0 Share this post Link to post
I'm trying to write a script that starts the moment the level starts, but this is what I get. Anyone any ideas what I am doing wrong?
Share this post
Link to post