Duke4.net Forums: EDuke32 Scripting - Duke4.net Forums

Jump to content

  • 93 Pages +
  • « First
  • 40
  • 41
  • 42
  • 43
  • 44
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

EDuke32 Scripting  "CON coding help"

User is offline   Mark 

#1231

I'm using flame sprite 2271 in my map in some closed in spaces. The player occasionally gets burned when walking past. I don't see anything in cons to adjust or turn off the burn. Does that mean its hard coded and I'm stuck with it?

I know I can copy and def those sprite tiles to new tile numbers and animate them. I can lose the burn, but I would also lose their flickering Polymer lights.
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1232

It's in the CON:

state firestate

  ifaction 0
    ifrnd 16
    {
      action FIRE_FRAMES
      cstator 128
    }

  sleeptime 300         // Never let it fall to sleep

  ifspawnedby FIRE
  {
    ifgapzl 16
      break
  }
  else
    ifspawnedby FIRE2
  {
    ifgapzl 16
      break
  }

  ifinwater
    killit

  ifp palive
    ifpdistl 844
      ifrnd 32
        ifcansee
  {
    soundonce DUKE_LONGTERM_PAIN
    addphealth -1
    palfrom 32 32
  }

  ifactor FIRE
  {
    ifspawnedby FIRE
      break
  }
  else
    ifactor FIRE2
      ifspawnedby FIRE2
        break

  iffloordistl 128
  {
    ifrnd 128
    {
      ifcount 84
        killit
                // This line(and the else below)
                // is not necessary, since actors
                // with zero x-size are automatically
                // deleted anyway!
      else
        ifcount 42
          sizeto 0 0
      else
        sizeto 32 32
    }
  }
  else
    killit

ends

useractor notenemy FIRE WEAK 0 FIREVELS state firestate enda

1

User is online   Danukem 

  • Duke Plus Developer

#1233

View PostMikko_Sandt, on 16 April 2013 - 05:35 AM, said:

How do I change the point of origin of a projectile? We have an actor that fires from both hands so it should appear as if the projectiles originate from these rather than the center of the sprite. Initially I simply changed the offset of the projectile when it's being fired (setactor[RETURN].xoffset, etc.) and, as far as I can tell, no one (of a whopping sample of two) noticed, but obviously this is just smoke and mirrors. Then I tried to change the projectile's x position based on its owner's position but this changed the entire trajectory, not merely the point of origin.

Edit: The projectiles are RPG-like.


I think changing offset is the correct thing to do, but you should change it before the projectile is fired, not afterwards.

e.g.
setprojectile[NAMEOFPROJECTILE].offset 128
shoot NAMEOFPROJECTILE
setprojectile[NAMEOFPROJECTILE].offset 0


In the example, the offset is set back to 0 after firing, in case another actor needs to use it (setprojectile changes the definition of the custom projectile).
0

User is offline   Mark 

#1234

Thanks again Fox. When I ran across that bit of code I wrongly assumed it was for fire that was spawned by something else in the game because of the "ifspawnedby" lines and not what I was looking for. I guess I should have changed it anyways to make sure. Shame on me.
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1235

The FIRE and FIRE2 actors are permanent, unless spawned by another actor which they fade away. The BURNING and BURNING2 will always fade away unless they are too far away from the player (or squished).

This post has been edited by Fox: 18 April 2013 - 06:49 PM

0

User is offline   Mark 

#1236

I made a breakable wood panel to be used on the floor and window openings. When I use the following code from the wiki, in game it automatically sets the sprite to view mode instead of the original floor or wall mode that is needed for these sprites. Is there a workaround for what I'm trying to do?

define WOODBREAK1 3816
useractor notenemy WOODBREAK1
cstat 257
ifhitweapon
{
sound VENT_BUST
debris SCRAP1 4
killit
}
enda

Instead of breaking code I know I can give the panels a hitag to make them disappear when hit but then there is no sound or debris.
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1237

Use cstator instead of cstat.

Here is a code which you could also define the hit points (where is says "WEAKEST" which equals 1)

useractor notenemy WOODBREAK1 WEAKEST
  cstator 257
  ifhitweapon
    ifdead
    {
      sound VENT_BUST
      debris SCRAP1 4
      killit
    }
enda 


This post has been edited by Fox: 21 April 2013 - 08:05 AM

1

User is offline   Mark 

#1238

Thanks. That weakest part should come in handy because my map will have no high powered weapons.
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1239

With only 1 hit point it will break with any weapon (except the Shrinker). But 10 hit points (MEDIUMSTRENGTH) would take two Pistol bullets which is not much.
0

User is offline   Mark 

#1240

I remember seeing something called "ifhitwasweapon" so I can specify which weapon is needed. I would like to make it breakable only with a kick.
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1241

useractor notenemy WOODBREAK1
  cstator 257
  strength 1
  ifhitweapon
    ifwasweapon KNEE
    {
      sound VENT_BUST
      debris SCRAP1 4
      killit
    }
enda 


This post has been edited by Fox: 21 April 2013 - 08:54 AM

0

User is offline   Mark 

#1242

I was looking around for what the kick was defined as. I happened to click back here and found your answer.

Cool. Duke is kickin' planks and chewing bubblegum. I'm attempting all this minor stuff now after my failures of trying to code new enemies. I needed a success to keep me sane. So next up is finding a better sound effect for the break.

This post has been edited by Mark.: 21 April 2013 - 09:12 AM

0

User is offline   Diaz 

#1243

So I've been searching through structure members and events and can't find anything for this...

When the player jumps and lands on a sector that is lower than the previous one, besides the hard landing and view centering stuff, his movement speed will decrease for a fraction of a second. I would like to avoid that if the height difference between sectors is not very big - is that actually possible? I have already avoided the view centering, but I'm making a platform section in one of my maps where the player has to make a series of quick jumps and the movement speed reduction is annoying - makes it easy and frustrating to die.

This post has been edited by Diaz: 23 April 2013 - 11:57 AM

0

User is online   Danukem 

  • Duke Plus Developer

#1244

That sounds like one of those annoying little problems which has no easy solution. As a first attempt, I would try saving the players posxv and posyv into vars as he is falling, then pushing the saved values back into posxv and posyv when he hits the ground, thereby canceling the unwanted slowdown. For this purpose you could define falling as poszv having a positive value. The tic during or immediately after which poszv goes from positive to non-positive is when you apply the saved velocity values. If you want to get more sophisticated, you could apply only a portion of the saved velocities depending on how great poszv was (so that there would still be a noticeable loss of speed after a big fall).
0

User is offline   Diaz 

#1245

Hmmm, doesn't seem to work. Either I can't translate what you're saying into code, or the values are not what I expect due to hard coded behavior... :)
0

User is offline   Mblackwell 

  • Evil Overlord

#1246

What happens if you

onevent EVENT_JUMP
    setplayer[THISACTOR].poszv -2048 // or some other value
    setvar RETURN -1
endevent


This destroys any ifp pjumping code however.
0

User is offline   Mark 

#1247

Yet another in a long line of questions.

onevent EVENT_GETLOADTILE
setvar RETURN 7119
endevent

onevent EVENT_GETMENUTILE
setvar RETURN 7119
endevent

I replaced the load and menu screens with my own but I can't figure out the name for the DREALMS tile 2492 so I can replace it. I tried a few variations of the word DREALMS between "GET" and "TILE" but no luck.
0

User is offline   Mblackwell 

  • Evil Overlord

#1248

http://wiki.eduke32....wiki/LOGO_FLAGS

gamevar LOGO_FLAGS <someval> 0

Also
http://wiki.eduke32....wiki/EVENT_LOGO
0

User is offline   Mark 

#1249

I'm a little confused with those links. Does this mean I don't replace the 3Drealms screen the same way I did the other 2 screens? Or should I be using those links to accomplish what I need instead of how I did it already?
0

User is offline   Diaz 

#1250

View PostMblackwell, on 23 April 2013 - 07:54 PM, said:

What happens if you

onevent EVENT_JUMP
    setplayer[THISACTOR].poszv -2048 // or some other value
    setvar RETURN -1
endevent


This destroys any ifp pjumping code however.


That does what I want, however it has side effects:

- As you have mentioned, ifp pjumping code is destroyed, though I think I can safely replace all instances of "ifp pjumping" with a check for the player's z velocity.
- The player can now bunnyhop like crazy if keeping the jump key depressed (no idea how to fix this).
- Jumping to get out of water messes up.

So, not worth it :)

This post has been edited by Diaz: 23 April 2013 - 10:37 PM

0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1251

View PostMark., on 23 April 2013 - 07:59 PM, said:

Yet another in a long line of questions.

onevent EVENT_GETLOADTILE
setvar RETURN 7119
endevent

onevent EVENT_GETMENUTILE
setvar RETURN 7119
endevent

I replaced the load and menu screens with my own but I can't figure out the name for the DREALMS tile 2492 so I can replace it. I tried a few variations of the word DREALMS between "GET" and "TILE" but no luck.

There is no such a thing as a event that control the 3DRealms screen. You need to replace the tile.
0

User is offline   Mblackwell 

  • Evil Overlord

#1252

View PostDiaz, on 23 April 2013 - 10:28 PM, said:

That does what I want, however it has side effects:

- As you have mentioned, ifp pjumping code is destroyed, though I think I can safely replace all instances of "ifp pjumping" with a check for the player's z velocity.
- The player can now bunnyhop like crazy if keeping the jump key depressed (no idea how to fix this).
- Jumping to get out of water messes up.

So, not worth it :)



gamevar P_JUMP 0 1

onevent EVENT_JUMP
    ifvare P_JUMP 0
        setplayer[THISACTOR].poszv -2048
    setvar RETURN -1
    setvar P_JUMP 3
enda

actor APLAYER
    ifvarg P_JUMP 0
        subvar P_JUMP 1
    ifvarn P_JUMP 0
        action PJUMPING
enda


For example.

If necessary you can add a condition for when you're in water.
0

User is offline   pmw 

#1253

I need to make my monsters non-sinkable. When there are water where player can dive, monsters will also sink there.. I tried to find something related to that from con-codes, but with zero results. Any advice?
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1254

It depends on what you are aiming to. Do you want them to walk above the water, or not enter water sectors (like some monsters)?
0

User is offline   pmw 

#1255

Just walk above the water. Just not going underwater.
0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#1256

Hmm, that's a trick one. Try this:

include this line somewhere before your actor code...
gamevar TEMP 0 2


Where you see the command "fall" in your actor, replace with:
  ifvare sector[THISACTOR].lotag 1
  {
    iffloordistl 8
      setactor[THISACTOR].zvel 0
    getsector[THISACTOR].lotag TEMP
    setsector[THISACTOR].lotag 0
    fall
    setsector[THISACTOR].lotag TEMP
  }
  else
    fall

0

User is online   Danukem 

  • Duke Plus Developer

#1257

^That's an interesting idea for a solution, but it would be much simpler (and probably more reliable) to simply use "ifonwater spriteflags 16" which should prevent the sprite from teleporting into the underwater sector.
1

User is offline   zazo 

#1258

A common problem when converting images to the Duke3D palette in editart is the existance of fullbright colors in the image, indexed as colors 240-254 in the palette.
Is a way to spot them and correct them ?
0

User is offline   Hendricks266 

  • Weaponized Autism

  #1259

When converting stuff, I usually use an edit of the palette that has all the fullbrights blacked out.
0

User is offline   zazo 

#1260

View PostHendricks266, on 27 April 2013 - 10:08 AM, said:

When converting stuff, I usually use an edit of the palette that has all the fullbrights blacked out.

interesting, a link to download this palette ?
0

Share this topic:


  • 93 Pages +
  • « First
  • 40
  • 41
  • 42
  • 43
  • 44
  • Last »
  • 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