PointLight problem

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

PointLight problem

Postby Hell-met » Tue Sep 28, 2021 7:10 pm

Good day

I made a custom item and gave it a light, when I summon the item manually everything is fine but when I load a map the light does not show up.

I do not understand since I've applied the exact same lines used by stock items that way.

http://www.sourceop.com/hell-met/d.png

help
Hell-met
 
Joined: 28 Oct 2019

Re: PointLight problem

Postby Blue Shadow » Tue Sep 28, 2021 10:32 pm

If you're using GZDoom 4.7.0, then you should know that it suffers problems with dynamic lights. So test with an older version, 4.6.1 preferably. If you still get the same problem, then it's most likey something on your side. So post all relevant code of the item and its dynamic light.
User avatar
Blue Shadow
 
Joined: 14 Nov 2010
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: PointLight problem

Postby Hell-met » Wed Sep 29, 2021 1:52 pm

Thank you for your reply

I am using 4.6.1 with the same trouble

here is the script

ACTOR NewSphere : Health
{
Inventory.Amount 5000
Inventory.PickupMessage "Evilsphere!"
Inventory.PickupSound "misc/p_pkup"
+INVENTORY.AUTOACTIVATE
+INVENTORY.ALWAYSPICKUP
+INVENTORY.BIGPOWERUP
States
{
Spawn:
HPHP ABCD 6 Bright
loop
}
}


pulselight NEWPOWER
{
color 1.0 0.0 1.0
size 40
secondarySize 42
interval 2.0
offset 0 16 0
}

object NewSphere
{
frame HPHP { light NEWPOWER }
}
Hell-met
 
Joined: 28 Oct 2019

Re: PointLight problem

Postby Logan MTM » Wed Sep 29, 2021 6:19 pm

Everything seams right!

DLight.pk3


Hell-met wrote:Good day

...when I summon the item manually everything is fine but when I load a map the light does not show up.


How did you do that if there is no "Actor Type number"?

Spoiler:

Spoiler:
You do not have the required permissions to view the files attached to this post.
User avatar
Logan MTM
I can see you...
 
Joined: 16 Jan 2006
Location: Rio de Janeiro - Brazil

Re: PointLight problem

Postby Hell-met » Wed Sep 29, 2021 9:11 pm

i just type "summon newsphere" and that one comes with the correct light.

I should mention I use "newsphere replaces greenarmor", perhaps this has something to do with the problem?
Hell-met
 
Joined: 28 Oct 2019

Re: PointLight problem

Postby Logan MTM » Thu Sep 30, 2021 5:50 am

You should have downloaded the file above!
User avatar
Logan MTM
I can see you...
 
Joined: 16 Jan 2006
Location: Rio de Janeiro - Brazil

Re: PointLight problem

Postby Enjay » Thu Sep 30, 2021 6:05 am

Logan MTM wrote:How did you do that if there is no "Actor Type number"?

That could be in the MAPINFO, which is the newer way of allocating editor numbers.

Hell-met wrote:I should mention I use "newsphere replaces greenarmor", perhaps this has something to do with the problem?

It shouldn't be. But how are you replacing it? The code that you posted doesn't do that.

Using
Code: Select allExpand view
ACTOR NewSphere : Health replaces GreenArmor

etc
etc

would do it.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: PointLight problem

Postby Hell-met » Thu Sep 30, 2021 7:24 am

Logan MTM wrote:You should have downloaded the file above!


My bad I didn't realize that was meant for me! I will try it when I get home

Enjay wrote:
Logan MTM wrote:How did you do that if there is no "Actor Type number"?

That could be in the MAPINFO, which is the newer way of allocating editor numbers.

Hell-met wrote:I should mention I use "newsphere replaces greenarmor", perhaps this has something to do with the problem?

It shouldn't be. But how are you replacing it? The code that you posted doesn't do that.

Using
Code: Select allExpand view
ACTOR NewSphere : Health replaces GreenArmor

etc
etc

would do it.


Aye I just forgot to post the snippet here. I will try Logan's fix
Hell-met
 
Joined: 28 Oct 2019

Re: PointLight problem

Postby Hell-met » Thu Sep 30, 2021 1:28 pm

Logan MTM wrote:Everything seams right!

DLight.pk3


This only fixes the problem on Entryway, doesn't it? Unfortunately it's not the sort of solution I'm looking for, else I would have to patch virtually all maps
Hell-met
 
Joined: 28 Oct 2019

Re: PointLight problem

Postby Enjay » Thu Sep 30, 2021 2:21 pm

Hell-met wrote:This only fixes the problem on Entryway, doesn't it?

No, it shouldn't. What Logan posted is map independent. You should be able to place that powerup on any map and see the dynamic light. He just included the map to show you that it works.

However, if you want the green armour to be auto-replaced on any map that has it, use the "replaces" keyword in your DECORATE code like my example showed.
Entryway

Tricks n Traps
You do not have the required permissions to view the files attached to this post.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: PointLight problem

Postby Hell-met » Thu Sep 30, 2021 7:24 pm

Enjay wrote:
Hell-met wrote:This only fixes the problem on Entryway, doesn't it?

No, it shouldn't. What Logan posted is map independent. You should be able to place that powerup on any map and see the dynamic light. He just included the map to show you that it works.

However, if you want the green armour to be auto-replaced on any map that has it, use the "replaces" keyword in your DECORATE code like my example showed.
Entryway

Tricks n Traps


Thank you for your reply

but... I'm really lost. From what I see the only difference with the fix and my attempt is its using the MEGA sprite, and not my own purple ball sprite (HPHP).
Hell-met
 
Joined: 28 Oct 2019

Re: PointLight problem

Postby Logan MTM » Thu Sep 30, 2021 8:10 pm

Working with "HPHP" Sprites!

DLight.pk3
You do not have the required permissions to view the files attached to this post.
User avatar
Logan MTM
I can see you...
 
Joined: 16 Jan 2006
Location: Rio de Janeiro - Brazil

Re: PointLight problem

Postby Enjay » Thu Sep 30, 2021 11:25 pm

Hell-met wrote:the only difference with the fix and my attempt is its using the MEGA sprite, and not my own purple ball sprite (HPHP).

Not quite the only difference, but very similar, yes.
Neither Logan nor I had access to your sprites so the MEGA ones were just used as a stand-in. :wink:

[edit]
I've just had a quick look at Logan's most recent example which, of course, works fine (nice improvisation on the sprites Logan ;) ). However, if you just want your item to auto-replace the GreenArmor (which one of your posts indicated you might) then change the first line of Logan's DECORATE code from:
Code: Select allExpand view
ACTOR NewSphere : Health 2000

to
Code: Select allExpand view
ACTOR NewSphere : Health replaces GreenArmor

as per my earlier example - and then wherever GreenArmor appears in any map, it will be replaced with your item without the need to edit any maps.
[/edit]
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: PointLight problem

Postby Hell-met » Fri Oct 01, 2021 1:40 pm

I apologize for being dense, but I do not understand what I am supposed to do with these pk3. I looked at the scripts within and they are identical to mine.

Also, what is this number 2000 for?

Code: Select allExpand view
ACTOR NewSphere : Health 2000


Furthermore, I have attempted to replace various items with a simple soulsphere and I noticed its dynamic light also do not show up strangely, much akin to my problem. Seems to me it's a problem with the "replaces" function?

http://www.sourceop.com/hell-met/soul.png
Hell-met
 
Joined: 28 Oct 2019

Re: PointLight problem

Postby Enjay » Fri Oct 01, 2021 3:22 pm

Not a problem, you just haven't seen the replacement through to the end. ;)

When you use "replaces" GZDoom replaces any instance of the item appearing in a map with the new item. The thing is, it is a new item. So it doesn't inherit the dynamic lights from the actor it is replacing (which is correct behaviour because the new item could be totally different and the light would look wrong).

The PK3s are example files (both Logan's and mine) that you can run to see their effect and open to see how things are done. Logan's ones come with a map, mine doesn't because all you need to do is go to any map in Doom2 that has a green armor item and look at it - it will be replaced with an item that looks like a megasphere, but has your item's behaviour and the purple dynamic light. If that's what you want, just copy and paste the details from the files in my example PK3 into your own files, change the MEGA sprite names in my DECORATE to your own sprite names and it should work.

The "2000" is an editor number that Logan allocated to the item so that if you want to place it in a map directly, you use the number 2000 in your map editor. You can, of course, change the number to suit your needs.

However, one of your posts implied that you wanted to replace the green armor. In that case, you do not need to have the 2000, just the "replaces GreenArmor" line and wherever there was originally a green armor in game, you new item will appear. This is what my example does.

As for why ours both work and your doesn't - it's very difficult to tell unless you actually send us your file to check.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Next

Return to Scripting

Who is online

Users browsing this forum: No registered users and 0 guests