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

Jump to content

  • 124 Pages +
  • « First
  • 113
  • 114
  • 115
  • 116
  • 117
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

EDuke32 Scripting  "CON coding help"

User is online   Danukem 

  • Duke Plus Developer

#3408

View PostMark, on 30 December 2023 - 06:32 PM, said:

Thanks. I guess I can live with it. Its not a huge thing like the global flash was. Coding weapons from scratch is beyong my skills. It was my hope some event could intercept and cancel the shade change.


I'm assuming you already applied the WEAPON_NOVISIBLE flag to each weapon which is why they don't flash the level. If that's the case then I don't know what you could do besides having your own display code for them.

https://wiki.eduke32...i/WEAPONx_FLAGS

If you really are just using the hardcoded display with your own models, then one easy solution would be to include the weapon.sample.con included with EDuke32, then comment out the lines that set hud_shade to negative values.
0

User is offline   Mark 

#3409

I'll look into that.

I never saw that command when browsing the wiki. I used an old probably outdated method that I used since way back in my Graveyard project. IIRC I spotted it in someone's post and added to my list of con code snippets.

// remove all flash from weapon fire

onevent EVENT_RESETWEAPONS
// pistol
setvarvar gs WEAPON1_FLAGS
setvarvar gs WEAPON2_FLAGS
orvar gs 256
setvarvar WEAPON1_FLAGS gs
setvarvar WEAPON2_FLAGS gs
endevent

This post has been edited by Mark: 30 December 2023 - 07:24 PM

0

User is online   Danukem 

  • Duke Plus Developer

#3410

 Mark, on 30 December 2023 - 07:23 PM, said:

I'll look into that.

I never saw that command when browsing the wiki. I used an old probably outdated method that I used since way back in my Graveyard project. IIRC I spotted it in someone's post and added to my list of con code snippets.

// remove all flash from weapon fire

onevent EVENT_RESETWEAPONS
// pistol
setvarvar gs WEAPON1_FLAGS
setvarvar gs WEAPON2_FLAGS
orvar gs 256
setvarvar WEAPON1_FLAGS gs
setvarvar WEAPON2_FLAGS gs
endevent


^ That code adds the flag that I was talking about. Although the code you posted only adds it to the pistol and shotgun. It's somewhat defective however since it sets the pistol to have all the same flags as the shotgun, which it's not supposed to.
0

User is offline   Mark 

#3411

I looked at the sample.con file and even if I delete sections for weapons I'm not going to use its still pretty daunting for me to make use of. I'll probably just change my code to the weapon flag that you mention.

Unless you think I can just drop that code in and it will use my existing models. Then all I have to do is look into the shade changing. My uneducated guess is its not that simple

This post has been edited by Mark: 30 December 2023 - 07:46 PM

0

User is online   Danukem 

  • Duke Plus Developer

#3412

 Mark, on 30 December 2023 - 07:41 PM, said:

I looked at the sample.con file and even if I delete sections for weapons I'm not going to use its still pretty daunting for me to make use of. I'll probably just change my code to the weapon flag that you mention.

Unless you think I can just drop that code in and it will use my existing models. Then all I have to do is look into the shade changing.


Check your discord DMs
0

#3413

Have you ever gotten a custom sound to work with one-time ambient? For the SFX you usually hear when you walk outdoors on an E1 or E3 map like a heli or a jet flying over.
0

User is offline   VGames 

  • Extra Crispy

#3414

When using an ifspawnedby statement is there a way to check what action the actor is using that did the spawning? Like something like this:

	

ifactor NEWSHOTGUN
{
	ifspawnedby PIGCOP
	{
		geta[THISACTOR].owner myspawner

		ife sprite[myspawner].action APIGDIVESHOOT // SOMETHING LIKE THIS?
		{
			geta[].z z
			add z 5000
			seta[].z z
		}
	}
}




Is there something that can do this or no?
0

User is online   Danukem 

  • Duke Plus Developer

#3415

No, but there are plenty of other solutions.
0

User is offline   VGames 

  • Extra Crispy

#3416

Ok thanks
0

#3417

That trouble I was having with toggling projectile invisibility was from trying to set cstats arbitrarily instead of OR/XOR'ing them in. Same thing with finding differences between angles instead of using incangle.
0

User is offline   VGames 

  • Extra Crispy

#3418

Is there a way to detect whether or not a sector's shade is being manipulated by a SECTOREFFECTOR with a lotag of 3 or 4 via the player's scripts? That's that random lights effect. I was hoping there would be a floorstat or something like that that could be used to check it but there is not. I tried doing a findnearactor to see if the player was near a sectoreffector and if they were in the same sector but the findnearactor command does not work for sectoreffectors kind of like the EXPLOSION2 actor.

This post has been edited by VGames: 23 February 2024 - 05:13 PM

0

User is online   Danukem 

  • Duke Plus Developer

#3419

This isn't a direct answer, but you can find a SECTOREFFECTOR in a sector using other methods. findnearactor will not work (since it is not an actor), but findnearsprite will work. Better, if you are searching by sector and not distance, you can use code like this:

// lotag 24 SE in sector == conveyer belt
	
	set A NO
	headspritesect spriteid sprite[].sectnum
	whilevarn spriteid -1
	{
		ife sprite[spriteid].picnum SECTOREFFECTOR
		ife sprite[spriteid].lotag 24 set A YES
		nextspritesect spriteid spriteid
	}


That is some code I wrote for Duke Forces which detects whether there is a conveyer belt in the same sector as the sprite running the code and sets the var A to 1 if there is.
0

User is offline   VGames 

  • Extra Crispy

#3420

Oh that’s nice. Much better for sure than using distance for a search. And thanks for the tip on findnearsprite. That’ll come in handy down the road. Thanks.
0

User is offline   VGames 

  • Extra Crispy

#3421

Isn't there a way to find the sprite number of a certain actor that relates to their number specified in the map editor? Like the number they are given upon spawning into a map or something like that. I could have sworn there was something for this, but I may be thinking of another game.
0

User is online   Danukem 

  • Duke Plus Developer

#3422

Why would it matter if the sprite number in game is the same as the one in the editor?
0

User is offline   VGames 

  • Extra Crispy

#3423

I have an actor that detects when other actors are near it using a list to single them out. But that actor is included in that list too so I need to figure out a way to separate it from the other actors that have the same picnum. So figured if I could get its actual sprite number that would separate it from the others completely. I thought there was something like this in eduke but I think I may have gotten it mixed up with Blood Fresh Supply. Is there an easier way to do this?
0

#3424

Is this list picnums or individual sprites? If it's sprites you just check if each in the list is equal to THISACTOR [the current sprite's id], a match meaning it's the same sprite.
Or if you are trying to get the individual sprites are you thinking of espawn? RETURN would be the sprite id.
0

User is online   Danukem 

  • Duke Plus Developer

#3425

View Postlllllllllllllll, on 14 March 2024 - 11:39 AM, said:

Is this list picnums or individual sprites? If it's sprites you just check if each in the list is equal to THISACTOR [the current sprite's id], a match meaning it's the same sprite.
Or if you are trying to get the individual sprites are you thinking of espawn? RETURN would be the sprite id.


I guess he doesn't know how to loop through a list. He needs to use a while or for loop based on statnum or all the sprites in the map and then check distance to ones of the picnum to do whatever to them. Some relevent commands:

https://wiki.eduke32.../wiki/Whilevarn
https://wiki.eduke32.../Headspritestat
https://wiki.eduke32.com/wiki/Dist
0

User is offline   VGames 

  • Extra Crispy

#3426

I know how to loop through a list, but I think I worded my problem wrong. And yes, its searching for picnums not just sprites. I'll refine my issue because I left out something:

I have an actor that detects when other actors are near it using a list of picnums to decide if it needs to react or not. This list consists of enemies, and the name of some of the enemies on the list create these actors. So, what I need to figure out: How do I keep the actor from reacting to one of these enemies in this list if they were the one that created it? I know how to use owner to figure out who spawned it but how do I keep the actor in question from not reacting to its enemy owner and at the same time react to an enemy who has the same picnum as its owner? I hope y'all can understand my question better.

This post has been edited by VGames: 14 March 2024 - 04:48 PM

0

User is online   Danukem 

  • Duke Plus Developer

#3427

I'm not really sure what you are trying to say there, but maybe you could have a per-actor var and then set it to a specific unique value for the originator and its lineage, then you can just check it.
0

User is offline   VGames 

  • Extra Crispy

#3428

Oh that’s a good idea. I can have a random number generate and assign it to the owner then check for that. Thanks for the tip.
0

User is offline   VGames 

  • Extra Crispy

#3429

Is it possible to manipulate console commands such as "r_glowmapping" via con code or can this only be turned on and off via the console or by editing the actual config files?
0

User is online   Danukem 

  • Duke Plus Developer

#3430

No, I don't think so. I've wanted to do that myself. If it is possible, it's an undocumented feature.
1

User is offline   VGames 

  • Extra Crispy

#3431

Ok thanks for the info. I figured it wasn't possible, but I had to ask.
0

User is offline   Mark 

#3432

I have some simple code that displays some partially transparent animated frames across the screen depending on if the player is underwater or under a parallaxed sky. The problem is I have some interior spaces with a windowed skylight in the ceiling and it triggers the effect and I don't want that. I was thinking I could change the pal or tag of just those sectors and then add conditions to the ifoutside command to exclude those sectors from triggering the effect. How would I do that? Or should I tackle this from a completely different way?

onevent EVENT_DISPLAYREST
ifactor APLAYER
ifinwater
{ rotatespritea 160 100 524288 0 3589 20 0 1024 160 0 0 xdim ydim soundonce DUKE_UNDERWATER }
else
ifoutside
rotatespritea 160 100 65536 0 8183 20 0 1024 220 0 0 xdim ydim
endevent
0

User is offline   Mark 

#3433

I came up with a possible solution shortly after posting. I'm pretty sure the indoor skylights are at a lower height than the outdoor skybox ceilings so I simply checked for ceiling height and if it was less than a certain number, don't do the rotatespritea command. I need to run thru the maps and verify the effect is indeed working under all outdoor sectors.

But if you have a simple solution like I mentioned in the previous post I will use that instead.

EDIT: There were a couple of minor areas in just one map where the effect didn't show outdoors with my ceiling height check solution but not a gamebreaker thing.

This post has been edited by Mark: 25 March 2024 - 06:50 AM

0

#3434

If the skylight is a single sector then check the sprites in the sector for the skylight whenever ifoutside is true and the player's sector has changed from the previous tick
0

User is online   Danukem 

  • Duke Plus Developer

#3435

Also, most of the code should be in the APLAYER actor (or at least gameworld side), and that code should set a var that triggers drawing of the correct sprite in the display event. Then the display event just draws the sprite and isn't checking gameworld stuff.
0

User is offline   VGames 

  • Extra Crispy

#3436

Has anybody ever noticed that the Duke Nukem 3D logo on the main menu gets moved down a few clicks when you activate the main menu while playing a map? Like before you load a map the logo sits in one place and then if you bring up the main menu by pressing ESC in game the logo has moved down a bit. Is this fixable or does this have to be fixed via the source?
0

User is offline   NightFright 

  • The Truth is in here

#3437

Is there a way to draw negative DIGITALNUM values?

I'm trying to get a frags display working for Dukematch. So far I got this:

var FRGS 0 2 
getp[].frag FRGS
sub FRGS player[].fraggedself
digitalnumber DIGITALNUM 160 183 FRGS 0 0 272 0 0 xdim ydim


Problem:
If player kills themselves when counter is 0, instead of a minus it shows an inventory icon (Steroids in this case).

I guess the problem is there is no minus sign for DIGITALNUM. If a custom one was made, is there a way to display it properly? Maybe digitalnumber also isn't the right approach. Possibly with screentext instead?
0

Share this topic:


  • 124 Pages +
  • « First
  • 113
  • 114
  • 115
  • 116
  • 117
  • Last »
  • 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