Spoiler:
Actor PebbleSpawner 30407
{
Radius 1
Height 1
+NoClip
+ClientSideOnly
+SpawnCeiling
+NoGravity
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_JumpIf(Args[2] > 0, "NoSound")
TNT1 A 0 A_JumpIf(Args[3] > 0, "Circle")
TNT1 A 0 A_PlaySoundEx("Ambient/Pebble", "SoundSlot7", 1)
TNT1 A 2 A_SpawnItemEx("PebbleDrop", Random(-Args[0], Args[0]), Random(-Args[0], Args[0]), -2, 0, 0, 0, 0, 128, Args[1])
Loop
Circle:
TNT1 A 2 A_SpawnItemEx("PebbleDrop", Random(-Args[0], Args[0]), 0, -2, 0, 0, 0, Random(0, 360), 128, Args[1])
NoSound:
TNT1 A 0 A_Jumpif(Args[3] > 0, "NoSoundCircle")
TNT1 A 2 A_SpawnItemEx("PebbleDrop", Random(-Args[0], Args[0]), Random(-Args[0], Args[0]), -2, 0, 0, 0, 0, 128, Args[1])
Loop
NoSoundCircle:
TNT1 A 2 A_SpawnItemEx("PebbleDrop", Random(-Args[0], Args[0]), 0, -2, 0, 0, 0, Random(0, 360), 128, Args[1])
Loop
}
}
Actor PebbleDrop
{
+Missile
+NoBlockMap
-NoGravity
Height 2
Radius 2
States
{
Spawn:
RNDR A 1 A_JumpIf(WaterLevel > 0, "Death")
Loop
Death:
RNDR BCDEFGHIJKL 3 A_FadeOut(0.15)
Stop
}
}
How can I make this decorate switchable via scripting?
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.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
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.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
How can I make this decorate switchable via scripting?
How can I make this decorate code switchable? Meaning I'm able to activate and deactivate using scripting?
Spoiler:
- Attachments
-
PebbleSpawner.zip
- (5.11 KiB) Downloaded 17 times
Re: How can I make this decorate switchable via scripting?
This wiki page might help.
Your spawner has to inherit from SwitchableDecoration to enable activation and deactivation.
Then you have to put your Spawn code into the Active state.
Your spawner has to inherit from SwitchableDecoration to enable activation and deactivation.
Then you have to put your Spawn code into the Active state.
Spoiler: Untested
Re: How can I make this decorate switchable via scripting?
Thanks Jarewill!! Also how can I change the RNDR A 1 A_JumpIf(WaterLevel > 0, "Death") so the rocks will not crumble as soon as it hits water?
-
- Posts: 53
- Joined: Fri Jan 08, 2021 6:53 pm
- Graphics Processor: Intel (Modern GZDoom)
- Location: Ye Olde StinkHole
Re: How can I make this decorate switchable via scripting?
you need to change the state from "Death" to whatever new state where the rocks don't crumble.gunrock wrote:Thanks Jarewill!! Also how can I change the RNDR A 1 A_JumpIf(WaterLevel > 0, "Death") so the rocks will not crumble as soon as it hits water?
So, RNDR A 1 A_JumpIf(WaterLevel > 0, "PLACETHENEWSTATEHERE")
Re: How can I make this decorate switchable via scripting?
Thanks as always
Re: How can I make this decorate switchable via scripting?
Another thing that might be useful for you:
waterlevel — How "submerged" the actor is in a Transfer_Heights or 3D floor water pool:
0: Not submerged at all (e.g. standing on solid ground or on shallow TERRAIN-based water)
1: Less than half submerged ("ankle deep")
2: At least half submerged ("waist deep")
3: Entirely submerged (completely underwater)
waterlevel — How "submerged" the actor is in a Transfer_Heights or 3D floor water pool:
0: Not submerged at all (e.g. standing on solid ground or on shallow TERRAIN-based water)
1: Less than half submerged ("ankle deep")
2: At least half submerged ("waist deep")
3: Entirely submerged (completely underwater)
Re: How can I make this decorate switchable via scripting?
How can I slow down the speed of the rocks falling? They are falling a little to fast. They need to be just a little bit slower.
Here is my new modified decorate code structure.
Here is my new modified decorate code structure.
Spoiler:
Re: How can I make this decorate switchable via scripting?
Also the rocks seem to be clipping in the ground. They are not crumbling when hitting ground level. They are actually going through the ground:(
Re: How can I make this decorate switchable via scripting?
Add the Gravity property to the RockDrop actor and set it to a value lower than 1.gunrock wrote:How can I slow down the speed of the rocks falling? They are falling a little to fast. They need to be just a little bit slower.
I doubt they are going through the ground, their offsets might be not set properly.gunrock wrote:Also the rocks seem to be clipping in the ground. They are not crumbling when hitting ground level. They are actually going through the ground:(
As for making them disappear when they hit the ground, A_CheckFloor might help here.
Code: Select all
Actor RockDrop
{
+Missile
+NoBlockMap
-NoGravity
Height 2
Radius 2
Gravity 0.5
States
{
Spawn:
TNT1 A 0 A_CheckFloor("Death")
RNDR A 1 A_JumpIf(WaterLevel > 0, "Death")
Loop
Death:
RNDR BCDEFGHIJKL 3 A_FadeOut(0.15)
Stop
}
}
Re: How can I make this decorate switchable via scripting?
Thanks Jarewill!!