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

Jump to content

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

EDuke32 Scripting  "CON coding help"

User is offline   Danukem 

  • Duke Plus Developer

#3391

View PostMark, 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

#3392

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 

#3393

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 offline   Danukem 

  • Duke Plus Developer

#3394

No, but there are plenty of other solutions.
0

User is offline   VGames 

#3395

Ok thanks
0

#3396

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 

#3397

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 offline   Danukem 

  • Duke Plus Developer

#3398

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 

#3399

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 

#3400

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 offline   Danukem 

  • Duke Plus Developer

#3401

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

User is offline   VGames 

#3402

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

#3403

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 offline   Danukem 

  • Duke Plus Developer

#3404

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 

#3405

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 offline   Danukem 

  • Duke Plus Developer

#3406

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 

#3407

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 

#3408

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 offline   Danukem 

  • Duke Plus Developer

#3409

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 

#3410

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

User is online   Mark 

#3411

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 online   Mark 

#3412

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

#3413

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 offline   Danukem 

  • Duke Plus Developer

#3414

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 

#3415

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

#3416

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

User is offline   Danukem 

  • Duke Plus Developer

#3417

View PostNightFright, on 27 March 2024 - 01:51 AM, said:

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:

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?


Notice that in the regular font (define STARTALPHANUM 2822), the minus sign is 3 tiles before the 0, and in the DIGITALNUM tiles you are using, the steroids icon is 3 tiles before the 0. So the game believes the minus sign is supposed to be 3 tiles before the 0. If you just copy the DIGITALNUM tiles to new tile numbers and add your custom minus sign 3 tiles before the 0 and use the tile of your 0 in the digitalnumber command, it should work.
1

User is offline   NightFright 

  • The Truth is in here

#3418

Ah, that explains the Steroids. Thanks for the hint!
Got it working now, with this (custom "minus" sign loaded as tile #10000):

In definitions:
// Copy DIGITALNUM (2472) to tilerange 10003-10012
copytile 10003 { tile 2472 }
copytile 10004 { tile 2473 }
copytile 10005 { tile 2474 }
copytile 10006 { tile 2475 }
copytile 10007 { tile 2476 }
copytile 10008 { tile 2477 }
copytile 10009 { tile 2478 }
copytile 10010 { tile 2479 }
copytile 10011 { tile 2480 }
copytile 10012 { tile 2481 }


In CON:
define FRAGNUM 10003
getp[].frag FRGS
sub FRGS player[].fraggedself
digitalnumber FRAGNUM SHIFTX 183 FRGS 0 0 272 0 0 xdim ydim


Now still looking for a way to pull off statusbar scaling, as outlined here.
0

#3419

Anything that can be done about slimers in a normal sector crawling onto the player in an underwater sector being invisible and silent?
0

#3420

Is there a simple way to resize an actor? I'm trying to resize RECON to 56 48, with EVENT_EGS and EVENT_SPAWN, but the affect I get is spawning RECONS from all difficulty settings and they just stand still doing nothing.
0

Share this topic:


  • 119 Pages +
  • « First
  • 112
  • 113
  • 114
  • 115
  • 116
  • 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