Duke4.net Forums: Clipdist don't work - Duke4.net Forums

Jump to content

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

Clipdist don't work

User is offline   Sanek 

#1

Want to use Clipdist as a PROJ_CLIPDIST, so the moving sprite will have larger clipping sphere (just the size of a largerst grid).

for example:

defineprojectile PROJECTILENAME PROJ_CLIPDIST 200


And it don't have any effect at all.
Maybe it's confilcting with other PROJ commands, or what else connected with a sprite?

Here's the code:

defineprojectile FLOWERPROJECTILE PROJ_WORKSLIKE 36866
defineprojectile FLOWERPROJECTILE PROJ_ISOUND THUD
defineprojectile FLOWERPROJECTILE PROJ_XREPEAT 12
defineprojectile FLOWERPROJECTILE PROJ_YREPEAT 12
defineprojectile FLOWERPROJECTILE PROJ_EXTRA 1
defineprojectile FLOWERPROJECTILE PROJ_HITRADIUS 0
defineprojectile FLOWERPROJECTILE PROJ_SPAWNS -1
defineprojectile FLOWERPROJECTILE PROJ_VEL 300
defineprojectile FLOWERPROJECTILE PROJ_CSTAT 32768
appendevent EVENT_SPAWN
    ife sprite[].pal 4
    {
        ifand sprite[].cstat 1
        {
            geta[].cstat TEMP2
            xor TEMP2 1
            seta[].cstat TEMP2
        }
    }
endevent
appendevent EVENT_WORLD
    for TEMPW spritesofstatus 4
    {
        ife sprite[TEMPW].picnum FLOWERPROJECTILE
        {
            setu[].vm_sprite TEMPW
            add TEMP 1
            ifg TEMP 1
                cstat 128
        }
    }
endevent
action AFLOWER1 0 4 1 1 11
action AFLOWER2 5 3 1 1 30
action AFLOWER3 8 0 0 0 2
move NULLMOVE 0
spriteshadow FLOWER
actor FLOWER sleeptime -1 cstat 0
ifaction 0 action AFLOWER1
ifaction AFLOWER1 ifactioncount 17 action AFLOWER2
ifaction AFLOWER2 { ifactioncount 3 { shoot FLOWERPROJECTILE resetactioncount } ifcount 250 { action AFLOWER3 resetcount } } 
ifaction AFLOWER3 ifactioncount 30 action AFLOWER1

0

User is offline   Danukem 

  • Duke Plus Developer

#2

Dunno. You could try setting the SFLAG_REALCLIPDIST flag on them and manually setting the .clipdist struct to 200 as well. I would do those things in the EVENT_WORLD loop. Here's the htflags for reference: https://wiki.eduke32.com/wiki/Htflags

But I suspect that projectiles won't be able to do what you want.
0

User is offline   Sanek 

#3

The game crashes when I tried it. Is there any other way to increase the sprite's clipping sphere?
0

User is offline   Danukem 

  • Duke Plus Developer

#4

If the game crashed it's because you did something wrong, it's not because you set the flag. Speaking of which, it's very questionable in the EVENT_WORLD loop that TEMP is not initialized to anything before the loop starts. And it would be safer for you not to mess with vm_sprite unless you really know what you're doing. You can actually do it with fewer lines of code without changing vm_sprite
0

User is offline   Sanek 

#5

The problem is that I really don't know how to make these event_world loops. I tried to copy the events that was made before, but it crashes or don't have any effect.
0

User is offline   Hendricks266 

  • Weaponized Autism

  #6

Don't you need to add the blocking bit to the projectile's cstat?
0

User is offline   Sanek 

#7

Do you mean flag value 1? It don't have effect
0

User is offline   Danukem 

  • Duke Plus Developer

#8

It's all very mysterious. Like why he wants it to start invisible and then change the cstat later. And what exactly the goal is. In my experience, people make false assumptions before asking for help, so the thing they are asking for isn't the thing they should be asking.
0

User is offline   Sanek 

#9

Why? I want to make changes in the projectile's behavior, I posted the code that have something to do with it and asking for help.

And I didn't write that code actually.
0

User is offline   Danukem 

  • Duke Plus Developer

#10

But you never said why you want the projectile to have a giant clipdist. If we understood the ultimate purpose, we would be more likely to offer useful advice. I have no idea whether setting clipdist on the projectile would serve your purpose.
0

User is offline   Sanek 

#11

View PostTrooper Dan, on 18 February 2019 - 03:40 PM, said:

But you never said why you want the projectile to have a giant clipdist. If we understood the ultimate purpose, we would be more likely to offer useful advice. I have no idea whether setting clipdist on the projectile would serve your purpose.


The exact purpose is to have a clipdist that would fill the 1 largest grid square in Build.
0

User is offline   Danukem 

  • Duke Plus Developer

#12

View PostSanek, on 18 February 2019 - 10:01 PM, said:

The exact purpose is to have a clipdist that would fill the 1 largest grid square in Build.


That doesn't really answer the question. Why does it need to be a projectile in the first place? If you want something to block off 1024 square build units, you can use a regular actor.
0

User is offline   Sanek 

#13

View PostTrooper Dan, on 18 February 2019 - 10:04 PM, said:

Why does it need to be a projectile in the first place? If you want something to block off 1024 square build units, you can use a regular actor.

Because it's actor that shoots projectiles?
-1

User is offline   Danukem 

  • Duke Plus Developer

#14

View PostSanek, on 18 February 2019 - 10:10 PM, said:

Because it's actor that shoots projectiles?


Lots of actors fire projectiles. But normally, you don't need a projectile to have a clipping area the size of a large dumpster. Do you want the projectile to push things away from it as it moves? Do you want it to block incoming shots with its clipping area? What exactly is this projectile and how is it supposed to function in your game? These are the obvious kind of questions that would need to be answered, but since you want to be a dick about it, you can count on never getting any help from me again.
0

User is offline   Sanek 

#15

I'm sorry if I aggravate you or something. I don't want to " to be a dick about it". I just don't understand how all it works and I asnwer what I thought would be reasonable atm. I don't want to appear like that, really.

View PostTrooper Dan, on 18 February 2019 - 10:41 PM, said:

What exactly is this projectile and how is it supposed to function in your game?

It's a sprite that comes from the actor, which moves in one direction and is supposed to kill the player by touching him/going through. All I want is to make it's clipping sphere bigger, because right now it's way too small.
0

User is offline   Forge 

  • Speaker of the Outhouse

#16

Dude wants to run people over with a car in-game, Dan.
Everyone knows you're always busy, just take deep breaths and count to ten.
0

User is offline   Danukem 

  • Duke Plus Developer

#17

@Sanek Yes, you are very aggravating. You should have just said what you were trying to do in the first place.

Just as I suspected, you don't actually need to rely on clipdist. You could add some code to the projectile via EVENT_GAME or some other suitable event which checks for sprites within the radius you want (maybe visibility too) and damages them or whatever it is you want to do to them when the conditions are met. You could kill the projectile if hit "hits" something, or have it keep going, whatever you want.

Also, it's weird that you didn't even try making it blocking as Hendricks suggested. The obvious way to proceed would be to give the projectile both the clipdist and the cstat that you want in the definition.

EDIT@Forge: If that's the case, then making it a projectile is not a good idea. It should be an actor. On an actor you can set clipdist just fine and then have it check htmovflag to see if it bumps something, grab the sprite off that struct and fuck them up. I'll go take deep breaths away from here.

This post has been edited by Trooper Dan: 18 February 2019 - 11:20 PM

0

User is offline   Sanek 

#18

It crashes whenever I make new event_game. Obviously I'm doing something wrong.

I guess it'll be easier jus to have 3 projectiles moving at once, so it'll fill one 1024 build grid. It's not a big issue.
I'm sorry for making this thread. :)
0

User is offline   Mark 

#19

Just a tip in case you didn't know, do not put an event inside the actor code or states.

This post has been edited by Mark: 19 February 2019 - 08:56 AM

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