ExIm Posted October 21, 2011 Well, it seems my problem hasn't been solved completely yet so I come here again for advice. Now I know that there is ThingCountSector to count number of my rockets in specific sector. My objective is to assign an ID to every rocket that has been launched (or spawned) and each one is unique. For example, when I fired the first rocket, it is assigned an ID of 1. And then if I fired another rocket, its tid will be 2, 3, 4... and so on. I tried using while(true) loop to check at anytime new rocket will be launched. If that occur, I taught I can use Thing_ChangeID to assign the id to it. However, when I used ThingCountSector to count the rocket with new tid, it showed 0 (that's mean it fail to assign the id). I even tried to change ID of myself (Player class) before executing this script but it still failed. FYI, I use ZDoom In UDMF format. 0 Share this post Link to post
Gez Posted October 21, 2011 If you really want every rocket to get a unique TID, you'll need to make a rocket replacement which will call ACS_ExecuteAlways right after its spawn state to run a script which calls Thing_ChangeID. You'll also need a global variable which is used as the new TID and increased by one each time the script is run. 0 Share this post Link to post
ExIm Posted October 22, 2011 What do you mean rocket replacement? Is it other thing like spawned dummy rocket? And how to make it to call the script by itself (I think if I place ACS_Execute line normally the activator should be the player right?) Right now, I have global variable that increase by one once a rocket is launched as you said. But I also want to know info of every rocket about its coordinate and movement (like speed, angle) so it will be useless if I can't assign id to the original one :( 0 Share this post Link to post
Gez Posted October 22, 2011 I mean in DECORATE. Actor TidRocket : Rocket replaces Rocket { States { Spawn TNT1 A 0 TNT1 A 0 ACS_ExecuteAlways(666) Goto Super::Spawn } }Then in ACS: script 666 (void) { Thing_ChandeID(rocketid++); } 0 Share this post Link to post
ExIm Posted October 22, 2011 Oh, I see. I'm not familiar with DECORATE so I don't know. Actually, I still working on my first map and don't even know how to edit things other than creating a map and write ACS script in Doom Builder 2 -_-" Just download SLADE 3. Got to learn this. 0 Share this post Link to post
ExIm Posted October 26, 2011 Now, I've finally manage to include your code into my wad and it works really fine. Thanks, Gez! Here is the result I made. http://www.youtube.com/watch?v=t7-T0Hi1T-w Anyway, I've a bit problem with SLADE. After I included DECORATE into my wad, I can't open it again in Doom Builder (there is no map to select) unless I delete DECORATE in my wad using SLADE. Is this normal or is there a way to open it in Doom Builder without deleting DECORATE? 0 Share this post Link to post
Gez Posted October 26, 2011 Make sure that the DECORATE lump in question is not between any map lump. It should be before the map label (e.g., "MAP01") or after the SCRIPTS lump; not anywhere in between. 0 Share this post Link to post
ExIm Posted October 26, 2011 It's work now. So the lump order is important too. Thanks again :D 0 Share this post Link to post