PDA

View Full Version : Three more things


Roger
01-03-2002, 01:34 PM
1. I need the full code to make a wall type object that shatters when hit by any weapon. I put this:
</font><blockquote><font size="1" face="Verdana, Arial">code:</font><hr /><pre style="font-size:x-small; font-family: fixed;">
useractor notenemy CRACKCRATE
cstat 16
ifhitweapon
debris SCRAP1 6
enda
[/code]</blockquote><font size="2" face="Verdana, Arial">

2. What is the full code to make the tripbomb into a timed explosive in EDuke?

3. What is the full code to make the pipebomb activated by remote in EDuke?

sir_plague
01-03-2002, 03:15 PM
About the useractor, you don't necessarily have to put cstat 16, since you can make it flat in build (since it's not an enemy).

At least I think what I just said is correct, I haven't done anything CON-wise in a long time.
images/icons/tongue.gif

Roger
01-03-2002, 03:30 PM
I tried making something flat in Build (btw, it had con coding w/o "cstat 16") and it was a regular view sprite (where it always seems to watch you) when I tested it.

cyborg
01-03-2002, 06:11 PM
Originally posted by Roger:
[QB]1. I need the full code to make a wall type object that shatters when hit by any weapon. I put this:[qb]<font size="2" face="Verdana, Arial">

What's wrong with the code you have now? It should be producing scraps each time the sprite is hit. If you want it to dissapear there is a fairly obvious primitve you're missing out.

2. What is the full code to make the tripbomb into a timed explosive in EDuke?<font size="2" face="Verdana, Arial">

None. It's the default mechanism and frankly the old pipebomb mode doesn't seem to work.

Roger
01-04-2002, 09:41 PM
Oh, yeah, I forgot to mention killit (yes, I put it in the code before I started the topic). It's totally deleted from the map before anything can happen to it, though.

Just to tell ya, you quoted the wrong part (you quoted 2 and answered 3).

[GRAMMATICAL EDIT]

[ 01-04-2002: Message edited by: Roger ]

cyborg
01-05-2002, 07:36 AM
Originally posted by Roger:
Just to tell ya, you quoted the wrong part (you quoted 2 and answered 3).<font size="2" face="Verdana, Arial">

In that case you can't do anything with the tripbomb.

Bruce Hamilton
01-05-2002, 02:14 PM
Originally posted by Roger:
It's totally deleted from the map before anything can happen to it, though.<font size="2" face="Verdana, Arial">
Any chance you might've forgotten the { } on the ifhitweapon statement?
</font><blockquote><font size="1" face="Verdana, Arial">code:</font><hr /><pre style="font-size:x-small; font-family: fixed;">
useractor notenemy CRACKCRATE
cstat 16
ifhitweapon {
debris SCRAP1 6
killit }
enda
[/code]</blockquote><font size="2" face="Verdana, Arial">

cyborg
01-05-2002, 02:51 PM
Wouldn't it be just so much easier if Duke would guess where you meant to put in the brackets eh?

sir_plague
01-06-2002, 12:07 AM
Sorry about that, I tried, I never really made a new breakable sprite before. images/icons/grin.gif

Bruce Hamilton
01-06-2002, 09:15 AM
Originally posted by cyborg:
Wouldn't it be just so much easier if Duke would guess where you meant to put in the brackets eh?<font size="2" face="Verdana, Arial">
Would make con hacking much easier. images/icons/tongue.gif

[ 01-06-2002: Message edited by: Bruce Hamilton ]

Manson
01-10-2002, 04:50 AM
Originally posted by cyborg:
Wouldn't it be just so much easier if Duke would guess where you meant to put in the brackets eh?<font size="2" face="Verdana, Arial">Good idea, I'll ask to put it on the 'to do list' graemlins/hhg.gif

Roger
01-11-2002, 01:29 AM
</font><blockquote><font size="1" face="Verdana, Arial">code:</font><hr /><pre style="font-size:x-small; font-family: fixed;">
useractor notenemy CRACKCRATE
ifhitweapon
{
debris SCRAP1 6
killit
}
enda
[/code]</blockquote><font size="2" face="Verdana, Arial">Yep, the brackets fixed it. Now I got a problem with a sprite that I want to copy masked glass walls. Instead, it just turns into a floor sprite when hit.

</font><blockquote><font size="1" face="Verdana, Arial">code:</font><hr /><pre style="font-size:x-small; font-family: fixed;">
useractor notenemy NEWGLASS
ifhitweapon
{
cstat NEWGLASS_B
}
enda

action GLASSISBREAKING 0 5 1 1 1

useractor notenemy NEWGLASS_B
action GLASSISBREAKING
{
ifactioncount 5
killit
}
enda
[/code]</blockquote><font size="2" face="Verdana, Arial">(There are blank lines between enda, action, and useractor.)

Bruce Hamilton
01-11-2002, 11:49 AM
Originally posted by Roger:
Yep, the brackets fixed it. Now I got a problem with a sprite that I want to copy masked glass walls. Instead, it just turns into a floor sprite when hit.<font size="2" face="Verdana, Arial">I'm pretty new to con hacking, so this might not work either, but I'd code it this way...
</font><blockquote><font size="1" face="Verdana, Arial">code:</font><hr /><pre style="font-size:x-small; font-family: fixed;">
action GLASSISBREAKING 0 5 1 1 1
ai BREAKGLASS GLASSISBREAKING NO_MOVE

useractor notenemy NEWGLASS_B
ifhitweapon
ai BREAKGLASS
{
ifactioncount 5
killit
}
enda
[/code]</blockquote><font size="2" face="Verdana, Arial">

[ 01-11-2002: Message edited by: Bruce Hamilton ]

Roger
01-11-2002, 02:43 PM
The command "cstat" I believe causes a sprite to either have a type of flag (numbers) or causes a sprite to change into another sprite. I have once tried something where if it gets hit by something, it commences an action. However, it started the action before I could do anything, thus, I tried to use cstat.

Newglass_b is the sprite that automatically goes through the action (the glass sprite's breaking frames).

I suck at con.

Roger
01-11-2002, 02:55 PM
Originally posted by Bruce Hamilton:
I'm pretty new to con hacking, so this might not work either, but I'd code it this way...
</font><blockquote><font size="1" face="Verdana, Arial">code:</font><hr /><pre style="font-size:x-small; font-family: fixed;">
action GLASSISBREAKING 0 5 1 1 1
ai BREAKGLASS GLASSISBREAKING NO_MOVE

useractor notenemy NEWGLASS_B
ifhitweapon
ai BREAKGLASS
{
ifactioncount 5
killit
}
enda
[/code]</blockquote><font size="2" face="Verdana, Arial"><font size="2" face="Verdana, Arial">Ya have to change "NO_MOVE" to 0. Thanks.

[ 01-11-2002: Message edited by: Roger ]

cyborg
01-11-2002, 06:20 PM
Originally posted by Roger:
The command "cstat" I believe causes a sprite to either have a type of flag (numbers) or causes a sprite to change into another sprite.<font size="2" face="Verdana, Arial">God no. CSTAT *ONLY* affects the CSTAT member of the actor.
These flags control:
texture alignment
floor/wall alignment
side-y-ness
centering

If you don't actually know what the primitives do you're going to find a lot of stuff not working because Duke does know what they do and it's going to disagree with what you think they should do.

Sprites don't 'mutate' into other sprites. They either change appearance (using actions), or they may spawn a completely different sprite in their place. You cannot make a sprite change it's basic identity.

I have once tried something where if it gets hit by something, it commences an action. However, it started the action before I could do anything, thus, I tried to use cstat.<font size="2" face="Verdana, Arial">I'm going to go out on a limb and guess your logic flow is to blame here. You really don't get brackets do you?

Newglass_b is the sprite that automatically goes through the action (the glass sprite's breaking frames).<font size="2" face="Verdana, Arial">No it ain't. Newglass_b is a number that's taken the form of a series of alphanumeric symbols for the convenience of humans. Given it's pointing to a tile in this case you are setting the CSTAT flags of your sprite to a tile number - hence the irratic behaviour.

cyborg
01-12-2002, 12:10 AM
(There are blank lines between enda, action, and useractor.)<font size="2" face="Verdana, Arial">Blank lines do nothing.

I really don't quite see what you expect cstat NEWGLASS_B to achieve.
You do know the function of cstat right?