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

Jump to content

  • 124 Pages +
  • « First
  • 84
  • 85
  • 86
  • 87
  • 88
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

EDuke32 Scripting  "CON coding help"

#2544

View PostTrooper Dan, on 30 August 2019 - 03:52 PM, said:

It's not exactly clear what you want. How many times do you want the shotgun to be able to fire before you have to reload it? Do you want the shotgun to stop working when it's empty until the player presses a different key to reload it? Should the reload start automatically when the shotgun is empty, and only be manual if it is partially depleted?

EDIT: Anyway, I coded a manual reload shotgun for DukePlus, and I think AMC TC has several like that. It will be hard for you to find the relevant code by searching through the CONs, but I don't have time to write new code.


I want the shotgun to reload after firing 8 rounds. I want the shotgun to stop working after it empties all 8 rounds, until i press the reload key. You don't have to write a new code, I will find it in the AMC TC or DukePlus, and make it work, somehow. Thank you for telling me, and also for help and patience with me.
0

User is offline   Mark 

#2545

.

Attached thumbnail(s)

  • Attached Image: happycoder.jpg

1

User is offline   F!re-Fly 

#2546

I invented air bubbles that Duke can pick up underwater. I wish I could make sure that the counter of the airleft value was stopped for a short time, before health declined again. When Duke picks medkits out of the water without problems, I would like to do the same underwater.
0

User is offline   MC84 

#2547

Can anyone shed some light on how different blending modes are implemented in eduke32? For instance transparent lights and lens flares that have an 'additive' property instead of just a straight transparency? I can only find info on fogpals on the eduke wiki. Thanks
0

#2548

Hello!
Is there a way to determine which frame of the animation is currently playing? This is necessary, for example, to synchronize the sound of steps with character animation. Or to make sure that the animation has finished playing.
0

User is offline   Danukem 

  • Duke Plus Developer

#2549

View PostMr. Alias Nameless, on 19 January 2020 - 11:51 PM, said:

Hello!
Is there a way to determine which frame of the animation is currently playing? This is necessary, for example, to synchronize the sound of steps with character animation. Or to make sure that the animation has finished playing.


https://wiki.eduke32...iki/Actioncount

ifactioncount and resetactioncount can be used to do what you want.
0

User is offline   F!re-Fly 

#2550

For my part, I planned different kinds of armor with well defined values. I wish I could make sure that the armor that is picked up only affects Duke's health when it reaches 100%.

For example a golden armor of 200hp, will keep the health always at 100%, until the armor runs out.

Last thing, I would also like to make sure that Duke cannot pick up another armor, until the special armor is used up below 100%.

This post has been edited by Firefly Trooper: 20 January 2020 - 10:13 AM

0

#2551

is there any way to read keystrokes in events EVENT_DISPLAYMENU, EVENT_CHANGEMENU, EVENT_SCREEN or when game is paused setuserdef[] .pause_on 2
This could be very useful for creating an inventory interface, for example.
0

User is offline   Sangman 

#2552

Is it possible to detect if the player has a given tilenumber in view? The way I was thinking of doing it was to do a hitscan check from every pixel covering the player's view, but that sounds entirely ridiculous.
Still, we have some functions like ifcansee that work against actors. I probably need that but for textures.


edit:

Apparently this is exposed via the gotpic array in CON.

ife gotpic[tilenum] 1 => means that tilenum is currently visible

The array doesn't reset on its own (there is an EVENT_RESETGOTPICS but from what I can tell from the source code, this only gets called when handling mirrors), but you can do so manually inside your code bock:

setarray gotpic[tilenum] 0

So far performance seems ok

Credit to Mblackwell for letting me know

This post has been edited by Sangman: 10 February 2020 - 09:29 AM

0

User is offline   Danukem 

  • Duke Plus Developer

#2553

View PostSangman, on 10 February 2020 - 06:44 AM, said:


ife gotpic[tilenum] 1 => means that tilenum is currently visible

The array doesn't reset on its own (there is an EVENT_RESETGOTPICS but from what I can tell from the source code, this only gets called when handling mirrors), but you can do so manually inside your code bock:

setarray gotpic[tilenum] 0



Interesting. So what exactly causes the elements to get set? For example, if a certain enemy dies in a place where no players are around, is its dead body tile "in view"? Or does it require that the tile is actually rendered on a screen?
0

User is offline   Sangman 

#2554

Good questions, which I'm sure somebody can answer :rolleyes:
0

User is offline   F!re-Fly 

#2555

I just had another rather specific idea. I wonder if it really possible that an enemy can patrol freely in an area until he sees the player, in order to attack him? I wonder if modifying a statnum or using a sprite similar to "locator" could do that, to define a route in a sector.

This post has been edited by Firefly Trooper: 19 February 2020 - 12:48 PM

0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#2556

View PostTrooper Dan, on 10 February 2020 - 09:44 AM, said:

Interesting. So what exactly causes the elements to get set? For example, if a certain enemy dies in a place where no players are around, is its dead body tile "in view"? Or does it require that the tile is actually rendered on a screen?

It requires the tile to be rendered.

This was added so the skybox in Ion Fury would only be drawn if the skybox texture (which is a blank tile) was visible.

Note that it's only set after it's rendered (meaning that in the Ion Fury example there's a 1 frame delay).
1

User is offline   Danukem 

  • Duke Plus Developer

#2557

View PostFox, on 19 February 2020 - 03:56 PM, said:

It requires the tile to be rendered.

This was added so the skybox in Ion Fury would only be drawn if the skybox texture (which is a blank tile) was visible.

Note that it's only set after it's rendered (meaning that in the Ion Fury example there's a 1 frame delay).


I miss-clicked and downvoted you by accident (that was supposed to be an upvote).

Anyway, that's a good feature for saving resources with an expensive command like showview
0

User is offline   Darkus 

#2558

I want to make an actor shoot at, not another actor, but at a specific spot. I have the X/Y coords of both shooter/target, but I don't know how to measure the distance between two spots. There's ldist but it's only useful with sprites, is there an equivalent for points?
0

User is offline   Darkus 

#2559

Found a solution. It's a bit messy, but it consists of teleporting the player, take measurement, and teleport it back.

getplayer[THISACTOR].posx temp1
getplayer[THISACTOR].posy temp2
setplayer[THISACTOR].posx XPOS
setplayer[THISACTOR].posy YPOS
ldist DISTDIFF THISACTOR player[THISACTOR].i
setplayer[THISACTOR].posx temp1
setplayer[THISACTOR].posy temp2


I'm trying to make monsters shoot at the direction of the player's movements (if you played Unreal games, you know what I mean).
0

User is offline   Danukem 

  • Duke Plus Developer

#2560

Seems legit for a Duke hack. I've done stuff like that. But you could have used the Pythagorean theorem and just calculated it.

EDIT: Here, if the vars "hitx" and "hity" are the distant coordinates, and assuming the other vars have been declared, then this will do the job

	set xydist sprite[].x
	sub xydist hitx
	mul xydist xydist
	set y2 sprite[].y
	sub y2 hity
	mul y2 y2
	add xydist y2
	sqrt xydist xydist


This post has been edited by Trooper Dan: 22 March 2020 - 03:56 PM

0

User is offline   Darkus 

#2561

Thanks, it's the example I needed. It works in both cases, I managed to achieve the effect I wanted: making enemies anticipate your moves.

Example, dodging left:

Posted Image

Also made a variant that take account of height. This time dodging left and jetpack on, going up:

Posted Image
4

User is offline   Danukem 

  • Duke Plus Developer

#2562

Cool. The old move parameter "faceplayersmart" also does that, although I'm sure it's very primitive.
0

User is offline   Darkus 

#2563

faceplayersmart don't take account of the distance and projectile speed. Just run toward an enemy that using that move, and I see how he turns you back ;)
0

User is offline   Jblade 

#2564

Some time ago somebody (I'm fairly certain it was Fox) posted some script showing how to use totalclock or something like that to do smooth 60fps weapon swapping animations. Anybody know what I'm talking about and still have it around?
0

User is offline   spacekebab 

#2565

Hey guys, is there a way to cut/mask wall aligned sprites (like blood decals) through con? like cut off or even wrap around the sprite as soon as the wall ends?
0

User is offline   Danukem 

  • Duke Plus Developer

#2566

View Postspacekebab, on 25 May 2020 - 11:20 AM, said:

Hey guys, is there a way to cut/mask wall aligned sprites (like blood decals) through con? like cut off or even wrap around the sprite as soon as the wall ends?


Not sure what you mean. At first I thought you meant prevent them from hanging off of ledges, but now I doubt that.
0

User is offline   spacekebab 

#2567

View PostTrooper Dan, on 25 May 2020 - 11:37 AM, said:

Not sure what you mean. At first I thought you meant prevent them from hanging off of ledges, but now I doubt that.


That's exactly what I meant, sorry - didn't know how to word it.

This post has been edited by spacekebab: 25 May 2020 - 07:16 PM

0

User is offline   Danukem 

  • Duke Plus Developer

#2568

View Postspacekebab, on 25 May 2020 - 07:15 PM, said:

That's exactly what I meant, sorry - didn't know how to word it.


There is hardcoding in the base game which prevents the standard BLOODPOOL from hanging over ledges. So one solution is to spawn BLOODPOOL, then in a game event (EVENT_WORLD may be your best choice) cactor BLOODPOOL into your own actor, and change size and pal if needed. Since BLOODPOOL is already in a verified good location, that should be fine (although it won't be if your sprite is much bigger).

If you want to use your own code then I would suggest a loop where you test out some nearby coordinates (nothing fancy, just add and subtract values to your sprites's x and y) and check to see if the floor height is the same if the tested coords are in a different sector. Also you can check for slopes. If checks indicate a bad situation, you can resize or delete your sprite as appropriate.
1

User is offline   Mark 

#2569

I have player weapons not flashing the screen during firing but haven't been able to do the same for the enemies. I didn't find anything with a quick browse thru the wiki. I'm using Polymer in case it makes a difference.

Maybe set PROJ_FLASH_COLOR to all 0's? Or is there a global command?

This post has been edited by Mark: 29 August 2020 - 01:47 PM

0

User is offline   Danukem 

  • Duke Plus Developer

#2570

What exactly are the enemies shooting that is making the screen flash?
0

User is offline   Mark 

#2571

pistol, shotgun, chaingun ( machine gun ) They are already custom coded from previous owner of the project. This might complicate your answer. I was hoping for a simple global command or similar.

This post has been edited by Mark: 29 August 2020 - 03:37 PM

0

User is offline   Danukem 

  • Duke Plus Developer

#2572

I can't tell from your description whether there are polymer lights being spawned when the projectiles fire, whether they are flashing the world in the old-fashioned way (setting global visibility for a moment), or whether they have been specially coded to literally flash the screen (via palfrom or equivalent).

The flash color thing might work if they are polymer lights.
0

User is offline   Mark 

#2573

I'll check again to be sure. I think its polymer. Be right back.

edit: Because of how large an area weapons light up in the map I thought it might be the usual sector based flashing. But switching to Polymost stopped any weapon flashing. So even though the mod is ancient, eduke32 is supplying the flash thru Polymer. Can I just set the PROJ_FLASH with a gamevar or is it an event thing? In all my years of coding I have never messed with weapons. I'm a noob once more. :)

This post has been edited by Mark: 29 August 2020 - 04:13 PM

0

Share this topic:


  • 124 Pages +
  • « First
  • 84
  • 85
  • 86
  • 87
  • 88
  • 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