Spider Mastermind
Register | User Profile | Member List | F.A.Q | Privacy Policy | New Blog | Search Forums | Forums Home
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Doom Editing > [ACS] How to assign new thing ID to rockets
 
Author
All times are GMT. The time now is 15:13. Post New Thread    Post A Reply
ExIm
Warming Up


Posts: 17
Registered: 09-11


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.

Last edited by ExIm on 10-21-11 at 19:18

Old Post 10-21-11 18:59 #
ExIm is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Gez
Why don't I have a custom title by now?!


Posts: 7036
Registered: 07-07


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.

Old Post 10-21-11 19:58 #
Gez is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
ExIm
Warming Up


Posts: 17
Registered: 09-11


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 :(

Old Post 10-22-11 04:18 #
ExIm is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Gez
Why don't I have a custom title by now?!


Posts: 7036
Registered: 07-07


I mean in DECORATE.

code:
Actor TidRocket : Rocket replaces Rocket { States { Spawn TNT1 A 0 TNT1 A 0 ACS_ExecuteAlways(666) Goto Super::Spawn } }


Then in ACS:

code:
script 666 (void) { Thing_ChandeID(rocketid++); }

Old Post 10-22-11 07:51 #
Gez is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
ExIm
Warming Up


Posts: 17
Registered: 09-11


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.

Old Post 10-22-11 11:37 #
ExIm is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
ExIm
Warming Up


Posts: 17
Registered: 09-11


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?

Old Post 10-26-11 15:17 #
ExIm is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Gez
Why don't I have a custom title by now?!


Posts: 7036
Registered: 07-07


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.

Old Post 10-26-11 16:13 #
Gez is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
ExIm
Warming Up


Posts: 17
Registered: 09-11


It's work now. So the lump order is important too. Thanks again :D

Old Post 10-26-11 16:34 #
ExIm is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
All times are GMT. The time now is 15:13. Post New Thread    Post A Reply
 
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Doom Editing > [ACS] How to assign new thing ID to rockets

Show Printable Version | Email this Page | Subscribe to this Thread

 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are OFF
[IMG] code is ON
 

< Contact Us - Doomworld >

Powered by: vBulletin Version 2.2.5
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Forums Directory