Mappers, put your thinking caps on

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
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Mappers, put your thinking caps on

Post by HotWax »

Alright, people. I need to know the easiest and most effecient way to accomplish this seemingly simple task:

When the player summons a monster into the map, the script sets the monster's TID to a given value depending on where it's being spawned.

Any ideas?
User avatar
Eevee
Posts: 592
Joined: Wed Jul 16, 2003 5:26 am
Contact:

Post by Eevee »

Uhm, I don't think there's really any way to capture manual summons...
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

If you mean the console command 'summon': no chance.
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

You can detect when any Thing enters the map by running a loop that constantly compares "ThingCount" to the old value (stored in a variable). Is there no way to act on this information?

Secondly, I can think of at least one (bad) way to do this. A monster-cross line that sets the TID of the activator when it is crossed, but only if it already has no TID. (Is this possible? I think it is, but I'm not sure.) The player could summon the monster in a box-like area and let it come forward to attack him, triggering the line. The script within could then teleport the monster elsewhere, deactivate him, and give him a TID until later needed.

I don't like this idea, however, because the monster might attack the player. Although, I suppose I could just make the player invurnerable. However, I still don't like it because it feels sloppy.

Is there no other way to do what I want?
Cyb
Posts: 912
Joined: Tue Jul 15, 2003 5:12 pm

Post by Cyb »

you can set the tid of something:

Code: Select all

script 1 (void)
{
   if(activatortid() == 0)
      thing_changetid(0, newtid);
}
as long as the line is a monster cross line

other than that, there's no way to randomly grab a monster summoned from the console any more than there's a way to randomly grab any monster without a unique tid, so in other words, no (but why not just have the player hit a switch that spawns a monster instead of summon)
User avatar
Eevee
Posts: 592
Joined: Wed Jul 16, 2003 5:26 am
Contact:

Post by Eevee »

There's a function called activatortid()? o.o

er, anyway.. yes, you can detect when something (at ALL) enters the map, but you can't tell how it got there or what it is.

Perhaps.. an Actor Hits Floor would be useful?
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

Cyb wrote:but why not just have the player hit a switch that spawns a monster instead of summon
Because that limits what the player can bring into the arena.
Eevee wrote:Perhaps.. an Actor Hits Floor would be useful?
THANK YOU EEVEE! I LOVE YOU!!!!

/me runs off to experiment.
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

Dammit. Neither Actor Hits Floor nor Actor Enters Sector trigger when something is summoned into a sector. I wonder if changing this would break compatibility with other things?

Time to go try to see if I can drop a summon over a ledge. ^_^;

[EDIT]Uhhh... If I'm flying over a sector with an "Actor hits fake floor" Thing in it, and I summon, the thing appears in midair and drops, but doesn't trigger the sector action when it lands. Why not?[/EDIT]

[EDIT#2]UHHHHH... If I summon an Imp on a 24-high ledge and let it fall into the sector to chase me, it doesn't trigger either. WTF?![/EDIT]

[EDIT#3]Nevermind, it's because the Deaf flag controls whether a monster can activate or not. Go me.[/EDIT]

[EDIT#4]CURSES!!!! Actor hits floor works PERFECTLY except that flying enemies don't hit the floor when summoned! And Actor enters sector doesn't work at all! Why, God, WHYYYYYY?!?!???[/EDIT]
Last edited by HotWax on Thu Feb 12, 2004 12:45 am, edited 1 time in total.
User avatar
Eevee
Posts: 592
Joined: Wed Jul 16, 2003 5:26 am
Contact:

Post by Eevee »

Oh. Right. I was even thinking "make sure monsters can activate it" when I wrote that post, and then thought "silly, that only applies to lines" for some reason. Forgot the Deaf flag. heh. erm.
HotWax wrote:THANK YOU EEVEE! I LOVE YOU!!!!
Should I be scared when naked people say this to me?
Last edited by Eevee on Thu Feb 12, 2004 12:51 am, edited 1 time in total.
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

/me makes a sacrifice to Randy and humbly requests that summoned Things trigger "Actor Enters Sector" scripts.

If this change isn't made, I've determined that I'm going to be relegated to using wind tunnels to fling the newly summoned enemies across trigger lines. :(

[EDIT]And... monsters... aren't... affected by...... wind....

ARGHGHHGHGHBHBLBLBHLBHLBHBLBHHBHBBHBB[/EDIT]
User avatar
Eevee
Posts: 592
Joined: Wed Jul 16, 2003 5:26 am
Contact:

Post by Eevee »

Does an Actor Hits Floor work if you summon the monster in the air? I know this wouldn't help too much, I'm just curious (and lazy).
User avatar
Mundungu
Posts: 221
Joined: Thu Jul 24, 2003 7:12 pm

Post by Mundungu »

Don't feel too bad... I've got a spot in my map when enemies break through the ceiling and drop around the player to attack... fortunately when this happens, the player won't be looking in that direction, otherwise the player would notice just how stupid it actually looks.
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

It works even if the monster is summoned on the ground, but it doesn't work with flying monsters. :(

[EDIT]How do the Boom point pushers and pullers work? I set a sector to allow pushers, and put a pusher in the sector, and nothing happens. Eh?[/EDIT]
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

Ummm... Why is this line causing a message that never leaves the screen?

Code: Select all

HudMessageBold(s:"Team ", d:team, s:" now has ", d:count[team-1], s:" players."; 0, 0, -1, 0.0, 0.0, 10);
Also tried with the last argument set to 2 and 0.01, no change.

Also, can Lost Souls not be deactivated? I give one a TID as it flies across a line, and then deactivate that TID, but it contines attacking etc. I can tell that the TID stuck because further activations of that line don't work (I have the script set to skip the rest of the code if the actor already has a TID). Maybe just while they're attacking?

[EDIT]Sigh... Brick wall after brick wall...

Tell me why this isn't teleporting the activator:

Code: Select all

do {
     Spawn("TeleportDest", random(xmin, xmax), random(ymin[team-1], ymax[team-1]), z, 3, angle[team-1]);
} while (ThingCount(T_NONE, 3) == 0);
		
Teleport(3);
I've already confirmed that the destination is being spawned by replacing it with "Cacodemon". Sure enough, a caco appears in the target area.

I know that TeleportDest is a legal Thing name because otherwise the while loop would repeat forever and ZDoom would report a runaway script.[/EDIT]
User avatar
Eevee
Posts: 592
Joined: Wed Jul 16, 2003 5:26 am
Contact:

Post by Eevee »

HotWax wrote:Ummm... Why is this line causing a message that never leaves the screen?

Code: Select all

HudMessageBold(s:"Team ", d:team, s:" now has ", d:count[team-1], s:" players."; 0, 0, -1, 0.0, 0.0, 10);
Also tried with the last argument set to 2 and 0.01, no change.
welll, the last argument should be fixed.. but if it's not zero the message should still leave eventually.. o.o;
HotWax wrote:Also, can Lost Souls not be deactivated? I give one a TID as it flies across a line, and then deactivate that TID, but it contines attacking etc. I can tell that the TID stuck because further activations of that line don't work (I have the script set to skip the rest of the code if the actor already has a TID). Maybe just while they're attacking?
Lost Souls act as projectiles while they're attacking, so they don't just stop dead if you deactivate them. They ought to not attack AGAIN after that, though. You could try giving another line just in front of that one some id; then after you assign the Lost Soul an id and deactivate it, make the second line block everything, wait a moment for it to hit the wall, and then make the wall passable again..
HotWax wrote:Tell me why this isn't teleporting the activator:
...that one I have no idea. Try spawning a MapSpot instead? :?
Locked

Return to “Editing (Archive)”