Duke4.net Forums: Projectile problem - Duke4.net Forums

Jump to content

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

Projectile problem  "Two missiles in one"

User is offline   Jolteon 

#1

I'm trying to make a new enemy for my next map, but however I'm having a bit of a problem with it. I wanted him to fire two missiles but it looks like he fires both on top of each other. I did looked up on the eduke wiki, and i did found an answer there but I still have problems though.

Here's the code that I have

        sound RPG_SHOOT
        setprojectile[RPG].offset 224
        eshoot RPG
        setprojectile[RPG].offset 14354

        setprojectile[RPG].offset 14578
        eshoot RPG
        setprojectile[RPG].offset 14354


But when actually playing, this happens
Attached Image: duke0080.png

It looks like it doesn't work. I've even set the second one at -224 once too, it still doesn't work.

Also checking the eduke log this is what it says
Line 5884, setprojectile: VM_SetProjectile: no projectile defined for tile 2605
Line 5886, setprojectile: VM_SetProjectile: no projectile defined for tile 2605
Line 5888, setprojectile: VM_SetProjectile: no projectile defined for tile 2605
Line 5890, setprojectile: VM_SetProjectile: no projectile defined for tile 2605


Does this mean that it's incompatible with the original missile, or am I doing something wrong. :dukeaffirmative:

This post has been edited by Jolteon: 19 February 2016 - 12:32 PM

0

User is offline   Danukem 

  • Duke Plus Developer

#2

In general, setprojectile is designed to work on custom projectiles that you have defined yourself. It does not reliably work on hardcoded projectiles such as RPG.
0

User is offline   Jolteon 

#3

It doesn't? Rats. :dukeaffirmative: Well I guess there was no shame in asking. Thank you for clearing that up for me.
0

User is offline   Danukem 

  • Duke Plus Developer

#4

The easiest solution in this case is to move the actor over in between shots, then return the actor to its original position. This will ensure that the RPG fires from a different position, and still aims correctly at the player. I have code for doing just that.
0

User is offline   Jolteon 

#5

View PostTrooper Dan, on 19 February 2016 - 01:03 PM, said:

The easiest solution in this case is to move the actor over in between shots, then return the actor to its original position. This will ensure that the RPG fires from a different position, and still aims correctly at the player. I have code for doing just that.


If it's ok to ask, how do you do that?
0

User is offline   Daedolon 

  • Ancient Blood God

#6

Create an actor pivoting around the firing actor, and have that spawn the things.
0

User is offline   Danukem 

  • Duke Plus Developer

#7


// declare the following vars wherever you do that in your mod:
gamevar x 0 0
gamevar angvar 0 0
gamevar savx 0 0
gamevar savy 0 0
gamevar newx 0 0
gamevar newy 0 0

// in the shooting part of the code, do this:
shoot RPG
geta[].x x
geta[].ang angvar
sub angvar 512
add x 384
rotatepoint sprite[].x sprite[].y x sprite[].y angvar newx newy
geta[].x savx
geta[].y savy
setsprite THISACTOR newx newy sprite[].z
shoot RPG
setsprite THISACTOR savx savy sprite[].z


If the position on the second RPG shot is wrong, change sub angvar to add angvar. You can also play with the distance 384 to make it smaller or larger (that one is the gap between the shots)
3

User is offline   Jolteon 

#8

After messing with the distance a bit, It actually works. Thank you Trooper Dan. :)

Attached Image: duke0081.png

Couldn't get a good screenshot though. :dukeaffirmative:

(Also thank you too Daedolon for trying to help as well.)
3

User is offline   Perro Seco 

#9

I also want to thank Dan for the code. I found it useful to make enemies shoot projectiles from left/right rather than the center:

Attached thumbnail(s)

  • Attached Image: duke0004.png

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