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

Post by mac53 »

They say a pic is worth a thousand words.

Image

What you are looking at is a sector with a vortex and behind it is a transporter. The vortex's linedef carries an "impassible" attribute, thus the player can't access the it to the BFG. What I want to do is to set up an hidden area that contains either a script activation line or simply by picking up an item that will activate a script command that will remove the "impassible" attribute from the vortex's linedef, thus permitting the player to walk through the vortex to the transporter.
boomlala
Posts: 43
Joined: Mon Dec 11, 2006 10:39 am
Location: Belgium
Contact:

Post by boomlala »

Then I think that SetLineBlocking is the answer.

Give the line/thing an action special 80, to this script.

script 1 (void)

{
SetLineBlocking(1, BLOCK_NOTHING);
}

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

Post by mac53 »

boomlala wrote:Then I think that SetLineBlocking is the answer.

Give the line/thing an action special 80, to this script.

Code: Select all

script 1 (void)

{
SetLineBlocking(1, BLOCK_NOTHING);
}
Hope this helps.
Thanks boomlala...

I know how to activate the script and using action special 80 is what I will use in the hidden area that will run the script to make the linedef passible.
Ill look into the script contents you have here and see what I can do.

Again... Thank you... :thumb:
User avatar
mac53
Posts: 251
Joined: Sun Dec 17, 2006 11:15 am
Location: Delmarva Peninsula, MD USA
Contact:

Post by mac53 »

Ok guys...

The script...

Code: Select all

Script 1 (void)

{
	SetLineBlocking(1, BLOCK_NOTHING);

}
in my test wad, doesn't work.

I shot over to the wiki and found this confusing...

Code: Select all

 script 1 (int lineid)
  {
     SetLineBlocking(lineid, BLOCK_EVERYTHING);
     if(CheckInventory("BlueSkull"))
     {
        SetLineBlocking(12, OFF);
     }
  }
What does it mean next to [Script 1][int lineid]? I thought that either (void) or OPEN declared what type of the script's function is! I don't know, the one from the wiki confuses me...

Question...

If a line blocking was set by the authoring program, then is it useless to try to disable it using script? In other words, Say I want to set the blocking using an [OPEN] script, can this be terminated by an triggering (void) script? I'm trying to figure this out, because no matter what I try, it's not working in my test map.
User avatar
Zippy
Posts: 3302
Joined: Wed Mar 23, 2005 5:31 pm
Location: New Jersey

Post by Zippy »

You can set whether any line that has an ID is impassable or not at any time of your choosing using SetLineBlocking. If you mark it as impassable in the editor, then using [wiki]SetLineBlocking[/wiki](line,BLOCK_NOTHING) will make it passable.

Try this to set up a working test:
  • 1) Pick the line that you want to change from impassable to passable.
    2) Give that specific line the special [wiki]Line_SetIdentification[/wiki] and give it a unique ID number.
    3) In a script use SetLineBlocking( theUniqueIDNumberYouJustGaveTheLine, BLOCK_NOTHING);
So, if you give the line the ID of 1, SetLineBlocking( 1, BLOCK_NOTHING ); will make it passable. If you give it an ID of 37, SetLineBlocking( 37, BLOCK_NOTHING ); will work.
mac53 wrote:What does it mean next to [Script 1][int lineid]? I thought that either (void) or OPEN declared what type of the script's function is! I don't know, the one from the wiki confuses me...
When you declare a script that doesn't have a special type (like OPEN, ENTER, DEATH, etc...), you have the option to give it arguments to pass in. If you aren't giving it arguments, then you use (void). If you are giving arguments, then you have to list them. In the example you showed, there is ONE argument specified: int lineid. What this means is that you can give a value to the script and it can use whatever value you give it to do something.

For a simple example, let's say you had 3 doors in your map and they are only openable by hitting a different switch for each of them. The door's sector tags are 3, 4, and 5. Now, you could make the three switches and give them each a different script, like this:

Code: Select all

script 1 (void)
{
   Door_Open( 3, 48, 0 ); // Open door tagged 3
}

script 2 (void)
{
   Door_Open( 4, 48, 0 ); // Open door tagged 4
}

script 3 (void)
{
   Door_Open( 5, 48, 0 ); // Open door tagged 5
}
Or, instead, you can write a single script and give it one arguement, the sector tag to open.

Code: Select all

script 1 (int sectorTag)
{
   Door_Open( sectorTag, 48, 0 ); // Open door tagged sectorTag
}
Now when this script executes, it will use whatever value you have given for sectorTag and open the corresponding door. To give sectorTag a value, you pass it in the ACS_Execute call. Where before you might have just put ACS_Execute on a line and just given the first number as the number of the script, now you give the first number as the script and the third number as the value of the first argument. So all your switches would have the special ACS_Execute with a first argument of 1, but the third arguement would be 3 on one of them (to open door 3), 4 on another (to open door 4), and 5 on the last one (to open door 5.)
User avatar
mac53
Posts: 251
Joined: Sun Dec 17, 2006 11:15 am
Location: Delmarva Peninsula, MD USA
Contact:

Post by mac53 »

Thanks Zip...

That's a hellava explaination, brother... I extend my gratitude...
but, there's one thing buddy, The script format you were talking about in the begining of you post! Is the one that I did and it didn't function! I declared a linedef id of 1, actually in my test map, the linedef id is 1, so that's the number I used and the rest of it is what I posted in my last post, in the code section. Anyway, I'll go back and try to make this work using the info you just provided.

Thanks again, bruz...
*******************************************************

Thank you Zipper...!!! Worked like a charm, my friend. Damn man...
you seriously got one head on your shoulders, pal... :thumb:
User avatar
mac53
Posts: 251
Joined: Sun Dec 17, 2006 11:15 am
Location: Delmarva Peninsula, MD USA
Contact:

Post by mac53 »

I have a question about getting the ArchVile to run around resurrecting
dead monsters instead of focusing on trying to kill the player. I was reading in the "Decorate" wiki about this:

Code: Select all

A VileChase
Would someone please explain to me how this is applied?

Decorate or Script

I'm a little confused as to how this is applied.


Thanks
User avatar
Medricel
Posts: 1138
Joined: Sat Nov 20, 2004 9:47 am

Post by Medricel »

mac53 wrote:I have a question about getting the ArchVile to run around resurrecting
dead monsters instead of focusing on trying to kill the player. I was reading in the "Decorate" wiki about this:

Code: Select all

A VileChase
Would someone please explain to me how this is applied?

Decorate or Script

I'm a little confused as to how this is applied.


Thanks
It's a different kind of behavior code, so it should go where A_Chase would go in DECORATE.
User avatar
mac53
Posts: 251
Joined: Sun Dec 17, 2006 11:15 am
Location: Delmarva Peninsula, MD USA
Contact:

Post by mac53 »

Shinjanji wrote:
mac53 wrote:I have a question about getting the ArchVile to run around resurrecting
dead monsters instead of focusing on trying to kill the player. I was reading in the "Decorate" wiki about this:

Code: Select all

A VileChase
Would someone please explain to me how this is applied?

Decorate or Script

I'm a little confused as to how this is applied.


Thanks
It's a different kind of behavior code, so it should go where A_Chase would go in DECORATE.
I'm not that familiar with the placements in "Decorate". Do you mind showing me an example? Appreciate it!

Here's my Decorate up to this point...

Code: Select all

ACTOR RevenantSoulSphere : Revenant  12345
{
	DropItem SoulSphere
}

ACTOR RevenantRedSkullKey : Revenant 13345
{
   	DropItem RedSkull
}

ACTOR HellKnightYellowSkullKey : Hellknight 14345
{
	DropItem YellowSkull
}

ACTOR Spidermastermindblueskull : Spidermastermind 15345
{
	DropItem BlueSkull
}

ACTOR OMancubus : Mancubus 16345
{
	DropItem Soulsphere
}

Would someone help me with a "Behavior" command for an ArchVile?
I would like to enter "A_VileChase" behavior command, so that the ArchVile will ressurect the dead instead of tracking down the player.
User avatar
Zippy
Posts: 3302
Joined: Wed Mar 23, 2005 5:31 pm
Location: New Jersey

Post by Zippy »

It won't work how you think. Here's the thing...

A_Chase and A_VileChase are DECORATE Action Functions (otherwise known as codepointers.) They're calls to game functions which basically give the monster behavior. In example, the function A_CustomMissile is, relatively straightforwardly, a function which will cause a monster to fire a projectile.

A_Chase is the function most monsters use to hunt down the player. What it does is make the monster move a little bit towards the player and then randomly determine if it should or should not try to attack the player (the behavior is actually more complex then this, but you get the general idea.) So, when the monster repeatidly calls this function while displaying its walking animations, what you get is the appearance of a monster which is creeping towards the player, and every now and then it will try to attack the player.

A_VileChase is basically the same thing, but in addition to moving towards the player and attacking him, it will check to see if there are any nearby corpses to resurrect. So the Archvile normally uses this function to do what it does anyway. It does not cause the monster to specifically seek out corpses only.

If you want to make an Archvile which doesn't attack the player but only resurrects corpses, I imagine the best you can do is to create a new monster which inherits from the Archvile but removes his attack. Thus, all he can do is resurrect corpses he passes by. The problem with this is that he still chases the player (he just never tries to attack him), because there is no action function for just looking for corpses.

Code: Select all

ACTOR ArchvileNoAttack : Archvile 17345
{
	States
	{
		// Remove the Archvile's Missile state to prevent it from attacking
		Missile:
			Stop
	}
}
User avatar
mac53
Posts: 251
Joined: Sun Dec 17, 2006 11:15 am
Location: Delmarva Peninsula, MD USA
Contact:

Post by mac53 »

That's a real nice explaination, Zip...

I copied & paste the above Decorate and removed the comment.

I applied this Vile in two locations in my map. In the first one, the Vile just ran all over the place... running over corpses and just chasing the player w/o damage occuring. In the second app the Vile ran around and actually did some resurrecting. I don't know what happened with the Vile in the first app... he didn't do a damn thing, except run and there were plenty of dead for him, too! :?


I still thank you, for taking the time to explain this as you did... :thumb:
User avatar
Zippy
Posts: 3302
Joined: Wed Mar 23, 2005 5:31 pm
Location: New Jersey

Post by Zippy »

If your dead monsters were some of the preplaced decoration dead bodies, they can't be resurrected because they aren't actual monsters. At least, I believe that's the case. If that's what you tried, what you could do is instead place actual monsters in the places you want the dead bodies to be, give them all the same TID, and then in an open script use [wiki]Thing_Destroy[/wiki] to kill them all right at the start of the map.
User avatar
mac53
Posts: 251
Joined: Sun Dec 17, 2006 11:15 am
Location: Delmarva Peninsula, MD USA
Contact:

Post by mac53 »

No, they weren't Decors.
User avatar
Zippy
Posts: 3302
Joined: Wed Mar 23, 2005 5:31 pm
Location: New Jersey

Post by Zippy »

Then, I'm not sure what it could be other than coincidence. The quick test I gave the archvile had it resurrecting dead monsters it came across without problems.
User avatar
mac53
Posts: 251
Joined: Sun Dec 17, 2006 11:15 am
Location: Delmarva Peninsula, MD USA
Contact:

Post by mac53 »

Yeah, I agree about it being a coincidence. Because I just ran the map about a half hour before this post time and I had no problems at all. I guess it had to get acclimated... ;-)

Good work, though!

Thank you, buddy
Locked

Return to “Editing (Archive)”