Duke4.net Forums: Vents and other sprites that break - Duke4.net Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Vents and other sprites that break

User is offline   Awesomebob 

#1

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.
0

User is offline   CruX 

#2

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...

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.
0

User is online   Danukem 

  • Duke Plus Developer

#3

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.
0

User is offline   CruX 

#4

It's automatically wall-aligned only if it has a nonzero hitag, though. Otherwise, it'll be whatever you set it to in mapster.
0

User is online   Danukem 

  • Duke Plus Developer

#5

View PostEmericaSkater, 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

0

User is offline   CruX 

#6

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.
0

User is offline   Stabs 

#7

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
0

User is online   Danukem 

  • Duke Plus Developer

#8

View PostDanM, 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.
0

User is offline   Awesomebob 

#9

View PostDeeperThought, 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 :)
0

User is offline   Stabs 

#10

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
0

User is offline   Awesomebob 

#11

OK. I'm a tard... I had the high tag obscure and low tag zero. Flipped them around and it worked great.

Attached thumbnail(s)

  • Attached Image: duke0001.jpg


This post has been edited by Awesomebob: 25 September 2010 - 10:23 AM

0

User is offline   Stabs 

#12

you need it activated somehow just put an activator at the start of the level
0

User is offline   Helixhorned 

  • EDuke32 Developer

#13

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...
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks not owned by Voidpoint, LLC are the sole property of their respective owners. Play Ion Fury! ;) © Voidpoint, LLC

Enter your sign in name and password


Sign in options