Page 1 of 1

Lightswitch (RPG svn)

Posted: August 28th, 2011, 10:33 am
by wildflower
Anyone have an idea how to make a "simple" lightswitch in RPG-mode?

I need to light a torch, using interact, I was planning to use the /packages/models/objects/torch_cold and then spawn some flames and some light.

A more simple approach would be to somehow switch the "torch_cold" model with "torch" and use r_status_addlight, this did worked with the 2.6 version, but I can't make it work in 2.7 (svn).

I have tried every hack I could think of, so any hints would be helpfull :)

Re: Lightswitch (RPG svn)

Posted: August 28th, 2011, 8:09 pm
by Hirato
As far as I know, that functionality didn't exist in 2.6.0 or 2.6.1 either.
When torches like that would be functional, I would advise against this.
Players may turn off dynlights and there's a limit of 5

You can currently switch the model though, though you cannot play with the active effects

Code: Select all

r_script_signal "interact" [
    r_select_trigger self [
        if (strcmp (r_trigger_mdl_get) "torch_cold") [
            r_trigger_mdl torch
            //add light here - when it's functional
        ] [
            r_trigger_mdl "torch_cold"
            //remove light here - when it's functional
        ]
    ]
]
What I would do though is to give the player a torch or light spell to play with

Re: Lightswitch (RPG svn)

Posted: August 28th, 2011, 8:47 pm
by wildflower
In 2.6.1 I made a hack where I equipped a mdlscale 1 rat with an item that had status_addlights, and spawned it right above the torch when I triggered it.
A little messy I know, but I was just playing around to see what could be done ;)

I didn't however know that there was a limit of 5 on dynlights, so that kind'a spoils my plans for a quest, it could still work with a light spell thou...
nice idea 8-)