Go Back   Angband Forums > Angband > Variants

Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old July 30, 2012, 15:24   #11
Derakon's Avatar
Join Date: Dec 2009
Posts: 8,470
Derakon is on a distinguished road
You could have multiple filter functions even in C, but you'd want a switch statement or something similar to select which one to call. In any event I'm happy to provide a wall to bounce ideas off of.

Even in Pyrel I won't be sticking the actual code into the creature record; the creature record will name the function it wants to use to filter its allocation, and that name will be mapped to the actual code to call.

I haven't coded much more up yet, since I was hung up on how to properly handle filter functions, especially those dealing with creatures before they get allocated. I wanted to leverage the Proc system I had (since Filters are basically Procs that change game flow instead of modifying game state), but Proc functions are self-contained entities that don't actually exist until their associated Thing is created. Using Procs to control creature allocation would thus require me to instantiate one of every creature every time I build an allocation table, just so I can decide if that creature should be usable. That's no good.

I spent some time talking it over with a friend, and he suggested that certain Procs should be "static" (i.e. attached to that class of creatures as a whole, not to a specific one), as determined by their trigger condition (i.e. when they are called). In Pyrel terms this means that the CreatureFactory would have procs associated with it, instead of the Creatures it makes having those Procs. I haven't yet thought of a reason why this couldn't work, so next chance I get I'll be implementing it to see how it flies.
Derakon is offline   Reply With Quote

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Pyrel dev log Derakon Variants 64 June 8, 2012 10:58
Play FAangband part II Fendell Orcbane AAR 6 November 29, 2010 20:53
JBand progress log. PaulBlay Development 38 June 27, 2009 09:19
Quill, Part II Sirridan AAR 9 June 25, 2009 03:51
Angband/65 development log PaulBlay Development 0 April 16, 2009 18:55

All times are GMT +1. The time now is 23:50.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.