Is there a way to turn off the "breakable bit" on these sprites? I'd like to use vents on the floor to reveal an area to the player, but not allow them to get to it till they jump through the appropriate hoops first.
Page 1 of 1
Vents and other sprites that break
#1 Posted 25 September 2010 - 06:36 AM
#2 Posted 25 September 2010 - 06:58 AM
Hmm. I'd wager that there's some uber-easy way to do it in mapster, but I messed around with it and couldn't come up with anyway to do it (though on a side note, you can edit abunch of properties in a sprite by pressing F8 when it's highlighted...just in case you didn't know). I can still help, though, because what you're wanting to have done to it can be accomplished very easily with a few minor coding changes.
Open up the GAME.CON and include these couple of lines below the "action ANULLACTION 0" line...
Then somewhere else in the con file (preferably at the bottom of it for the sake of keeping things organized), put in this line
Then just put the grate in the game and set its hitag to 1. The only thing the code I posted really does is take away the grate's ability to be hit by weapons if it has a non-zero hitag.
Open up the GAME.CON and include these couple of lines below the "action ANULLACTION 0" line...
gamevar hitagsaved 0 2 gamevar TEMP1 0 0 gamevar picnum 0 2
Then somewhere else in the con file (preferably at the bottom of it for the sake of keeping things organized), put in this line
eventloadactor GRATE1 getactor[THISACTOR].hitag hitagsaved setactor[THISACTOR].hitag 0 enda onevent EVENT_GAME getactor[THISACTOR].picnum picnum switch picnum case GRATE1 getactorvar[THISACTOR].hitagsaved TEMP1 ifvarn TEMP1 0 { setactor[THISACTOR].cstat 17 } break endswitch endevent
Then just put the grate in the game and set its hitag to 1. The only thing the code I posted really does is take away the grate's ability to be hit by weapons if it has a non-zero hitag.
#3 Posted 25 September 2010 - 08:38 AM
That code will make all grate sprites wall-aligned.
He should just use a different tile that isn't hardcoded to break when you shoot it. Or he could put invisible, unbreakable flat sprites on top of the grate sprites, which would require no new code.
He should just use a different tile that isn't hardcoded to break when you shoot it. Or he could put invisible, unbreakable flat sprites on top of the grate sprites, which would require no new code.
#4 Posted 25 September 2010 - 08:48 AM
It's automatically wall-aligned only if it has a nonzero hitag, though. Otherwise, it'll be whatever you set it to in mapster.
#5 Posted 25 September 2010 - 09:00 AM
EmericaSkater, on Sep 25 2010, 09:48 AM, said:
It's automatically wall-aligned only if it has a nonzero hitag, though. Otherwise, it'll be whatever you set it to in mapster.
He said he wanted the FLOOR grates to be unbreakable, and your code would make all the tagged ones into wall grates. But that's minor (just make the cstat 33 instead).
The bigger issue here is that using code would be going about this the wrong way. Including code will make the map incompatible with mods and also complicate it unnecessarily, resulting in fewer people playing it. All he has to do is put in some flat sprites of the same size slightly above the grates, then press F8 on them in 2D mode and give them a cstat of 33057 (blocking + flat + hitscan + invisible).
This post has been edited by DeeperThought: 25 September 2010 - 09:05 AM
#6 Posted 25 September 2010 - 09:06 AM
Oops, missed that. But at that going rate, he may as well just take your first suggestion and copy/paste it to another tile. Layering other sprites over the grate just seems sort of jerry-rigged.
#7 Posted 25 September 2010 - 09:06 AM
duh use a prop sprite command in dukeplus to conjure the vent sprite which will exclude its coding and use a blocking sprite (#507 with lotag 1) to make it blocking if your using extra code you may aswell use dukeplus
#8 Posted 25 September 2010 - 09:09 AM
DanM, on Sep 25 2010, 10:06 AM, said:
duh use a prop sprite command in dukeplus to conjure the vent sprite which will exclude its coding and use a blocking sprite (#507 with lotag 1) to make it blocking if your using extra code you may aswell use dukeplus
But then the map will only work properly with DukePlus.
#9 Posted 25 September 2010 - 09:15 AM
DeeperThought, on Sep 25 2010, 09:09 AM, said:
But then the map will only work properly with DukePlus.
Bomb Idea cause it's a duke plus map!
Thanks all, off to work on me map
#10 Posted 25 September 2010 - 09:16 AM
use tile 2234 as a flat blocking sprite above and below the vent sprite, assuming its a small area only explosion will break it and if ppl use explosions chances are the small area will have them kill themselves in the explosion
another alternative is make the vent so small that even if broken ppl cant get through it
another alternative is make the vent so small that even if broken ppl cant get through it
#11 Posted 25 September 2010 - 10:02 AM
OK. I'm a tard... I had the high tag obscure and low tag zero. Flipped them around and it worked great.
This post has been edited by Awesomebob: 25 September 2010 - 10:23 AM
#12 Posted 25 September 2010 - 10:05 AM
you need it activated somehow just put an activator at the start of the level
#13 Posted 25 September 2010 - 11:09 AM
I think using an invisible sprite is the best option. Right now it's a bit of a pain to enter (or add) the cstat 32768 in decimal in Mapster and you won't see the sprite from then on, but I might come up with some convenience...
Share this topic:
Page 1 of 1