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

Jump to content

  • 114 Pages +
  • « First
  • 110
  • 111
  • 112
  • 113
  • 114
  • You cannot start a new topic
  • You cannot reply to this topic

EDuke32 Scripting  "CON coding help"

User is offline   Danukem 

  • Duke Plus Developer

#3331

View PostMC84, on 16 June 2023 - 12:16 AM, said:

I checked those, and the thing is that when I say it was 'playing the same sound' the sound would actually change between quitting and reloading the map... it's just that it would play the same sound each 'session'.

Anyway I had my sounds defined as 0 0 0 3 0 ... I think I was doing that for ambient sounds? And then I changed it to 0 0 254 0 0 and now it actually cycles randomly through the 3 sounds. Thanks again!


From the original USER.CON file comments:

// BIT 0 (1) Repeat
// BIT 1 (2) MUSICANDSFX (used for)
// BIT 2 (4) A Duke Voice
// BIT 3 (8) Par. Lockout
// BIT 4 (16) Glob. Heard (sndist = 0)


So you had the sounds set on repeat and MUSICANDSFX. Repeat may have been the issue there.
1

User is offline   VGames 

#3332

Ok so I got this little bit of code in EVENT_GAME that makes certain floor textures create particle effects.

switch sector[].floorpicnum
{
	case FLOORSLIME
		ifrnd 1
		ifcanseetarget
			spawn POISONSMOKE
	break
	case FLOORPLASMA
		ifrnd 1
		ifcanseetarget
		{
			spawn BURNINGSMOKE

			ifrnd 1
			{
				randvar zdist -9984  add zdist 1024   randvar angvar 2048  ezshoot zdist EXPLOSIONSTREAM  seta [RETURN].ang angvar
			}
		}
	break
	case PURPLELAVA
		ifrnd 1
		ifcanseetarget
			spawn BURNINGSMOKE
	break
}
endswitch


It works great but when I try to apply this same concept to wall textures it doesn't do anything. What am I doing wrong or is this not possible with wall textures?

switch wall[].picnum
{
	case W_SCREENBREAK
	case 358
	case 359
	case W_HITTECHWALL3
	case W_HITTECHWALL4
	case W_HITTECHWALL2
	case W_HITTECHWALL1
		ifrnd 1
               ifcanseetarget
			spawn BURNINGSMOKE
	break
}
endswitch

0

User is offline   Danukem 

  • Duke Plus Developer

#3333

EVENT_GAME processes sprites. The reason the sector switch works is that each sprite does have an assigned sector, i.e. it is in a sector. That's not true for walls. It's not the case that each sprite has an assigned wall. Pretty obvious if you think about it.

I'm a little surprised that the wall switch doesn't throw an error or at least a warning.

EDIT: Since the code doesn't throw an error, I'm assuming there is *some* wall being referred to, but it could be wall 0 every time or some random wall.

This post has been edited by Danukem: 27 June 2023 - 01:40 PM

0

User is offline   Danukem 

  • Duke Plus Developer

#3334

https://wiki.eduke32...VENT_DAMAGEWALL
0

User is offline   VGames 

#3335

Ok so this wouldn’t be possible for walls then. I wanted them to produce effects without being damaged first. Oh well thanks for the help.
0

#3336

Make a sprite to put in sectors with wall(s) you want spawning the particles and check the picnum when it cycles through the sector's walls?
0

User is offline   Mark 

#3337

I want to lower the player view a little bit more than default when on water. How would I do this? Any chance it will interfere with the smooth transition from above and below TROR water or when coming back out of the water on to land? Or would this be changing only camera height and not the actual z of the player?

This post has been edited by Mark: 30 June 2023 - 06:23 AM

0

User is offline   Danukem 

  • Duke Plus Developer

#3338

View PostMark, on 30 June 2023 - 06:21 AM, said:

I want to lower the player view a little bit more than default when on water. How would I do this? Any chance it will interfere with the smooth transition from above and below TROR water or when coming back out of the water on to land? Or would this be changing only camera height and not the actual z of the player?


Just a quick and dirty attempt without testing:

appendevent EVENT_DISPLAYROOMS

ifp ponground ife sector[player[].cursectnum].lotag 1 add cameraz 1024

endevent


See if that works.
1

User is offline   Danukem 

  • Duke Plus Developer

#3339

View Postlllllllllllllll, on 29 June 2023 - 12:14 PM, said:

Make a sprite to put in sectors with wall(s) you want spawning the particles and check the picnum when it cycles through the sector's walls?


Presumably there is already a sprite in said sector for his EVENT_GAME code, he just doesn't know which wall to reference. And he didn't give any context so I'm not going to waste time guessing solutions to an unstated problem.
0

User is offline   VGames 

#3340

I don't want to do it by manually going into mapster and adding a sprite that checks for the change in the texture being used and then creates the effects itself. I wanted to have the texture automatically do it by code like I did with the floor and ceiling textures. But it's ok I'm going about this another way.
0

User is offline   Mark 

#3341

View PostDanukem, on 30 June 2023 - 11:07 AM, said:

Just a quick and dirty attempt without testing:

appendevent EVENT_DISPLAYROOMS

ifp ponground ife sector[player[].cursectnum].lotag 1 add cameraz 1024

endevent


See if that works.

I'm half way there using your suggestion. When I enter the water from land I drop down to the lower height I wanted. 1024 was just right. but when I come back up from underwater I'm back to default onwater height. I'm going to doublecheck my SE placement above water to make sure it isn't raised when it shouldn't be.

edit: the above water SE is where it should be.

This post has been edited by Mark: 30 June 2023 - 03:23 PM

0

User is offline   Danukem 

  • Duke Plus Developer

#3342

View PostMark, on 30 June 2023 - 03:01 PM, said:

I'm half way there using your suggestion. When I enter the water from land I drop down to the lower height I wanted. 1024 was just right. but when I come back up from underwater I'm back to default onwater height. I'm going to doublecheck my SE placement above water to make sure it isn't raised when it shouldn't be.

edit: the above water SE is where it should be.


I guess emerging from the water is screwing with the results of ifp ponground

We will need to put in something home-brewed to replace that and give consistent results
0

User is offline   Danukem 

  • Duke Plus Developer

#3343

@Mark see how this works for you

appendevent EVENT_DISPLAYROOMS

ife sector[player[].cursectnum].lotag 1 
{
	getflorzofslope player[].cursectnum player[].posx player[].posy RETURN
	sub RETURN cameraz
	ifg RETURN 2048 ifl RETURN 6144 add cameraz 1280
	set RETURN 0
}

endevent

0

User is offline   Mark 

#3344

Same behavior as before with the 2nd attempt.

Unrelated but playing around with water stuff reminded me of something I noticed a looong time ago and that was the ability to press jump when on water and the player is then at a slightly higher Z until it resets itself by going underwater again or up on land. I'm thinking it was discussed way back then but I can't recall what became of the discussion.

This post has been edited by Mark: 01 July 2023 - 05:16 AM

0

User is offline   Danukem 

  • Duke Plus Developer

#3345

View PostMark, on 01 July 2023 - 05:10 AM, said:

Same behavior as before with the 2nd attempt.

Unrelated but playing around with water stuff reminded me of something I noticed a looong time ago and that was the ability to press jump when on water and the player is then at a slightly higher Z until it resets itself by going underwater again or up on land. I'm thinking it was discussed way back then but I can't recall what became of the discussion.


I actually don't know what you want then because I tested that code and it seemed fine. Yes it is true that jumping in the water will reset the height -- in fact you can end up lower in the water that way as well. You might have to do a full override of the water floating code to create your own custom code from scratch.
0

User is offline   Mark 

#3346

There is a metric ton of code, some I'm not using seeing as how I am doing this mod in the AWOL project and there is always the chance there is some conflict there. I commented out custom code for player jumping height in case that was conflicting but it made no difference, I wasn't expecting it to but... AFAIK there is no custom code concerning water behavior because I don't think any mapper made use of underwater. I'm using TROR water and I don't know if you tested your code with vanilla water mapping or if it makes a difference at all.

Its been an uphill battle trying to streamline out the code I don't need and have to deal with the modified executable. Months ago I should have just cut all ties with that project and attempt to move my stuff to a clean eduke32 but I would have lost some of the AWOL features I liked. So I've foolishly limped along all this time.

Thanks for your help. I will still use what you gave me because it works somewhat. There are only 2 underwater areas on the map and while it would have upped the cool factor with the desired player Z consistantly, it will be good enough getting it half the time.

This post has been edited by Mark: 01 July 2023 - 02:22 PM

0

User is offline   Danukem 

  • Duke Plus Developer

#3347

What might work better is dump the displayrooms code and add a block of code into the player actor when "ifonwater ifp ponground { code code code }" where the code pushes the player down with a sine function clamped at around +512 to +1560 z units

EDIT: that might clip the player through the floor though depending on how he sits on the water

This post has been edited by Danukem: 01 July 2023 - 03:16 PM

0

User is offline   ck3D 

#3348

View PostMark, on 01 July 2023 - 02:13 PM, said:

There is a metric ton of code, some I'm not using seeing as how I am doing this mod in the AWOL project and there is always the chance there is some conflict there. I commented out custom code for player jumping height in case that was conflicting but it made no difference, I wasn't expecting it to but... AFAIK there is no custom code concerning water behavior because I don't think any mapper made use of underwater. I'm using TROR water and I don't know if you tested your code with vanilla water mapping or if it makes a difference at all.

Its been an uphill battle trying to streamline out the code I don't need and have to deal with the modified executable. Months ago I should have just cut all ties with that project and attempt to move my stuff to a clean eduke32 but I would have lost some of the AWOL features I liked. So I've foolishly limped along all this time.

Thanks for your help. I will still use what you gave me because it works somewhat. There are only 2 underwater areas on the map and while it would have upped the cool factor with the desired player Z consistantly, it will be good enough getting it half the time.


I too would have loved underwater moments in AWOL, but IIRC we were told not to design any since none of the character sprites had any animation tiles for swimming underwater.

This post has been edited by ck3D: 01 July 2023 - 02:55 PM

0

User is offline   Danukem 

  • Duke Plus Developer

#3349

View Postck3D, on 01 July 2023 - 02:53 PM, said:

I too would have loved underwater moments in AWOL, but IIRC we were told not to design any since none of the character sprites had any animation tiles for swimming underwater.


If there is no underwater gameplay in AWOL at all, then there is probably a slew of other issues. Most likely the physics and everything is just vanilla Duke which wouldn't have been to the standards of the mod. I'm guessing it's a case of the coder knowing it would be a lot of work to bring underwater up to standards and so it was decided resources are better spent elsewhere.
0

#3350

Can you force certain tiles to be loaded at map load to avoid 'Load tile' lag from actors using hightiles?
0

User is offline   VGames 

#3351

Is there a command to have a weapon lower itself down past the bottom of the screen without having to use a custom animation? Holster doesn’t seem to work properly unless u press the holster button manually.
0

User is offline   Danukem 

  • Duke Plus Developer

#3352

https://wiki.eduke32...wiki/Weapon_pos
1

User is offline   VGames 

#3353

View PostDanukem, on 17 July 2023 - 11:29 AM, said:



Thanks a lot. That was a big help.
0

User is offline   zazo 

#3354

Hello,

I ask miself how to create a condition that cancels the effect of the "strafe left", "strafe right", "crouch" and "jump" movements of the player ... for the code of the use of a custom vehicle by the player, but not find a solution...
Within the EVENT_STRAFELEFT, EVENT_STRAFERIGHT i guess ??
Thank in advance
0

User is offline   Danukem 

  • Duke Plus Developer

#3355

View Postzazo, on 12 August 2023 - 02:40 AM, said:

Hello,

I ask miself how to create a condition that cancels the effect of the "strafe left", "strafe right", "crouch" and "jump" movements of the player ... for the code of the use of a custom vehicle by the player, but not find a solution...
Within the EVENT_STRAFELEFT, EVENT_STRAFERIGHT i guess ??
Thank in advance


For strafing you can cancel the corresponding movement bits:


https://wiki.eduke32...i/Movement_lock

For jumping and crouching, set RETURN to -1 in the corresponding events.
0

User is offline   VGames 

#3356

Even though this is more of a source related question I didn’t know where to post it so I figured this thread would work. How hard would it be to get sprites being used as decals on walls, floors, or ceiling surfaces take into account the edge of the surface they are on and have the decal bend along with the angle of the surface like decals do in the GZDoom engine? Just wondering if something like this could ever get added to a future eduke release so that decals don’t stick out when they reach the edge of a wall or something.
0

User is offline   Radar 

  • King of SOVL

#3357

Hard.
0

User is offline   VGames 

#3358

I figured it was difficult since it’s never been implemented. Is it something that would require a full rework of something that everything depends on? I’m just curious. I have no idea how it all works engine wise.
0

User is offline   Aleks 

#3359

View PostVGames, on 13 August 2023 - 07:58 PM, said:

Even though this is more of a source related question I didn’t know where to post it so I figured this thread would work. How hard would it be to get sprites being used as decals on walls, floors, or ceiling surfaces take into account the edge of the surface they are on and have the decal bend along with the angle of the surface like decals do in the GZDoom engine? Just wondering if something like this could ever get added to a future eduke release so that decals don’t stick out when they reach the edge of a wall or something.

You can always just use two sprites for a decal around an angled corner that would seam where the two walls meet. Implementing this from the engine side, leaving aside the difficulties with it, would break a lot of details which rely on "cutting" a sprite with a wall.
0

User is offline   Danukem 

  • Duke Plus Developer

#3360

View PostAleks, on 14 August 2023 - 12:44 PM, said:

You can always just use two sprites for a decal around an angled corner that would seam where the two walls meet. Implementing this from the engine side, leaving aside the difficulties with it, would break a lot of details which rely on "cutting" a sprite with a wall.


I'm pretty sure he was asking because he has big decals spawned by projectiles during gameplay. What you are suggesting sounds like a mapper solution and wouldn't help.

AFAIK there is no data in the engine for determining when a decal is hanging over an edge, let alone any rendering capability for "bending" a flat sprite.

When addressing this issue in my own projects, because of large rocket scorch decals, the best I could come up with was to try and detect nearby edges by testing for wall/sector changes at certain distances in various directions from the decal when it spawns, then reducing its size accordingly or simply deleting it.
0

Share this topic:


  • 114 Pages +
  • « First
  • 110
  • 111
  • 112
  • 113
  • 114
  • 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