Help with doors!

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
User avatar
Kappes Buur
 
 
Posts: 4179
Joined: Thu Jul 17, 2003 12:19 am
Graphics Processor: nVidia (Legacy GZDoom)
Location: British Columbia, Canada
Contact:

Re: Help with doors!

Post by Kappes Buur »

Just a thought, I haven't tried it myself yet.
Wouldn't simply attaching 'Thing_Raise' to the monster resurrect it, upon it's demise?
Or, as Blue Shadow mentioned, give the monster a TID. Then attach a script to the monster, which could set up some conditions before the monster resurrects. Like opening a door, raising/lowering a floor/ceiling, or initiating a quake, etc.

Killing everything first seems to be a bit overkill, so to speak.

[edit]
I finally had a chance to try this out.
Simply attaching the Thing_Raise special, with or without assigning a TID, does not work. The imp did not resurrect.
Then I attached this simple script to the imp (TID 10)

Code: Select all

#include "zcommon.acs"

script 1 (void)
{
    Thing_Raise (10);
}
and that did not work. The imp did not resurrect.

Then I changed the script slightly to include a delay

Code: Select all

#include "zcommon.acs"

script 1 (void)
{
    delay (35);
    Thing_Raise (10);
}
and that worked, but only once.

To make the imp resurrect time after time, I restart the script

Code: Select all

#include "zcommon.acs"

script 1 (void)
{
    delay (35);
    Thing_Raise (10);
    Restart;
}
Now the imp is resurrected every time it is fragged.
Last edited by Kappes Buur on Sun Nov 18, 2012 5:52 pm, edited 1 time in total.
User avatar
GuildNavigator
Posts: 209
Joined: Mon Oct 20, 2008 2:42 pm

Re: Help with doors!

Post by GuildNavigator »

Well, thanks first for your advice.

I tried to follow Kappes Buur advice, instead of killing at the very beginning all the monsters who'll resurrect, but it didn't work.

Anyway, I just tried to verify mi first plan: I gave the HellKnight decoration (the object under "Decoration" section representing the HellKnight corpse) a TID, and then I put Thing_Raise in the corresponding script, but nothing happened. So I tought the decoration object doesn't stand for a dead enemy...

Anyway, even if I never tried Blue Shadow way which probably work, are you sure there's not a simpler way to make resurrect enemies already dead from the beginning, without killing all them when starting the level? Just wanted to know it...

Anyway, if there's not, I'll try Blue Shadow method, I'm sure it will work.
User avatar
Kappes Buur
 
 
Posts: 4179
Joined: Thu Jul 17, 2003 12:19 am
Graphics Processor: nVidia (Legacy GZDoom)
Location: British Columbia, Canada
Contact:

Re: Help with doors!

Post by Kappes Buur »

GuildNavigator wrote:....., are you sure there's not a simpler way to make resurrect enemies already dead from the beginning,.....
Oh, I see, my example pwad missed by a mile and a half then.
In that case, Blue Shadow's suggestion is a viable solution. The only thing I do not like about using Thing_Raise or TeleportOther is how the monsters are reanimated so abruptly.
User avatar
cocka
Posts: 1520
Joined: Sat Jul 02, 2011 7:21 am
Location: Hungary

Re: Help with doors!

Post by cocka »

Simply attaching the Thing_Raise special, with or without assigning a TID, does not work. The imp did not resurrect.
Yes because as we already discussed it earlier in another topic which is about smashing pots or potteries, if you kill or destory a thing with a tid, then after it dies, it will lose its tid. So neither the special nor the script will work because tid is automatically removed.
So I tought the decoration object doesn't stand for a dead enemy...
Does it have a Raise state? Because if there's no Raise state, then why should it be resurrected? :)
Blue Shadow
Posts: 5043
Joined: Sun Nov 14, 2010 12:59 am

Re: Help with doors!

Post by Blue Shadow »

Here is another approach: It consists of making custom variants of the original monsters that spawn "dead". Those monsters can be placed in the map and given tags, then resurrected using Thing_Raise when the player activates a trigger.

Try this.
User avatar
GuildNavigator
Posts: 209
Joined: Mon Oct 20, 2008 2:42 pm

Re: Help with doors!

Post by GuildNavigator »

Thank you all.

The final solution by BlueShadow seems the best to me; I will add a proper Decorate-things file, so to do it.

@cocka: Sorry, sometimes for just a topic there's a dispersive discussion and often is difficult to find a simple answer to your questions... I prefer asking directly here, even If the question is over-repeated :)

Thank you all again!
User avatar
GuildNavigator
Posts: 209
Joined: Mon Oct 20, 2008 2:42 pm

Re: Help with doors!

Post by GuildNavigator »

Hi there everybody! :)

I'm back again to ask a specific question; it's about WALL-TRAPS. Yes, how can I create, for example, a hole in the wall which shots arrows or fireballs? Is there a specific command I should use?
If you have some ideas how to create it please tell me.

Thanks in advance!
User avatar
cocka
Posts: 1520
Joined: Sat Jul 02, 2011 7:21 am
Location: Hungary

Re: Help with doors!

Post by cocka »

it's about WALL-TRAPS
But the topic is about doors, isn't it?

http://zdoom.org/wiki/Thing_Projectile
User avatar
GuildNavigator
Posts: 209
Joined: Mon Oct 20, 2008 2:42 pm

Re: Help with doors!

Post by GuildNavigator »

Yeah it's about doors but I consider my thread for my problems in general. I think it's a good way to know my style and what I do...

Thanks for the help anyway! :)
User avatar
GuildNavigator
Posts: 209
Joined: Mon Oct 20, 2008 2:42 pm

Re: Help with doors!

Post by GuildNavigator »

Hi there!

I used the special 128:ThrustThingZ in a script in order to activate a current thrusting the palyer down, in a swimmable area; I'va made it so that once the player walks over the activation line, but I suppose I should also set the sector in which I want the player starts to be taken down. How can I do it?

Thanks in advance! :)
User avatar
Kappes Buur
 
 
Posts: 4179
Joined: Thu Jul 17, 2003 12:19 am
Graphics Processor: nVidia (Legacy GZDoom)
Location: British Columbia, Canada
Contact:

Re: Help with doors!

Post by Kappes Buur »

Rather than using an activation line, you could try placing a thing 9998 (Actor enters sector) into the sector and then attach a script with special 128:ThrustThingZ.
Jitan
Posts: 44
Joined: Tue Oct 04, 2011 6:32 am

Re: Help with doors!

Post by Jitan »

How do I trigger open a sliding door at a certain time ?
User avatar
GuildNavigator
Posts: 209
Joined: Mon Oct 20, 2008 2:42 pm

Re: Help with doors!

Post by GuildNavigator »

Hello everybody!

I'm here again with some difficult stuff. Here's the link so you can check it yourself: http://www.mediafire.com/?xwp08nvig4y6v5t

Here is it: if you run the wad, the palyer will start in a room with a mountain hole in the corner, and you'll see holes on the floor with strange things inside. They're mirrors. The aim of the mini quest of this part of level is to convey a light ray in certain directions. To do it, you have to raise or lower these mirrors, playing with the direction of light. At the first attempt to create a light scatter everything worked fine, but my main problem now is that the second mirror (you can trigger it pressing use on a part of the wall); once raised, can be optionally lowered with the same switch, then, if you need to raise it again, you simply have to push the correspondant switch again. But after the first lowering, if you push the trigger the mirror will continue going down!!! instead of raising again. To make the thing work, I simply used a parameter (#mirror2) as TRUE/FALSE everytime the switch is used (TRUE stay for RAISED, FALSE, for LOWERED).
All the thing is made with scripts #30 and #31. In the picture below I show you the various references with the parameters and the switches.

Thanks in advance for giving it a look! I'm really troubled!

NOTES:
- the control sectors you see on the right of the picture regulate the non-solid 3Dfloors supposed to be the light rays;
- switch that activates mirror1 is usable just one time: once the mirror is raised, it cannot be lowered anymore and viceversa;
- the first time I wrote script#31, without adding light conditions (if already scattered by the first mirror or not) the mirror raise/lower mechanism just worked perfectly; then after adding further parameters the thing just didn't work anymore;
- one big question to you experts: do you sincerely think that making a mirror labyrinth, as I thought to do, could be a realizable thing? The main worry I had on this is the activation of many switches together, and not one by one letting the many scripts to work in separate moments: this would probably lead to a general mess in the running of the light rays.
So tell me if it's quite affordable or If I should look for something as fancy but less hard...
Attachments
mirrors.JPG
User avatar
Kappes Buur
 
 
Posts: 4179
Joined: Thu Jul 17, 2003 12:19 am
Graphics Processor: nVidia (Legacy GZDoom)
Location: British Columbia, Canada
Contact:

Re: Help with doors!

Post by Kappes Buur »

Essentially you want just two conditions, the mirrors extending or retracting.
This example may be too simplistic, but it shows how I would use the variable to determine the direction.

Code: Select all

#include "zcommon.acs"

int anyvar0 = 0;

script 1 (void)
{
    if ( anyvar0 == 0 )
    {
    Floor_RaiseByValue (1, 4, 64);
    Tagwait (1);
    // many more actions here
    anyvar0 = 1;
    }
  
    else
    {
    Floor_LowerByValue (1, 4, 64);
    Tagwait (1);
    // many more actions here
    anyvar0 = 0;
    }
}

If that is the best way of coding, I do not know. Perhaps, someone else has a more elegant solution.

And in your case, script 31 should be executed before script 30.
If script 30 is executed first, the laser beam will have a discontinuity where the second mirror should extend from the floor.

I'll play with this some more, if time permits.
User avatar
MeatyD
Posts: 61
Joined: Mon Mar 11, 2013 12:01 pm
Location: United States

Re: Help with doors!

Post by MeatyD »

Code: Select all

#include "zcommon.acs"

bool anyvar0 = 0;

script 1 (void)
{
    if ( !anyvar0 )
    {
    Floor_RaiseByValue (1, 4, 64);
    // many more actions here
    }
    else
    {
    Floor_LowerByValue (1, 4, 64);
    // many more actions here
    }
Tagwait(1);
anyvar0 = !anyvar0
}
a little bit of optimization ;)
Locked

Return to “Editing (Archive)”