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

Jump to content

  • 124 Pages +
  • « First
  • 123
  • 124
  • You cannot start a new topic
  • You cannot reply to this topic

EDuke32 Scripting  "CON coding help"

#3708

Looking to avoid spawning shotspark1 when enemies are being hit. To keep it simple I was going to kill it whenever a wall or sector is not hit by the hitscan spawning the shotspark. I don't know how you could get the path of the hitscan after it's been randomized.

htg_t looked like what I wanted but there's no projectile here or I'm using it wrong [pistol shotgun chaingun]... or now I'm more confused because Enforcers and Battlelords shoot SHOTSPARK1 as a projectile but shotgun spawns it.
0

User is offline   Danukem 

  • Duke Plus Developer

#3709

Why avoid spawning it? If you don't want to see it, just make it invisible.
0

#3710

I can't determine what's being hit to decide when it shouldn't be seen
Or checking htpicnums from inside each alien's actor code the issue then becomes finding the shotspark being spawned. Like trying to use a global to hide the next one to spawn probably won't work with a shotgun firing 8 pellets at once.
0

User is offline   Danukem 

  • Duke Plus Developer

#3711

You could check what it's hitting when it spawns in EVENT_EGS and make it invisible if the picnum of what its hitting is on a list, or some other condition (like if the thing is statnum 1 + has >0 extra)
0

User is offline   Danukem 

  • Duke Plus Developer

#3712

It's not the only way to do it, but the htg_t members 6 to 8 in the SHOTSPARK1 sprite contain the information you need:

https://wiki.eduke32.com/wiki/Htg_t
0

#3713

Yeah
Was getting 0's trying to check it before and must have been too early. 8 + list is perfect.

Shotspark1 being both the hitscan and the visual you see after the bullet hits made this seem more complicated than it was. It looked like it had double projectile_spawns, one spawning the other, or hardcode bs. Shotspark1 remaining until it's killed is hardcode too right?
1

User is offline   Danukem 

  • Duke Plus Developer

#3714

You can delete the SHOTSPARK1 actor after it spawns at any time just like any other actor. Notice I said AFTER -- so don't try deleting it DURING in EVENT_EGS.
0

User is offline   VGames 

  • Extra Crispy

#3715

Does it help to have lots of events and states separated into multiple files or is it ok to just keep them all in 1 big file? Just wondering if making separate files for different code mentioned above would maybe help eDuke process all that easier.
0

User is offline   Danukem 

  • Duke Plus Developer

#3716

View PostVGames, on 26 August 2025 - 05:38 AM, said:

Does it help to have lots of events and states separated into multiple files or is it ok to just keep them all in 1 big file? Just wondering if making separate files for different code mentioned above would maybe help eDuke process all that easier.


Having done it various ways for different projects, honestly I think it's better to keep them in a smaller number of files. It makes it quicker to search for stuff. Also, when you first divide them up the organizational scheme may seem clear and intuitive to you, but then edge cases tend to pile up and you can be uncertain which file some new code goes in. Which comes back to looking for stuff -- you may not know which file to look in later.

Forget all of that if there are multiple coders working on the same project though. Not something I've done but obviously that's different.
0

User is offline   VGames 

  • Extra Crispy

#3717

 Danukem, on 26 August 2025 - 12:10 PM, said:

Having done it various ways for different projects, honestly I think it's better to keep them in a smaller number of files. It makes it quicker to search for stuff. Also, when you first divide them up the organizational scheme may seem clear and intuitive to you, but then edge cases tend to pile up and you can be uncertain which file some new code goes in. Which comes back to looking for stuff -- you may not know which file to look in later.

Forget all of that if there are multiple coders working on the same project though. Not something I've done but obviously that's different.


Gotcha thanks for the reply.
0

Share this topic:


  • 124 Pages +
  • « First
  • 123
  • 124
  • 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