Ouchface
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 > Special Interest > Eternity > Small Script
 
Author
All times are GMT. The time now is 06:40. Post New Thread    Post A Reply
NokturnuS
Mini-Member


Posts: 58
Registered: 05-00


Hi

Need some help. Are there any examples showing how mapthing TIDs interact with Small scripts (like lower a floor when some demons are killed, spawn a monster/powerup when other is killed, etc.) ?
Try to search but found none.

Thanks for your time.

Cya!

Old Post 12-01-05 21:57 #
NokturnuS is offline Profile || Blog || Email || Search || Add Buddy Report to mod || IP || Edit/Delete || Quote
JoelMurdoch
Should know better by now


Posts: 656
Registered: 02-02


Hey man, long time no see.

I think the trick would be to use EDF to call a Small function with one of the death frames. Just make a custom monster if you have to, it's no big deal.

Or is there an easier way James?

Old Post 12-02-05 07:10 #
JoelMurdoch is offline Profile || Blog || PM || Email || Search || Add Buddy Report to mod || IP || Edit/Delete || Quote
NokturnuS
Mini-Member


Posts: 58
Registered: 05-00


Hi Joel, long time indeed...

Making via EDF is easy, using LineEffect or even Startscript codepointers. Problem is, the action affects all the monsters of the same type and the sector action is activated when any of them die. I think this is the point to have TIDs so you can assign the action to only a specific demon. I may have 20 Hell Knights on the level but only killing 2 of them, spawning via ExtraData, some sector action is activated. I think this can be achieved via Small scripts.

Thank you!

Old Post 12-02-05 15:32 #
NokturnuS is offline Profile || Blog || Email || Search || Add Buddy Report to mod || IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 2202
Registered: 08-00


Right now, the only way to start an action after a particular set of monsters died would be to have all such monsters use a StartScript in their death frames like Joel suggested.

The trick is to create a global variable in your script that counts the number of deaths, but only if the trigger object's TRUE tid (not _TID_TRIGGER) is a certain value. It could look something like this:

code:
enum { DEMON_TID_1 = 999, DEMON_TID_2, DEMON_TID_3, NUM_DEMONS = 3 } new NumDemonsDead = 0; public OnDemonDeath() { new tid = _GetThingSrc(); // NOTE: switch statements do not // fall through cases in Small! switch(tid) { case DEMON_TID_1: ++NumDemonsDead; case DEMON_TID_2: ++NumDemonsDead; case DEMON_TID_3: ++NumDemonsDead; } if(NumDemonsDead == NUM_DEMONS) // Do anything here }


I suggest using some special TID value like I have here if you intend to put this into the GlobalScript and use it on multiple maps. Otherwise, the behavior will be bound to an individual map's data, which may not be what you want.

(BTW, by having monsters call LevelScripts, you can certainly have differing monster behavior per map, but you must be sure to define all the scripts for all your maps)

Old Post 12-02-05 16:47 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy Report to mod || IP || Edit/Delete || Quote
NokturnuS
Mini-Member


Posts: 58
Registered: 05-00


Cool, gonna try this. With EDF i have no problem creating a monster looking exactly like a existing one but with startscript frames. Only worried by the infight issue, but i'll see.

Thanks very much!

Old Post 12-04-05 06:12 #
NokturnuS is offline Profile || Blog || Email || Search || Add Buddy Report to mod || IP || Edit/Delete || Quote
All times are GMT. The time now is 06:40. Post New Thread    Post A Reply
 
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Special Interest > Eternity > Small Script

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