[Done for V0.38] trigger on absence of objects

Messages are moved here (should anyone ever want to see them again) once they are no longer applicable to the current version (e.g. suggestions that have been implemented or bugs that have been fixed).

Moderator: George Gilbert

Forum rules
Please read the Forum rules and policies before posting. You may Image to help finance the hosting costs of this forum.
Post Reply
User avatar
cowsmanaut
Moo Master
Posts: 4380
Joined: Fri Jun 30, 2000 12:53 am
Location: canada

[Done for V0.38] trigger on absence of objects

Post 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
Me

Post 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.
User avatar
George Gilbert
Dungeon Master
Posts: 3022
Joined: Mon Sep 25, 2000 11:04 am
Location: London, England
Contact:

Post 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...
User avatar
cowsmanaut
Moo Master
Posts: 4380
Joined: Fri Jun 30, 2000 12:53 am
Location: canada

Post 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
User avatar
andyboy_uk
On Master
Posts: 647
Joined: Thu Feb 20, 2003 1:51 am
Location: London, UK

Post 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.
Regards,

Andy
User avatar
beowuuf
Archmastiff
Posts: 20686
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post 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'
User avatar
andyboy_uk
On Master
Posts: 647
Joined: Thu Feb 20, 2003 1:51 am
Location: London, UK

Post 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
Regards,

Andy
User avatar
George Gilbert
Dungeon Master
Posts: 3022
Joined: Mon Sep 25, 2000 11:04 am
Location: London, England
Contact:

Post 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!
User avatar
andyboy_uk
On Master
Posts: 647
Joined: Thu Feb 20, 2003 1:51 am
Location: London, UK

Post 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.
Regards,

Andy
User avatar
beowuuf
Archmastiff
Posts: 20686
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post 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 : )
User avatar
George Gilbert
Dungeon Master
Posts: 3022
Joined: Mon Sep 25, 2000 11:04 am
Location: London, England
Contact:

Post 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).
User avatar
cowsmanaut
Moo Master
Posts: 4380
Joined: Fri Jun 30, 2000 12:53 am
Location: canada

Post 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
User avatar
George Gilbert
Dungeon Master
Posts: 3022
Joined: Mon Sep 25, 2000 11:04 am
Location: London, England
Contact:

Post 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.
User avatar
copperman
Um Master
Posts: 476
Joined: Thu Aug 29, 2002 12:49 pm
Location: UK

Post by copperman »

Could an OPBY=(NOTobject) be added maybe ?
Don't be scene or herd!
User avatar
George Gilbert
Dungeon Master
Posts: 3022
Joined: Mon Sep 25, 2000 11:04 am
Location: London, England
Contact:

Post 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.
Post Reply