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.
Hi programmers, I need a bit of aid on some scripts that needs to be exported as an external functional library, in order to have more polished/coherent mapping codes for Gore. While this will be indeed hard to explain for me, here you are the problem:
Instead of using some 3d objects, I've just draw some script (inspired to old Hexen's behaviour scripts) for recreate an useful breakable window code. In order to get functional inside maps (that at the moment are in hexen's format), I'm using a fake actor called ZWindow, using hitscans as an activator: when this object enters on its death state, tagged lineid texture changes (from window intact to broken), spreading from it all around shards + breaking glass sounds. Here you are also some screenshots that explain how I set everything inside GZDBuilder + how it works in game:
//Special Window Thing - Useful only with ACS
ACTOR ZWindow8 119
{
//$Category Special Effects
Tag "Window 8x"
Game Doom
Health 1
Radius 4
Height 128
+SHOOTABLE
+NOBLOOD
+NOBLOODDECALS
Activation THINGSPEC_MissileTrigger
States
{
Spawn:
NULL A 4 Bright
Loop
Death:
NULL A -1
Stop
}
}
//this is the code, # stays for used thing tags
script 12 (int arg0, int arg1, int arg2)
{
SetLineBlocking(#,FALSE); //unfortunately, while flying over it when it's TRUE, you're obviously blocked from it, maybe in UDMF this could be fixed in a better way
thing_remove(#); //this remove the ZWindow actor in order to prevent some lags, but this isn't mandatory
setlinetexture(#, SIDE_FRONT, TEXTURE_MIDDLE, "TEXTUREB"); //change tagged lineid texture in something "broken"
setlinetexture(#, SIDE_BACK, TEXTURE_MIDDLE, "TEXTUREB"); //change tagged lineid texture in something "broken"
//Floor_LowerInstant(arg0, 0, 16);//arg0 = optional 3d tagged sector for some waggling sectors/objects
thingsound(#,"misc/goreglass",random (127,192));//From placed MapSpot sound emitter
delay(const:1);
var0 = 32; //shards amount
while(var0 > 0) //spawn shards until it reaches 32
{
var0--;
Thing_ProjectileGravity(arg1, random(54, 63), random(0,359), random(12, 30), random(5, 20));//glass shards from tagged MapSpot, same as sounds
Thing_ProjectileGravity(arg2, random(54, 63), random(0,359), random(12, 30), random(5, 20));//glass shards from tagged MapSpot, same as sounds
}
}
So, is there a way to make this script more indipendent, like an external library, instead of using multiple/case script for each maps? All your help with it will be highly appreciated. Thankx and
Isn't it enough if you set the activation type of windows line to "projectile hits"?
unfortunately, while flying over it when it's TRUE, you're obviously blocked from it, maybe in UDMF this could be fixed in a better way
Can you fly over it at all?
Otherwise use flag 32 from here:
[wiki]Line_SetIdentification[/wiki]
As far as I remember hitscan attacks can pass through lines with 3D middle texture flag.
"THINGSPEC_MissileTrigger" — missiles are allowed to trigger the thing. -> But you can do it without a thing by setting MissilesActivateImpactLines in MAPINFO.
And here is a glass break example for Hexen in UDMF format:
Thankx Cocka, I'll surely take a look into these... BTW to turn of 3d midtx I could create a 3dsector that will lower instantly when hit by missiles/projectiles, but for now I'm using hexen's formats and not UDMF... in hexen's format if I set a line with "projectile hits", everything that's a missile or projectile will activate it EVEN IF AIMING UP OR DOWN THE TARGET, so I've added this ZWindow for the purpose in order to avoid laggin' 3dsectors (my maps will be really huge, and that's why I think it's best to go for UDMF).
In the end, I will surely take a look more deeply inside mine + yours scripts... If you are interested on it, why don't you try Gore at map99, take the purple key and go to effects hall? You'll see what I'm trying to explain here... (NO, I'M NOT TRYING TO ADVERTISE MY PROJECT..... or no? ). Time to go to sleep, where I live it's 4:46am...
If you just set midtex3d only, when you shoot at the window it stays unaffected by your projectiles. It simply ignores the "projectile hits/impacts" activation mode. It only works if you set "block projectiles" on the line, but in that case the whole wall-face will block the projectiles.
where I live it's 4:46am...
Then we live in the same time zone. UTC+1
I could create a 3dsector that will lower instantly
But that would look quite strange that if you shot at the window, it would simply vanish after smashing it.
Last edited by cocka on Sun Feb 15, 2015 12:14 pm, edited 1 time in total.
In Italy impassible translation becomes IMPASSìBILE... BTW, for now I think I use my settings, after all I must continue on build maps for Gore, while I'm really FAR to get everything done.
If you just set midtex3d only, when you shoot at the window it stays unaffected by your projectiles. It simply ignores the "projectile hits/impacts" activation mode. It only works if you set "block projectiles" on the line, but in that case the whole wall-face will block the projectiles.
That's the reason why I'm using ZWindow objects, even for shards than for textured lineids.
Nagyon köszönöm, azonban, és ha érdekel, hogy adjon nekem egy kéz Gore nem kell tennie, hogy keressen meg. Amíg legközelebb!