
EDuke32 Scripting "CON coding help"
#2574 Posted 29 August 2020 - 05:12 PM
Find where there are "defineprojectile" for the projectiles in question. There should be a block of lines for each one of the projectiles. You want to add/replace with "defineprojectile PROJECTILENAME PROJ_FLASH_COLOR 0"
It might not work.
#2575 Posted 29 August 2020 - 07:28 PM
// Shotgun
gamevar WEAPON2_WORKSLIKE 2 2
gamevar WEAPON2_CLIP 0 2
gamevar WEAPON2_RELOAD 13 2
gamevar WEAPON2_FIREDELAY 4 2
etc...
I guess I'll search around in other projects to see if I can find a chunk of defineprojectile code to learn from. But if its a whole lot of effort to make a projectile from scratch, I'll just live with the flash. Actually, I wouldn't mind keeping the flash but reduce it's size by at least 50-60 percent.
This post has been edited by Mark: 29 August 2020 - 07:35 PM
#2576 Posted 29 August 2020 - 07:40 PM
You said they were "custom coded" so I assumed that meant they were custom projectiles. If the actors are using the regular hardcoded shots ("shoot SHOTGUN", "shoot CHAINGUN", "shoot SHOTSPARK1") then I don't know if there is any way to disable the lights they spawn in polymer. You could replace them with your own projectiles that don't emit light, though.
#2577 Posted 29 August 2020 - 07:49 PM
This post has been edited by Mark: 29 August 2020 - 07:51 PM
#2578 Posted 29 August 2020 - 08:27 PM
Mark, on 29 August 2020 - 07:49 PM, said:
No, for hitscan they are incredibly simple. Pick an unused tile number (can be a blank one it doesn't matter), define it as hitscan and set damage, decal size and a few other things and you are good to go. No math, no fuss.
#2579 Posted 29 August 2020 - 08:44 PM
This post has been edited by Mark: 29 August 2020 - 08:46 PM
#2580 Posted 30 August 2020 - 06:42 AM
Now I'm wondering if its possible/feasible to define and spawn my own SE light of a much smaller radius than the default flash was.
#2581 Posted 30 August 2020 - 11:04 AM
#2582 Posted 22 September 2020 - 08:16 AM
How would I read (or write) another actor's per-actor gamevar? This seems simple and I'm sure I'm overlooking something obvious.
#2583 Posted 22 September 2020 - 09:00 AM
Reaper_Man, on 22 September 2020 - 08:16 AM, said:
How would I read (or write) another actor's per-actor gamevar? This seems simple and I'm sure I'm overlooking something obvious.
It is simple, but you have to have the sprite ID number of the other actor in a gamevar first. That's the only part that can be tricky, depending on the context. But let's say you have done that already, by using findnearactor or by searching sprites via a loop or whatever.
Assume that "SPRITE" is a var that is set to the ID of the other sprite, and "VAR1" is a per-actor var. Then, in the code of an actor, you could write:
getactorvar[SPRITE].VAR1 VAR1
The above line would copy the value of VAR1 from the sprite SPRITE to the VAR1 in the current sprite (THISACTOR).
setactorvar[SPRITE].VAR1 VAR1
That would write the current copy of VAR1 in THISACTOR to the copy of that var in SPRITE
You can also abbreviate those commands to getav and setav
#2584 Posted 22 September 2020 - 09:03 AM
This post has been edited by Mark: 22 September 2020 - 09:04 AM
#2585 Posted 22 September 2020 - 05:06 PM
#2586 Posted 29 September 2020 - 06:11 AM
I am using the Player sprites for an actor that can stand and crouch, but when they crouch down, their collision remains the same dimensions as their standing sprite, so I can shoot them where their upper body existed, and when I stand on them there is a giant open space between me and the Actor since I am standing on what used to be their head. Hopefully this terrible image helps demonstrate the problem.

#2587 Posted 29 September 2020 - 10:45 AM
I can't think of another way to do it, honestly.
#2588 Posted 30 September 2020 - 03:56 AM
Still, that makes me wonder what structure member controls this, and why it can't be set programmatically.
#2589 Posted 30 September 2020 - 04:26 PM
Reaper_Man, on 30 September 2020 - 03:56 AM, said:
Still, that makes me wonder what structure member controls this, and why it can't be set programmatically.
https://wiki.eduke32.com/wiki/Htg_t
Current frame offset should be in htg_t 3
I try not to mess with those, though. Redefining the actions only takes a minute.
#2590 Posted 06 October 2020 - 12:22 AM
how do you change the palette of Greenslime's guts after it's been killed? I know that it's hardcoded to be spritepal 6.
#2591 Posted 06 October 2020 - 12:38 AM
appendevent EVENT_SPAWN ifspawnedby GREENSLIME spritepal 0 endevent
That should change everything it spawns to pal 0.
#2592 Posted 06 October 2020 - 04:45 AM
Danukem, on 06 October 2020 - 12:38 AM, said:
appendevent EVENT_SPAWN ifspawnedby GREENSLIME spritepal 0 endevent
That should change everything it spawns to pal 0.
Unfortunately this does not work

#2593 Posted 06 October 2020 - 10:30 AM
#2594 Posted 06 October 2020 - 11:31 PM
#2595 Posted 07 October 2020 - 12:31 AM
December Man, on 06 October 2020 - 11:31 PM, said:
That confirms the reason the EVENT_SPAWN version didn't work is the pal hadn't been set yet. The bad thing about putting that code in EVENT_GAME is that every single sprite in the game will run that line of code 30 times per second, even though it won't do anything unless the sprite is spawned by a slimer. That's very unlikely to cause you any issues but it's not optimal. If you had a big complex project with lots of code it would be worth improving.
#2596 Posted 07 October 2020 - 04:49 AM
This post has been edited by Reaper_Man: 07 October 2020 - 06:35 AM
#2597 Posted 07 October 2020 - 06:49 AM
Reaper_Man, on 07 October 2020 - 04:49 AM, said:
One option would be using EVENT_WORLD, since the code would run-once-per tic instead of once-per-tic-per-sprite. But the code would need to be different since it wouldn't be run by the specific sprite in question.
#2598 Posted 08 October 2020 - 05:03 AM
Danukem, on 07 October 2020 - 12:31 AM, said:
Is EVENT_PREGAME any more efficient in this regard than EVENT_GAME?
#2599 Posted 08 October 2020 - 10:02 AM
Reaper_Man, on 07 October 2020 - 04:49 AM, said:
EVENT_EGS is used internally to initialize newly spawned sprites. It's where the structures are reset, in case the same ID was used for another sprite before.
EVENT_SPAWN is used for both sprites that already existed in the map or newly spawned sprites. Internally it's where it changed the size of enemies, etc.
Projectiles are, however, excluded from EVENT_SPAWN, and you would use EVENT_EGS instead.
#2600 Posted 08 October 2020 - 10:22 AM
December Man, on 08 October 2020 - 05:03 AM, said:
No.
https://wiki.eduke32...i/EVENT_PREGAME
#2601 Posted 09 October 2020 - 06:49 AM
I would like to make a bullet / projectile which has average velocity but its going to drop very soon. The idea is to make a weapon which is very good at close range but with no chance when shooting longer distances. I tried to do it myself but i can't get work on it as i planned
What's wrong with the code or is there something missing?
define SCARBULLET 15 defineprojectile SCARBULLET PROJ_WORKSLIKE 1 defineprojectile SCARBULLET PROJ_SPAWNS SMALLSMOKE defineprojectile SCARBULLET PROJ_DECAL BULLETHOLE defineprojectile SCARBULLET PROJ_EXTRA 20 defineprojectile SCARBULLET PROJ_XREPEAT 6 defineprojectile SCARBULLET PROJ_YREPEAT 6 defineprojectile SCARBULLET PROJ_TNUM 2 defineprojectile SCARBULLET PROJ_VEL 500 defineprojectile SCARBULLET PROJ_DROP -200
Second question: When you choose weapon like chaingun a weapon starts to appear and you are able to use it. How to change that "draw time"?
Idea is to simulate real world where lightweight weapon is easier to draw out and heavier weapon is slower.
Third question: My ironsight code does not have any penalty time when switching it on and off. I would like to have one, is there any command available or should i paste the code above?
#2602 Posted 09 October 2020 - 09:27 AM
#2603 Posted 12 October 2020 - 10:46 AM
Danukem, on 09 October 2020 - 09:27 AM, said:
So should i make an actor for the scarbullet?
Something like this:
TRAILFRAME2 0 1 1 1 15 useractor notenemy BEAMTRAIL 0 TRAILFRAME2 spritepal 2 ifaction TRAILFRAME2 { ifactioncount 3 { killit } else ifactioncount 2 { cstat 32768 } else ifactioncount 1 { cstat 2 } } enda
Then EVENT_GAME i add the value that after certain amount of time the projectile starts to fall? Can it be so simple?
This post has been edited by Salvation: 12 October 2020 - 10:47 AM