Essence is simple, after loading map run acs/event/etc which randomly jump on map floor/wall/ceiling check what texture and what dimension of plane with this texture and spawn at this point some decorations.
Like, if it meet computer texture at wall it spawn broken computer part near it, if meet guts/flesh texture spawn eye, if blood pool spawn bloody skeleton, if acid pool spawn bleached to blindingly white skeleton, if fire pool roasted skeleton, if default floor texture gnawed skeleton... skeleton, skeleton everywhere.
But I dont know how make acs/event/etc. radomply pick points on map. How make it?
Spawn decorations depending of texture
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!)
Re: Spawn decorations depending of texture
It seems it could be made in ZScript.
1) Spawn Actor somewhere (in some random coordinates)
2) Get this actor current sector (CurSector)
3) Get this sector floor texture (native TextureID GetTexture(int pos) from mapdata.txt)
and I don't know how this function works - what is this "pos". I see there is some Enum in there, maybe floor = 0, ceiling = 1. You need to test it.
4) Change this actor sprite to some sprite depending on the texture gotten from function
1) Spawn Actor somewhere (in some random coordinates)
2) Get this actor current sector (CurSector)
3) Get this sector floor texture (native TextureID GetTexture(int pos) from mapdata.txt)
and I don't know how this function works - what is this "pos". I see there is some Enum in there, maybe floor = 0, ceiling = 1. You need to test it.
4) Change this actor sprite to some sprite depending on the texture gotten from function
Re: Spawn decorations depending of texture
ZScript is definitely the way to do it, but there's a better approach than spawning actors randomly - you can iterate through the sectors (level.sectors) and lines (level.lines) to check their textures directly, then spawn stuff depending on the texture. You can see an example of this in the Joy of Mapping 5's weather system - viewtopic.php?f=42&t=58528.