A Liilte Scripting Help Please

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
mac53
Posts: 251
Joined: Sun Dec 17, 2006 11:15 am
Location: Delmarva Peninsula, MD USA
Contact:

Post by mac53 »

Ok... What's wrong here? Second half, not working! Script 1 proved itself and so did Script 2, in script 2 I also tried [T_IMP]. What I think is happening is that Script 1 is not declaring the imps with the [new tid 4]!

Code: Select all

#include "zcommon.acs"

Script 1 OPEN
{
	while(ThingCount(T_MEGASPHERE, 0) > 0)

		delay(4);
	
	     Thing_SpawnNoFog(1, T_IMP, 0, 4);
	     Thing_SpawnNoFog(2, T_IMP, 0, 4);
	     Thing_SpawnNoFog(3, T_IMP, 0, 4);

}


Script 2 OPEN
{
	while(ThingCount(T_NONE, 4) > 0)

		delay(4);

	     Ceiling_RaiseToNearest(1, 30);

}
----------------------------------------------------
Ok... it seems apparent that I'm going to have to do a old-new tid change for the Imps. I don't know if I can take the above code and make it just one script including the old-new tid and script terminate commands. Now, I'm asking you guys who know... "Can this be done?"
User avatar
Medricel
Posts: 1138
Joined: Sat Nov 20, 2004 9:47 am

Post by Medricel »

TOTAL EDIT:

Code: Select all

#include "zcommon.acs"

Script 1 OPEN
{
   while(ThingCount(T_MEGASPHERE, 0) > 0)

      delay(4);
   
        Thing_SpawnNoFog(1, T_IMP, 0, 4);
        Thing_SpawnNoFog(2, T_IMP, 0, 4);
        Thing_SpawnNoFog(3, T_IMP, 0, 4);

        ACS_Execute(2, 0);

}


Script 2 (void)
{
   while(ThingCount(T_NONE, 4) > 0)
   
      delay(4);

        Ceiling_RaiseToNearest(1, 30);
}
What you need to do is change script two to be a regular script. Then, call it at the end of script 1. The reason for this is that since script 2 was an OPEN script, it would execute before the monsters were ever even spawned. Since it was before there were any monsters with tag 4, the While loop was skipped, and the script executed to completion.
User avatar
Zippy
Posts: 3302
Joined: Wed Mar 23, 2005 5:31 pm
Location: New Jersey

Post by Zippy »

What I think is happening is that Script 1 is not declaring the imps with the [new tid 4]!
No, it is. But think about it carefully... look at this:

Code: Select all

Script 2 OPEN
You've declared script 2 as an OPEN script. That means the script runs as soon as the map starts. This will not work, since when the map starts you don't have any monsters with a TID of 4. So the script will run right when the map starts and ThingCount will return 0, meaning the script won't delay and thus won't work properly.

You should set it up similar to how Shinjanji is suggesting. This way guarentees that there are monsters with a TID of 4 when the script starts running.
User avatar
mac53
Posts: 251
Joined: Sun Dec 17, 2006 11:15 am
Location: Delmarva Peninsula, MD USA
Contact:

Post by mac53 »

Isn't the second bracket in script two in the wrong place?


Disregard... you corrected it... Thank you...;-)
Last edited by mac53 on Sun Jan 28, 2007 11:19 am, edited 1 time in total.
User avatar
mac53
Posts: 251
Joined: Sun Dec 17, 2006 11:15 am
Location: Delmarva Peninsula, MD USA
Contact:

Post by mac53 »

Zip...

Understood...;-) I'm trying really hard to get the hang of this!!!
User avatar
mac53
Posts: 251
Joined: Sun Dec 17, 2006 11:15 am
Location: Delmarva Peninsula, MD USA
Contact:

Post by mac53 »

Thanks Guys... It works great... :thumb:

Zip... Thanks for making sense out of what I did wrong.

Shinjanji... Thank you for the script.
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

I have one small beef to point out with the method you're forcing them to use:

If you add a second megasphere to the map, the effect completely breaks.

The clean way to do this is to assign a special action to the megasphere in question, just as they suggested in the first place.

In this case, just give the megasphere a special of ACS_Execute with a first argument of 2, then change script 2 to read like this:

Code: Select all

Script 2 (void) 
{ 
   delay(4); 
    
   Thing_SpawnNoFog(1, T_IMP, 0, 4); 
   Thing_SpawnNoFog(2, T_IMP, 0, 4); 
   Thing_SpawnNoFog(3, T_IMP, 0, 4); 

   while(ThingCount(T_NONE, 4) > 0)     
      delay(4); 

   Ceiling_RaiseToNearest(1, 30); 
}
When the megasphere in question is picked up, it executes script 2, which spawns the imps, waits for them to die, and then executes the Ceiling_RaiseToNearest action.
User avatar
mac53
Posts: 251
Joined: Sun Dec 17, 2006 11:15 am
Location: Delmarva Peninsula, MD USA
Contact:

Post by mac53 »

HotWax wrote:I have one small beef to point out with the method you're forcing them to use:
I'm forcing who to use?
Last edited by mac53 on Mon Jan 29, 2007 5:48 pm, edited 1 time in total.
User avatar
mac53
Posts: 251
Joined: Sun Dec 17, 2006 11:15 am
Location: Delmarva Peninsula, MD USA
Contact:

Post by mac53 »

I got to say... Hotwax... I did what you said in a test wad and it worked flawlessly.

Thanks man...
User avatar
mac53
Posts: 251
Joined: Sun Dec 17, 2006 11:15 am
Location: Delmarva Peninsula, MD USA
Contact:

Post by mac53 »

I'm interested in removing the "impassible" attribute from a "linedef" when a certain action is performed. Would anyone advise me as to how I can write this script? Please...

Thanks... :thumb:
User avatar
Phobus
Posts: 5984
Joined: Thu May 05, 2005 10:56 am
Location: London
Contact:

Post by Phobus »

SetLineBlocking ([LID], BLOCK_NONE);

I think.
User avatar
mac53
Posts: 251
Joined: Sun Dec 17, 2006 11:15 am
Location: Delmarva Peninsula, MD USA
Contact:

Post by mac53 »

Isn't that just part of it?
User avatar
Zippy
Posts: 3302
Joined: Wed Mar 23, 2005 5:31 pm
Location: New Jersey

Post by Zippy »

Phobus wrote:SetLineBlocking ([LID], BLOCK_NONE);

I think.
Close. It's BLOCK_NOTHING. :wink:

For reference: [wiki]SetLineBlocking[/wiki]. Just give it the lineID (set using [wiki]Line_SetIdentification[/wiki] on your line in the map) and the blocking mode.
User avatar
mac53
Posts: 251
Joined: Sun Dec 17, 2006 11:15 am
Location: Delmarva Peninsula, MD USA
Contact:

Post by mac53 »

Zippy wrote:
Phobus wrote:SetLineBlocking ([LID], BLOCK_NONE);

I think.
Close. It's BLOCK_NOTHING. :wink:

For reference: [wiki]SetLineBlocking[/wiki]. Just give it the lineID (set using [wiki]Line_SetIdentification[/wiki] on your line in the map) and the blocking mode.
Hi Zip...

I'll check it out, buddy. But, here's what I want to happen. When the player either crosses a certain line, [like in a hidden area] or [picks up a certain item in a hidden area], then I would like a certain linedef that is already carrying the "impassible" attribute to change to passible. In other words, if the player doesn't find this particular spot, then he/she can't get to the BFG.
boomlala
Posts: 43
Joined: Mon Dec 11, 2006 10:39 am
Location: Belgium
Contact:

Post by boomlala »

If the player doesn't see the BFG before he can reach it, this is how you could get the effect. Create a sector around the BFG, and give it a ceiling value equal to the floor value. Then you give the Line/Thing that has to be crossed/picked up an action special of 80, ACS Execute Script. Then in that script you have to put something like this.

script 1 (void)

{
Ceiling_RaiseByValue(1, 65, 128);
}

The 1 is the sector tag, 65 the speed, 128 the amount it has to raise.

EDIT: If the player sees the BFG before he can get to it, you could use Transparent Line.
Locked

Return to “Editing (Archive)”