Jump to content
The Dark Mod Forums

Dynamic 'metaproperties'


Fidcal

Recommended Posts

I've suggested this idea before but maybe we should have this thread for other mappers to post suggestions to be included.

 

Most entity properties cannot be changed once the game starts. The spawnarg is simply the value given to a property when the game starts so changing the spawnarg makes no difference once the game has started.

 

We already have some properties we can change in-game such as the brightness of a light. But there are others that would be useful. Unfortunately each one must be given individual code support to convert a value into an actual property while the game is running. So I suggest over a period we come up with a reasonable list of properties we feel it would be useful to change.

 

One idea might be to have a new entity say trigger_property. It's target would be the entity whose property you want to change. On the trigger you put eg,

set speed

99

 

Here are a few suggestions for properties that might usefully be changed in-game:

 

speed - func_rotating, func_pendulum

notouch - triggers (effectively enables/disables)

shaderparms - various, eg fog murk, water surface current speed

used_by (on doors = instant keyring)

Link to comment
Share on other sites

I think the idea that we can come up with a definitive list is rather futile - we have over 1500 spawnargs, and just documenting them is apparently too much (we only have about 50% of them documented, give or tatke 10%). So listing them up and even saying "this one is dynamic" is a futile attempt.

 

What I think we'd need to do is to redesign the code so that the modify of a spawnarg (via spawnArgs.Set as well as $entity.set("foo", "bar")) results in an auto-update of the actual property. Either by copying all spawnargs, and syncing them, or by never having internal variables and dstore everything in spawnargs (I think this might be too slow, too).

 

It is certainly tricky and/or a lot of work, but in the end it will be better for the mappers as they never need to worry that they cannot modifiy spawnargs - everything is dynamic and every change is immiditely reflected in game.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Well, that sounds ideal from a mapper point of view.

 

As for my idea, I wasn't suggesting we go through all spawnargs and decide which ones should be dynamic. I was saying over the next few months or a year that mappers, as new uses come to their attention, that they list them here. When we have 10 or 20 or 50 then an entity be created with the code. Whenever a mapper needs another then hopefully it can be added.

 

At the moment, most mappers probably have no idea what this is about so they are not particularly showing any interest. But next month someone might be asking how can they change the speed of a door or make an AI walk slowly at a certain place or how to change the voice of a possessed person and so on.

Link to comment
Share on other sites

funny i was just thinking of something along these lines while I was mapping today before reading this thread.

 

I would wish for _color spawnarg to be modifiable dynamically, for lights as well as colorme models. I have a particular light that I would wish for the glass/light to change from green to red and vice versa via a switch/lever.

Link to comment
Share on other sites

funny i was just thinking of something along these lines while I was mapping today before reading this thread.

 

I would wish for _color spawnarg to be modifiable dynamically, for lights as well as colorme models. I have a particular light that I would wish for the glass/light to change from green to red and vice versa via a switch/lever.

 

Your wish is my command: Write a script along these lines:

 

void light_change_to_red( entity mylight, entity activator, entity target_entity )
{
 mylight.fadeToLight("1.0 0.0 0.0", 1.0);  // 1.0 seconds to full red
}

void light_change_to_green( entity mylight, entity activator, entity target_entity )
{
 mylight.fadeToLight("0.0 1.0 0.0", 1.0);  // 1.0 seconds to full green
}

 

Then setup an trigger_multiple or trigger_once, or indeed a lever and link it to an atdm:target_callscriptfunction. Set on this:

 

"call" "light_change_to_green"
"foreach" "1"

 

From this entity, link it to your light (or multiple if you want).

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

I've added 'used_by' for doors to the list because this should an easy and immediate keyring option. All we need is a keyring inventory icon, put it on any key, name that key say, keyring, then whenever a key is found it triggers 'used_by_keyring' to be added to the door with 'keyring' as the value and the key can be deleted.

 

However, I don't like the method myself. I prefer a keyring that is simply an alternate inventory where you scroll around the keyring to select the key you want. This is why I want the optional blocker on scrolling inventory categories so they all scroll within the category only.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • nbohr1more

      The FAQ wiki is almost a proper FAQ now. Probably need to spin-off a bunch of the "remedies" for playing older TDM versions into their own article.
      · 1 reply
    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 3 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 7 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
×
×
  • Create New...