Page 1 of 1
[Done for V0.38] trigger on absence of objects
Posted: Wed Jan 21, 2004 5:22 am
by cowsmanaut
I'm wondering if RTC already has this.. however, I'm not sure where I saw this happen.. if it was in a eob map or captive or some demo of something.. or perhaps it was just in one of my old map plans (I used to draw up maps for DM long ago for puzzles I would make if I could)
Anyway, here's the idea. You have a room where you want to prevent access to if they are holding weapons. Sort of a weapon check room for a big medieval dance club
So here is what you need to be able to do. Do a check for every weapon and if they are carrying it the door will not open. if they pass the check and they have no weapons they are admitted.
Now I know it does a check for objects and if they are present there is a trigger.. however is there a way to check for absence of an object and then set a trigger?
So the alternate I thought of for this is to have a trigger thats keyed to any weapon and a mass of fireballs so that your first step into the room would kill you if you didnt' fallow the orders.. but I would sooner do such a thing the other way. (not that I'm likley to make a map any time soon)
cheers
Posted: Wed Jan 21, 2004 7:46 am
by Me
Currently, I think the only way to implement this would be to have a ton of floor triggers in front of the door, each one activated by an individual weapon. So if you have the patience to do a lot of clicking in the RTC editor, your idea will come to life in the dungeon. I like the idea by the way.
Posted: Wed Jan 21, 2004 10:44 am
by George Gilbert
Great idea for a trap. Unfortunately RTC doesn't have a concept of a "weapon" just "standard objects" which can be carried. I think the way to do it is as suggested above, individually test for each possible weapon type...
Posted: Wed Jan 21, 2004 4:58 pm
by cowsmanaut
so it is possible to check and trigger if they don't have a specific object?
annother example would be something like you are trying to take a gem but don't have a permission slip to borrow it. if you leave the room without the gem nothing happens if you leave with the gem but without a permission slip you get blasted and if you leave with both you are fine.
moo
Posted: Wed Jan 21, 2004 5:04 pm
by andyboy_uk
George,
Could you fake derive an item category from anything that appears before teh first underscore in the name.
I.e.
DOORS are all things that start DOOR_
STAFFS are STAFF_
etc.
For people cloning items you could categorise them with the item that is cloned as they have to start from a base object (that is if they dont have an underscore in the name of the object).
Could htat work?
I was planning to do something similar to break down the editor's vault objects. Although it will be customisable.
Posted: Wed Jan 21, 2004 6:17 pm
by beowuuf
I agree, it would be nice to have the ability to sub-categorise, i've had lots of ideas similar to the above, and assumed it would be mutliple trigger time - i take it this will require an engine rechange though, since i'm guessing weapon_sword is merely 'object no 5' to the engine, rather than 'object no 5.1, or a.5, or however you would categorise it'
Posted: Wed Jan 21, 2004 6:24 pm
by andyboy_uk
I was thinking if the Object class looks something like
Class cObject
{
string objectId;
... and others for the icon handle pointers, and object properties, etc ...
}
You could add a String category and take a subset of the objectId string. Upto the underscore. Im not sure the C++ command but in Blitz and VB it is Substr() and in C# it is System.String.SubString()
GG, can you shed any light? Is this possible
Posted: Wed Jan 21, 2004 6:29 pm
by George Gilbert
Beowuuf is right. The engine converts the stings to numbers instantly. The only diferential between objects is their major type (standard object, monster, door, spell, cloud, wall, floor) and there is no concept of a subtype (weapon or even staff, sword etc).
That's not to say there couldn't be one in the future. but right now there isn't and it would require quite a bit of code to rewrite it to work that way. It's a good suggestion though!
Posted: Wed Jan 21, 2004 6:38 pm
by andyboy_uk
So out of interest,
If I put down a doorframe for instance in a text file. When it compiles it changes it to say object number 4 or something like that? How are the numbers and names linked. It implies that there is an array somewhere or a list that has the number vs. the name you put in a text file.
Can this be extracted from one of teh DAT files?
@Cows: I guess I could add something that allows you to place multiple triggers for all sub types of an object in my editor (not yet mind). But it would do this by creating loads of triggers on that particular tile.
Posted: Wed Jan 21, 2004 6:49 pm
by beowuuf
Lol, i guess that was expectation really, wasn't it - RTC would be made of simple parts that could be combined in complex ways. The editor was supposed to make putting the elements together easy - like multiple triggers placed for a 'no weapons' effect or all the mechanics placed for a continuous shooter : )
Posted: Thu Jan 22, 2004 10:57 am
by George Gilbert
If I put down a doorframe for instance in a text file. When it compiles it changes it to say object number 4 or something like that?
Exactly like that!
How are the numbers and names linked. It implies that there is an array somewhere or a list that has the number vs. the name you put in a text file.
Yes, there's one of them built into RTC (a DAT file actually) - this however is only used in the copile stage. As soon as it's compiled the text strings are never referrred to again (i.e. the RTC / SAV files don't have them in them).
Posted: Thu Jan 22, 2004 4:46 pm
by cowsmanaut
are item types stored concurrently? ie 5-35 weapons 36-43 staffs 44-52 amulets. etc etc
if this were the case then you would not need to have subclasses you could just tell RTC that "weapon" for the purpose of compile means items 5-35.
moo
Posted: Thu Jan 22, 2004 6:00 pm
by George Gilbert
No - and anyway, that way of doing it wouldn't take into account new objects. I think it has to be done with sub-types which means a re-write of the low level code.
Posted: Sun Feb 01, 2004 6:34 pm
by copperman
Could an OPBY=(NOTobject) be added maybe ?
Posted: Mon May 15, 2006 1:01 pm
by George Gilbert
This can now be done using counter sets in V0.38. For example, if you want to trigger when the party does not have a club:
item1 -> Floor trigger that does a counter set to 0
item2 -> Floor trigger that activates the counter if the party has a club
item3 -> Floor trigger that activates a conditional relay that only triggers if the counter is still 0.