Duke4.net Forums: Introducing: The Essential Duke [RELEASE] - Duke4.net Forums

Jump to content

  • 4 Pages +
  • « First
  • 2
  • 3
  • 4
  • You cannot start a new topic
  • You cannot reply to this topic

Introducing: The Essential Duke [RELEASE]  "a bugfix / cosmetic / gameplay mod using only code"

User is offline   Danukem 

  • Duke Plus Developer

#91

View PostNukeDukem89, on 27 March 2024 - 06:14 AM, said:

Link is dead... Do someone has the files?


Here it is on my dropbox: https://www.dropbox..../EDUKE.zip?dl=0
0

#92

View PostDanukem, on 28 March 2024 - 12:56 AM, said:

Here it is on my dropbox: https://www.dropbox..../EDUKE.zip?dl=0

Great! Thanks!
0

User is offline   NightFright 

  • The Truth is in here

#93

As usual: Since eduke.con might also be used in other mods, it'd be better to rather rename the file to something like essential.con and include it in eduke.con instead.
0

User is offline   Danukem 

  • Duke Plus Developer

#94

View PostNightFright, on 28 March 2024 - 02:07 AM, said:

As usual: Since eduke.con might also be used in other mods, it'd be better to rather rename the file to something like essential.con and include it in eduke.con instead.


Well the idea when I made it was we can pretend that the "E" in "EDUKE" stands for "Essential" and it would only be one file.
0

User is offline   NightFright 

  • The Truth is in here

#95

Fair enough. After all, anybody who intends to chain this with another eduke.con can do the necessary changes easily by themselves. It's merely a matter of renaming the file and adding "include <con name>.con" to the file that's actually loaded.
0

User is offline   NightFright 

  • The Truth is in here

#96

I'm interested in the code part which shows access card panels (and cards themselves) on the automap. Is a code extraction possible for usage with other mods (aka con mutator)? I'm trying to comb through your con to check how to proceed, but it's hard to see what's relevant and belongs together.
0

User is offline   Danukem 

  • Duke Plus Developer

#97

View PostNightFright, on 03 April 2024 - 09:40 AM, said:

I'm interested in the code part which shows access card panels (and cards themselves) on the automap. Is a code extraction possible for usage with other mods (aka con mutator)? I'm trying to comb through your con to check how to proceed, but it's hard to see what's relevant and belongs together.


The idea is that you spawn special duplicates of certain sprites, and those duplicates only appear when the overhead map is on, and they have floor aligned cstat so that they appear in the textured overhead map view. This process starts in EVENT_LOADACTOR, in which the duplicates are spawned. Here is that code.

gamevar myspawner -1 2
gamevar x 0 0
gamevar y 0 0
gamevar float 0 2
gamevar angvar 0 0

onevent EVENT_LOADACTOR

switch sprite[].picnum

	case ACCESSSWITCH
	ifn sprite[].lotag 0
	{
		espawn ACCESSSWITCH
		seta[RETURN].pal sprite[].pal
		setav[RETURN].myspawner THISACTOR
		set myspawner RETURN
		setav[RETURN].float 32768
		geta[].xrepeat x mul x 2
		seta[RETURN].xrepeat x
		geta[].yrepeat y mul y 2
		seta[RETURN].yrepeat y
	}
	break
	
	case ACCESSSWITCH2
	ifn sprite[].lotag 0
	{
		espawn ACCESSSWITCH2
		seta[RETURN].pal sprite[].pal
		setav[RETURN].myspawner THISACTOR
		set myspawner RETURN
		setav[RETURN].float 32768
		geta[].xrepeat x mul x 2
		seta[RETURN].xrepeat x
		geta[].yrepeat y mul y 2
		seta[RETURN].yrepeat y
	}
	break
	
	case CRACK1 case CRACK2
	case CRACK3 case CRACK4
	ifn sprite[].hitag 0
	{
		geta[].picnum temp
		espawnvar temp
		// espawn CRACK1
		setav[RETURN].myspawner THISACTOR
		set myspawner RETURN
		setav[RETURN].float 32768
		geta[].xrepeat x mul x 2
		seta[RETURN].xrepeat x
		geta[].yrepeat y mul y 2
		seta[RETURN].yrepeat y
	}
	break
	
	case ACCESSCARD
		ifg sprite[].lotag 4 seta[].lotag 0
		geta[].picnum temp
		espawnvar temp
		setav[RETURN].myspawner THISACTOR
		set myspawner RETURN
		setav[RETURN].float 32768
		geta[].xrepeat x mul x 2
		seta[RETURN].xrepeat x
		geta[].yrepeat y mul y 2
		seta[RETURN].yrepeat y
	break
endswitch

endevent


The next step is to make sure that the ACCESSCARD duplicate actor (the only one of those sprites that is an actor), cannot be picked up. So add this line to the start of that actor:

actor ACCESSCARD

ife float 32768 break


This will cause code execution to stop if it is the duplicate with the special var set on it, so that it can't be picked up. Finally, we need the code that actually changes the cstat of the duplicate sprites to make them visible only when the overhead map with textures is on.

Do to this, in EVENT_GAME, in the switch statement on picnum, it needs to have cases for those duplicate sprites:
case ACCESSSWITCH
case ACCESSSWITCH2
case CRACK1 case CRACK2 case CRACK3 case CRACK4
case ACCESSCARD case REACTOR2
ife float 32768 
{
	ife sprite[myspawner].statnum 1024 killit else
	ifn sprite[myspawner].picnum sprite[].picnum killit else
	ife userdef[].overhead_on 2 
	{
		cstat 32
		geta[myspawner].ang angvar
		add angvar 1024
		seta[].ang angvar
	}
	else cstat 32768
}
break


The killit cases are there of course because the original sprite is gone, we don't want the duplicate to appear any more. I think that's all you need.
1

User is offline   NightFright 

  • The Truth is in here

#98

Thanks to your helpful instructions I've managed to create a standalone version.

Two issues, even though I'm not sure if they can be changed:
1) One would still see the duplicate sprites for the fracture of a second when leaving textured map overlay
2) Automap sprites seem to adjust to the shading of the surrounding area, making them hard to spot in dark map sections. Is there a way to make them appear fullbright at all times (or highlight them in a different way, if a direct approach isn't possible)? Something like force shade 0 or so.
0

User is offline   Danukem 

  • Duke Plus Developer

#99

View PostNightFright, on 04 April 2024 - 07:51 AM, said:

Thanks to your helpful instructions I've managed to create a standalone version.

Two issues, even though I'm not sure if they can be changed:
1) One would still see the duplicate sprites for the fracture of a second when leaving textured map overlay
2) Automap sprites seem to adjust to the shading of the surrounding area, making them hard to spot in dark map sections. Is there a way to make them appear fullbright at all times (or highlight them in a different way, if a direct approach isn't possible)? Something like force shade 0 or so.


Try this: In the code that spawns the duplicate sprites, add the lines seta[RETURN].htflags 4 and seta[RETURN].shade 0

Seeing them for 1/30th of a second when turning off map view doesn't seem like a real problem, but to fix that you would need to set .mdflags 16 on them to make their tsprites process in EVENT_ANIMATESPRITES, and then in that event set their sprites size to 0 0 when not in map view (you can't set tsprite cstat to 32768). That event processes per-frame rendered so it's effectively instant for visual effects
0

User is offline   NightFright 

  • The Truth is in here

#100

Hm, I cannot say that made any difference.
I added the lines inside the brackets after each seta[RETURN].yrepeat, but it looks the same as before. A good place to check is the blue access panel in E2L1. It's in a chamber with changing brightness and the automap sprite is affected by it.

Looking at the cstat documentation in the wiki... how about adding 2048 (CSTAT_SPRITE_NOSHADE) to cstat in the EVENT_GAME part instead?

Side note:
I think floor palette of the sector should also be ignored, so htflags would be 68 (64+4).

*Update*
Neither of the measures from above had any effect.
0

User is offline   Danukem 

  • Duke Plus Developer

#101

View PostNightFright, on 04 April 2024 - 07:51 AM, said:

2) Automap sprites seem to adjust to the shading of the surrounding area


My guess is that the automap sprite rendering is handled separately from regular gameworld rendering and ignores the noshade flag. The idea of making keycards and slot visible on the automap this way was just an easy hack that seemed okay at the time. A more reliable way to do it would be to use screen drawing commands.
0

#102

When noshade doesn't work I set the actor shade to 0 if the sector's floorshade isn't 0 every tick. The shade gets changed by the floor at the beginning of the tick presumably.
0

Share this topic:


  • 4 Pages +
  • « First
  • 2
  • 3
  • 4
  • 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