ArtBrainer Posted April 21 Hello, I have a script here that doesn't really work, who knows why? As you can see, the monsters are not teleported into the room, the monsters are in a room that is completely different. #include "zcommon.acs" script 1 (void) { int i; int roomTID; // TID des Raums // Sucht nach dem Raum mit dem Tag "20" roomTID = FindActor("20"); // Wenn der Raum gefunden wurde if (roomTID != 0) { // Teleportiert 8 Monster mit dem Tag "4" in den Raum for (i = 0; i < 8; i++) { // Überprüft, ob ein Monster mit dem Tag "4" vorhanden ist if (ThingCountName("4") > 0) { // Holt die TID des nächsten Monsters mit dem Tag "4" int monsterTID = ActivatorTID(); // Wenn ein Monster mit dem Tag gefunden wurde, teleportiert es in den Raum if (monsterTID != 0) { Teleport(0, monsterTID, roomTID); } } } } // Öffnet 3 Türen mit den IDs 2, 3 und 4 Door_Open(2, 16, 1); Door_Open(3, 16, 1); Door_Open(4, 16, 1); } DAB 0 Quote Share this post Link to post
Kan3 Posted April 22 Yeah, well, it doesn't work because nothing in it actually makes sense D: script 1 (void) { int i; int roomTID; roomTID = FindActor("20"); //There's no ACS function called FindActor() if (roomTID != 0) { for (i = 0; i < 8; i++) //You're initializing a loop with int i but then you never use it { if (ThingCountName("4") > 0) //You're using ThingCountName wrong { int monsterTID = ActivatorTID(); if (monsterTID != 0) { Teleport(0, monsterTID, roomTID); //You're using Teleport wrong } } } } Door_Open(2, 16, 1); Door_Open(3, 16, 1); Door_Open(4, 16, 1); } https://zdoom.org/wiki/ThingCountName https://zdoom.org/wiki/Teleport 1 Quote Share this post Link to post
Gothic Posted April 22 I hope you're not asking ChatGPT to write your scripts. 3 Quote Share this post Link to post
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.