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

Jump to content

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

EDuke32 Scripting  "CON coding help"

User is online   Danukem 

  • Duke Plus Developer

#3691

Okay, that makes sense -- but let's be accurate you are not "rewriting" code you are porting it.
1

User is offline   VGames 

#3692

Which event controls what you see on the 3drealms screen that shows up after the radlogo video? Id' like to add some effects to the 3drealms screen but can't find which event to mess with.
0

User is online   Danukem 

  • Duke Plus Developer

#3693

View PostVGames, on 22 December 2024 - 01:19 PM, said:

Which event controls what you see on the 3drealms screen that shows up after the radlogo video? Id' like to add some effects to the 3drealms screen but can't find which event to mess with.


https://wiki.eduke32...wiki/EVENT_LOGO ??

i literally just navigated to the event list on the wiki and control-F searched for "logo"

took me longer to type this reply than to find it

i'm giving you a hint here on how you could make your job easier
0

User is offline   VGames 

#3694

That doesn’t affect the 3drealms screen smart guy.
-1

User is online   Danukem 

  • Duke Plus Developer

#3695

View PostVGames, on 22 December 2024 - 05:59 PM, said:

That doesn’t affect the 3drealms screen smart guy.


It was a good guess though.

I'm never helping you guys again.
0

User is offline   eniojr 

#3696

Quote

Okay, that makes sense -- but let's be accurate you are not "rewriting" code you are porting it.


Even if there are some adjustments and modifications to run in other mod?
0

User is online   Danukem 

  • Duke Plus Developer

#3697

View Posteniojr, on 22 December 2024 - 07:05 PM, said:

Even if there are some adjustments and modifications to run in other mod?


It's pretty obvious that I've been relatively uninterested and annoyed for a while if you look at my posts and this is a good excuse to make a clean break from posting code help which will be a good thing. I'll still help friends in DMs or on projects we work on together obviously.
0

User is offline   VGames 

#3698

Ok then. Thanks for the help.
0

User is offline   eniojr 

#3699

Ok, the principle behind the portal effect is that the sectoreffector sprite, designated as having number 88 for the effect, acts as a camera, like those original security cameras in the game, while the wall, having a tile without texture, behaves as a kind of screen that shows what the camera in another sector is showing or pointing according to its viewing angle and the same goes for what is on the other side. What I'm trying to understand here is how to do, step by step, this effect.

To start, we would have to define a lotag for the effect, which is already defined in this case, ifvare lotag 88 inside a SECTOREFFECTOR case. After that, I would have to define the logic of how a camera and a monitor behave, but I have no idea how to do that, especially to apply it to a sectoreffector and a wall with a tile without texture (which would be a transparent texture) acting as a screen.

I found this on Eduke32's website:

onevent EVENT_DISPLAYROOMS
ifvarn camerasprite -1
{
getactor[camerasprite].x camerax
getactor[camerasprite].y cameray
getactor[camerasprite].z cameraz
getactor[camerasprite].ang cameraang
getactor[camerasprite].extra camerahoriz
getactor[camerasprite].sectnum camerasect
}
endevent


but I don't know if it would be appropriate or how to apply this to such an effect.

What I intend to do doesn't even involve an activation or detection system, because in this case we're going to do it in a simpler way... the portal effect will always be active, regardless of whether the player is close or not and whether or not he sees the portal. This eliminates complex activation and detection codes. The idea is to start from the basics and a code system that would be much simpler, just to make the rendering work. The conditions to activate or deactivate portals in this case would only be added if the basic effect worked first.

I don't know if all of this would be possible to work only inside the SECTOREFFECTOR case or if there is a need to link what would be in such a block to a separate actor or state.

From everything I've observed so far, there are two main blocks that define the effect: One inside the SECTOREFFECTOR eventloader, which can be inside "ifvarg lotag 87 ifvarl lotag 90" and another that is inside the SECTOREFFECTOR case, associated with "ifvare lotag 88". The other related codes are scattered inside "state kludges" and there is a line with "state kludges" inside the APLAYER actor, to load the kludges, which is where the other part of the effect is.

I'm not sure what these codes in "state kludges" are for, but they seem to be related to activating and deactivating the portal effect, I think. Aside from the specific gamevars, I don't know if there is any other rendering-related code for this effect.

The SECTOREFFECTOR case part:

ifvare lotag 88 // portal SE
{
	ifvare peractor1 0
	{
		checkactivatormotion activator
		ifvare RETURN YES setvar peractor1 1
	}
	else
	{
		ifpdistl 16384
		{
			ifcansee
			{
				ifvarn portalcam -1 ifvarvarn portalcam THISACTOR
				{
					findplayer xydist
					dist xydist2 portalcam player[THISACTOR].i
					ifvarvarl xydist xydist2
					{
						setvarvar portalcam myspawner
						setvar portalview 52
					}
				} 
				else
				{
					setvarvar portalcam myspawner
					setvar portalview 52
				}
			}
			else ifpdistl 4096
			{
				setvarvar portalcam myspawner
				setvar portalview 52
			}
		}
	}
}
break
}


ifvare lotag 88: Sets the effect's lotag.

ifvare peractor1 0 { checkactivatormotion activator ifvare RETURN YES setvar peractor1 1 }: It seems to establish a mechanism for activating the effect according to the player's movement.

The rest of the code seems to be related to the player's interaction with the portal according to the distance (ifpdistl 16384 and 4096) at which it is located.

THISACTOR has a direct relationship with the player. But I didn't understand what "[THISACTOR].i" would be.

setvarvar portalcam myspawner: I didn't quite understand the myspawner part.

setvar portalview 52: I didn't understand why to put 52. Why not 1?

I also don't know if this ifvare lotag 88 has any specific switch.


About the SECTOREFFECTOR eventloader:

getactor[THISACTOR].extra monstflags
ifvare monstflags -1 setvar monstflags 0
getactor[THISACTOR].lotag lotag
getactor[THISACTOR].hitag hitag
getactor[THISACTOR].xvel initx


This part is the beginning of the event. It seems to be a general guideline for the new sectoreffector effects.

Now we have this part:

	ifvarg lotag 87 ifvarl lotag 90 // portal cam; find other cam
	{
		getactor[THISACTOR].extra countvar
		setvar spriteid 0
		whilevarn spriteid 16384
		{
			ifvarn sprite[spriteid].statnum 1024
			ifvare sprite[spriteid].picnum SECTOREFFECTOR
			ifvarvare sprite[spriteid].lotag lotag
			ifvarvare sprite[spriteid].hitag hitag
			ifvarvarn spriteid THISACTOR
			{
				setvarvar myspawner spriteid
				setvar spriteid 16383
			}
			addvar spriteid 1
		}
		ifvare myspawner -1 { cactor SMALLSMOKE cstat 32768 seta[].statnum 1 }
		ifvare activator 0 setvar peractor1 1
	}


ifvarg lotag 87 ifvarl lotag 90: For lotag effects between 87 and 90.

getactor[THISACTOR].extra countvar: It seems related to setting an extra value that specifies the Z angle value for the camera (in this case the sectoreffector sprite).

setvar spriteid 0 and whilevarn spriteid 16384: I don't understand, but whilevarn seems to be related to some looping.

ifvarn sprite[spriteid].statnum 1024, ifvare sprite[spriteid].picnum SECTOREFFECTOR, ifvarvare sprite[spriteid].lotag lotag, ifvarvare sprite[spriteid].hitag hitag, ifvarvarn spriteid THISACTOR: This seems to be related to applying lotag and hitag to the effect. But I don't quite understand the THISACTOR part in this context.

setvarvar myspawner spriteid and setvar spriteid 16383: I don't understand the context of this. This myspawner is still a mystery to me.

addvar spriteid 1: It seems to be related to the addition of a variant, but I don't quite understand this spriteid 1 thing.

ifvare myspawner -1 { cactor SMALLSMOKE cstat 32768 seta[].statnum 1 }: I don't understand this part, and it seems to evoke a smoke effect or sprite. It must be that effect where the screen turns a blueish color when the player is teleported in the mod.

ifvare activator 0 setvar peractor1 1: This would be related to a portal or teleportation activation effect, I think.


About the other codes in the state kludges (PLAYERPLUS.CON):

ifvare rendmode 4 
	{ 
		setvar pal 26
		setvar tempd 2 // 514
		setvar intensity 4096 
		state spawnpointlight 
	}
	//setvarvar raining rainstart
	setvar portalview 0
	setvar portalcam -1
	//setvar perplayeronbike -1
	//setvar triphack -1
	//setvar rainstart 0
	setvar temp 99
	whilevarn temp -1
	{
		setarray ptrails[temp] -1
		subvar temp 1
	}

ifvarg portalview 0
{
	subvar portalview 1
	ifvare portalview 0 setvar portalcam -1
}


I'm pretty sure these are the codes related to the player's interaction with the portal effect, maybe related to its activation and deactivation according to the proximity and viewing angle of the player towards the portal (that's what I think). Although I don't know exactly where these codes would be...

Although I think they are: setvar portalview 0, setvar portalcam -1, ifvarg portalview 0, subvar portalview 1 and ifvare portalview 0 setvar portalcam -1.

And finally we have the line state kludges inside actor APLAYER MAXPLAYERHEALTH PSTAND 0 0, which carries that state.

That was exactly all I understood about the codes I found related to this specific effect!


Here's what's in Dukeplus map effects list:

BROADCASTER = SE 88

SHOWS A SCENE FROM A DIFFERENT PART OF THE MAP. THE SCENE IS “BROADCAST” IN THE BACKGROUND, AND IS VISIBLE WHEREVER THERE ARE BLANK TEXTURES (WALLS, FLOORS OR CEILINGS WITH BLANK TEXTURES) NEAR THE SE. PLACE TWO SE88 AND GIVE THEM THE SAME HITAG. ONE WILL BROADCAST THE POV OF THE OTHER.

OPTIONS: GIVE THE SE A YVEL, AND THAT WILL BE ITS ACTIVATION NUMBER, IN WHICH CASE IT WILL NOT BROADCAST UNTIL AN ACTIVATOR OR GAME EFFECT (SUCH AS MONSTER ACTIVATION) TURNS IT ON. MAKE SURE TO HIDE THE BLANK TEXTURES UNTIL THE ACTIVATION USING A SLIDING DOOR OR SOME OTHER TRICK.

THE SE WILL BROADCAST FROM ITS OWN ANGLE. BY DEFAULT, IT WILL USE THE PLAYER’S CURRENT Z ANGLE (LOOK UP/DOWN ANGLE). TO SET A FIXED Z ANGLE, SET EXTRA ON THE SE. 100 = STRAIGHT AHEAD. HIGHER VALUES LOOK UP, LOWER VALUES LOOK DOWN (IN POLYMOST, MAX 299, MIN -199).

This post has been edited by eniojr: 22 December 2024 - 08:57 PM

0

User is offline   eniojr 

#3700

Yes!!! I finally managed to port that portal effect into Legacy!!! The codes were already there, I only had to remake the SECTOREFFECTOR case in onevent EVENT_GAME. I even marked the time i was able to make it work... 01:44 AM, 1st January. This will be a remarkable day for me. Not just that, but also the custom teleport effect.

In the meantime, I worked on codes related to several sprites with effects, such as a torch sprite that emits the sound of fire and that, when destroyed, creates an animated fire sprite that causes damage. Just like I replicated that Shadow Warrior figure that, when you hit it with just a kick, you gain life. I also replicated that effect where you gain life when you drink water for a new texture.

I also replicated two things from Rise of the Triad: I created a new animated sprite based on the one that throws fire from the ground, but in a way that it does so at regular intervals and you only take damage when the fire is thrown, like in ROTT, and it also emits the sound from that game, not the one from Devastator. There is also a visual effect where the screen turns yellow when you get burned.

The other thing is that low health sound from ROTT, with a pulsating visual effect and a heartbeat sound, emphasizing the need to restore health when it falls below 25 HP. In other words, I'm already starting to create visual and sound effects on my own. This gives more life to the game and emphasis to certain important contexts.

I also added new sprites of lightning or electric current and plasma, including one of a destroyed nuclear reactor, in which when you get close to them you not only take damage but there's a shock sound (taken from Lameduke) and a visual effect of color and movement (as if the player were being electrocuted).

I also added more music for that player in the game that's on the ceiling (the one in the supermarket level), which I took from Redneck Rampage and for each palette color I established a different sound emitted. In other words, different music for the same sprite, established according to the palette color. I intend to add more.

This was easier to do than establishing lotag and hitag values.

I also created new textures that act like real explosives, others that can only be destroyed if hit by an explosion, and one that even animates for a while when you hit it (which has the animated texture of the trash can from Shadow Warrior). For those who are just starting out in coding, this seems like an important step.

I also made my first enemy, so to speak. It's not a mobile actor yet, but an animated sprite that stays stuck to the wall or the ground and that, when you get close to it, takes damage and makes an idle and attack noise, despite being unkillable. It's actually more of a trap, but it can also be interpreted as an alien enemy if you want.

The idea is to make the organic walls of the aliens more dangerous...

I have several ideas for adding traps to the game, like those from Shadow Warrior and more from Rise of the Triad. The idea is to add a gameplay element in which not only the enemies are challenging, but the environment itself and various traps along the way, like in some other games. For example, you have to go through certain traps. Some of these traps could be interpreted as a creative way for aliens or rigelats to hinder Duke Nukem's progress.

To tell the truth, I did add a new enemy, similar to the shark in the game, but that I got from a certain mod, and it looks like Dopefish. I intend to add this actor to the game as an easter egg in some specific level that I'm going to make, maybe in some aquatic level.

In addition to this, there is another very simple actor that randomly moves around the map, which is a tornado that emits its own sound and causes melee damage. I'm going to see if I can improve this actor a little more. I'm going to see if I can replicate the tornado attack effect from Redneck Rampage, in which the player, when touching the tornado, is thrown far away.

There's only one thing I've done so far that hasn't worked out very well, regarding making changes to that weapon, the KNEE, but it still seems too early for me to start trying to modify the game's weapons, much less create new ones, or even alt fires.

Since I've managed to do so many things so far, I'm in a good mood.

One last thing... I also learned how to do that true room over room effect, including how you can see what's underwater and interact with what's there. This will be very useful to me.

I added all of this to the Legacy mod, as I plan to make a big custom episode with new extra content, in addition to the ones added to the mod by Marcolino. I intend to contribute to the Legacy mod in some way, even if it's on my own and with codes that, from a functional point of view... "It just works", lol. This could give the author some ideas...

And so I'm learning more and more to interpret codes and their contexts.

I wish everyone in this community a happy new year!

This post has been edited by eniojr: 31 December 2024 - 10:16 PM

0

User is online   Danukem 

  • Duke Plus Developer

#3701

Have you been in contact with Marcolino about this?
0

User is offline   eniojr 

#3702

Yes, he knows it, I already talked to him in Moddb as I remember and he also liked a coment I did in Youtube about the new Legacy release and about my litttle project, and he seemed to like it. He and I are from Brazil, so I talked to him in portuguese once. The whole idea is not to compete with him, but to, somehow, improve things on my own, inside my custom episode for Legacy I'm making, as a type of add-on. Since his mod allows the creation of custom episodes with custom sounds and music and he will make Legacy more add-on friendly in the future, well, developing an add-on of my own don't seem to be a problem after all.

See all this as an experiment I'm making, as the way I'm learning more about modding and the CON language.

If one day I make a true independent mod of my own, It'll have a different context, not beta oriented like Legacy. And certainly it will based not on Legacy, but maybe based on Dukeplus or maybe even Alien Armageddon, don't know (because Legacy seems to not have polymer/polymost support).

Maybe ROTT in Build? I saw some people in youtube posting videos showing this concept, but I don't know if their projects are dead or not.

ROTT in Doom (Return of the Triad) was already cool, but ROTT in build engine? That would a revolution!

Or maybe if I make ROTT mod for Ion Fury, because it would be even better, since Ion Fury has more advanced features.

When I finish adding extra content for the maps I'm going to make, I'm thinking about showing a video here to show everything I managed to add to Legacy, whether from other mods, games or made on my own.

For now, I'll show you some screenshots of what I'm adding and testing in my test map:

Posted Image
The portal effect, with the custom teleporter effect, both functional. Also ported that sleeping effect where you teleport between two separate sectors.

Posted Image
The true room over room where you can see what's underwater.

Posted Image
The functional ladder and jumpad systems.

Posted Image
Partially broken glasses effect. Near those glases is a sector with a slippery floor effect.

Posted Image
New interactable objects. The chain is just a breakable object that changes texture according to your position.

Posted Image
The traps.

Posted Image
The destroyed nuclear reactor, where you take much damage if you go near it.

Posted Image
The corridor with extra keycard colors and more sounds to doors and switches, as well as more switches textures.

Posted Image
The extra stationary civilians. Most of them here are still not coded yet.

Posted Image
The extra walkable civilians. None of them are coded yet.

Posted Image
The tornado and dopefish enemies. Simple, but functional.

Posted Image
The wall alien trap/enemy.

Posted Image
Another trap. Not coded yet. I want to make it like Indiana Jone's effect, seeking the player by activating a touchplate. If the player touches the ball, he dies. The ball must follow the player until it ends up stuck in a hole.

Posted Image
With the coded football and beachball, now I can play ball in Duke Nukem (ported from Alien Armageddon).

Posted Image
The animals I still intend to bring to life through codes. None of them have been coded yet. I'll try to get the codes directly from Redneck Rampage.

Posted Image
The new items I've added so far, some not yet coded.

Posted Image
Several of the new breakable objects I added from other games and mods.

And a few more things that aren't in the pictures.

That's it. A custom episode for Legacy with new content from outside. I'm not sure if I'll get to use everything I added to my project (for example, a lot of textures), but a lot will be useful.

This post has been edited by eniojr: 01 January 2025 - 03:03 PM

0

Share this topic:


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