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

Jump to content

  • 124 Pages +
  • « First
  • 98
  • 99
  • 100
  • 101
  • 102
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

EDuke32 Scripting  "CON coding help"

User is offline   VGames 

  • Extra Crispy

#2963

My main issue is that the ammo pickup for the railgun is actually the original HEAVYHBOMB actor because it gives you 1 ammo at a time which is perfect. However, this isn't the ammo sprite used in the HUD for the pipe bombs. That sprite is the big box of pipe bombs which is now a Railgun weapon pickup. So, the Railgun Weapon pickup sprite is what's displayed in the HUD instead of the other one. I'll look into this some more. Thanks for the tips.
0

User is offline   jimbob 

#2964

why not use the ammobox actor then? and ignore the heavybomb actor. change the amount of ammo you get through the user.con code

if that doesnt work, create your own pickup actor, and let it give you whatever ammo you need to get from it.

This post has been edited by jimbob: 14 August 2022 - 01:19 PM

1

User is offline   VGames 

  • Extra Crispy

#2965

What I did was set the ammo and weapon pickup sprites like they would normally be. That fixed the HUD issue. Then I created a new weapon and ammo pickup for my railgun that were created when the original pipebomb and pipebomb ammo pickups were spawned. The originals just get swapped out with the new ones. It's all good now.
0

User is offline   VGames 

  • Extra Crispy

#2966

Is it possible to change the weapon raise animations? So that maybe u can have a weapon pop out from the side or from above when switching to it instead of it raising up from the bottom of the screen like all the weapons typically do? I didn’t see anything for this in the weapons sample con and I don’t recall any weapons in mods doing this.
0

User is online   Danukem 

  • Duke Plus Developer

#2967

 VGames, on 16 August 2022 - 09:56 AM, said:

Is it possible to change the weapon raise animations? So that maybe u can have a weapon pop out from the side or from above when switching to it instead of it raising up from the bottom of the screen like all the weapons typically do? I didn’t see anything for this in the weapons sample con and I don’t recall any weapons in mods doing this.


You can cancel the hardcoded drawing of the weapon by setting to RETURN to -1 in the weapon drawing event (EVENT_DISPLAYWEAPON or EVENT_DRAWWEAPON). Then you can use rotatesprite and other commands to draw the weapon or whatever else you want to draw on to the screen wherever you want it to be drawn. And that is really the only answer I can give you. There is no simple hack or setting of a variable to make a weapon come in from the side instead of the bottom.
0

User is online   Reaper_Man 

  • Once and Future King

#2968

Yes it's possible. You'd have to completely rewrite the weapon display code for that specific weapon, which sounds harder than it really is, and really is just tedious more than anything. The weapon sample CON would be a good place to start, you'll just have to do your own math on having the weapon pop out from the side or top.
0

User is offline   VGames 

  • Extra Crispy

#2969

Ok cool I’ll look into this. I’ve been working out of the weapon sample CON extensively already so I’ll keep adding to it. Thanks.
0

User is offline   VGames 

  • Extra Crispy

#2970

ok I've got a little issue with 2 weapons playing off the same weapon using the WORKSLIKE command. They both WORKSLIKE weapon 11 and I got them to play the raise and lower animations like they should as long as you aren't switching between them. When you switch from one of them to the other the art for both weapons will be displayed during the lowering animation of which ever one is currently selected. I have tried everything to get them to wait on each other to finish their lowering animations before displayign their own art but it just won't work. I can't think of a proper if statement or variables to get them to wait on each other.

in the CHANGEWEAPON EVENT I'm using this to set up the wait:

ifvare player[].curr_weapon HANDBOMB_WEAPON
	setvar SwitchTime6 20

ifvare player[].curr_weapon TRIPBOMB_WEAPON
	setvar SwitchTime9 20



in the DISPLAYWEAPON EVENT I got this to make them play the proper animation when their specific SwitchTime variable is active:

	ifvarg SwitchTime6 0
		state draw_LSFire1

	ifvarg SwitchTime9 0
		state draw_4HFire


Now both SwitchTime6 and 9 get reduced by 1 every tick when above 0 I just didn't show that part of the code. This code works good unless you're switching between both weapons. I didn't include all the various sets of script I tried out to try and get them to wait on each other. They were all worthless. Please help if you can.

This post has been edited by VGames: 21 August 2022 - 01:40 PM

0

User is online   Danukem 

  • Duke Plus Developer

#2971

I'm going to guess that one instance of the weapon drawing is the hardcoded one, and the other instance is your own using a screen drawing command. If that's right then there's a few tics where you aren't cancelling the hardcoded display event.

In cases where the coder doesn't know what is going on or causing the issue, I kind of have to discount what they are saying about it since what they are saying could include false assumptions. So I can't go by your descriptions, only the actual code, and you didn't include the main part of your code. I don't have time anyway though.
0

User is offline   VGames 

  • Extra Crispy

#2972

View PostDanukem, on 21 August 2022 - 01:59 PM, said:

I'm going to guess that one instance of the weapon drawing is the hardcoded one, and the other instance is your own using a screen drawing command. If that's right then there's a few tics where you aren't cancelling the hardcoded display event.

In cases where the coder doesn't know what is going on or causing the issue, I kind of have to discount what they are saying about it since what they are saying could include false assumptions. So I can't go by your descriptions, only the actual code, and you didn't include the main part of your code. I don't have time anyway though.


I didn't think I should post all the code here. I'll post a link for the file itself if anybody is interested.

https://www.mediafir...EAPONS.con/file
0

User is online   Reaper_Man 

  • Once and Future King

#2973

I wanted to share another standalone-ish effect we have in AWOL ahead of release - This is an enemy arena spawner / manager to spawn in waves of enemies in an automatic and dynamic way. Think of it like a much more advanced RESPAWN. From the code documentation:

-----------------------------------------------------------------------------
Summary :
Combat arena management and spawning.

Arena Managers act like Touchplates, activating when a player enters their
sector. Arena Spawn Points act like Respawns, except they can spawn multiple
times. Once activated, a Manager will attempt to trigger their paired
Spawn Points in waves on a repeating cycle. Each wave, a Spawn Point will
only trigger if its spawned child is dead, otherwise it will be skipped.
Spawn Points will continue spawning until their "tickets" run out.

For example, if an arena has 5 Spawn Points but 2 enemies are left alive,
the next wave will only spawn 3 enemies, but only if each of those 3 Spawn
Points have remaining tickets.

For Arena Managers:
* Set the sprite's HITAG to the spawn wave frequency, in game tics (min 90)

For Arena Spawn Points:
* Set the sprite's HITAG to the tile ID to spawn
* Set the sprite's LOTAG to the number of spawn "tickets" (min 1)

Use the palette to pair a Manager with Spawn Points to create a complete
system. A Manager can have any number of associated Spawn Points, and there
can be as many Manager systems as there are palette numbers.

Note: Spawn Points will not spawn if a player has line-of-sight with them, so
place them in non-visible locations, and try not to place other Spawn Points
within line-of-sight of each other to prevent the system from dead locking!
-----------------------------------------------------------------------------


This manager largely works by abusing EVENT_WORLD and custom statnums to reduce overhead. I am pretty proud of this effect and its elegance, and unfortunately it didn't get used as much in AWOL as I had hoped, so hopefully it gains more life in someone else's project.

This code won't run as-is, you'll need to setup gamevars and remove or fix some AWOL-specific code/vars outside the scope of this file. No support will be provided for this code.

Attached File(s)


3

User is offline   jimbob 

#2974

awesome, i could use something like this in my mod :)
0

User is offline   VGames 

  • Extra Crispy

#2975

is there any way to keep an enemy sprite from using shade 0 while dying? I have this nice burning death effect for them that slowly darkens their sprite until its nice a blackened but when they go into their death animation, they lose the shade reduction and then when they're dead the darkened shade setting returns, For some reason I can't get them to keep that dark shade during their death animation. They're only darker when still alive and burning and when they're lying on the floor completely dead.
0

User is online   Danukem 

  • Duke Plus Developer

#2976

View PostVGames, on 03 September 2022 - 01:25 PM, said:

is there any way to keep an enemy sprite from using shade 0 while dying? I have this nice burning death effect for them that slowly darkens their sprite until its nice a blackened but when they go into their death animation, they lose the shade reduction and then when they're dead the darkened shade setting returns, For some reason I can't get them to keep that dark shade during their death animation. They're only darker when still alive and burning and when they're lying on the floor completely dead.


https://wiki.eduke32...iki/Spriteflags

Make sure to apply the NOSHADE flag to the sprite before applying shade.
0

User is offline   VGames 

  • Extra Crispy

#2977

View PostDanukem, on 03 September 2022 - 01:42 PM, said:

https://wiki.eduke32...iki/Spriteflags

Make sure to apply the NOSHADE flag to the sprite before applying shade.


Oh ok. Thanks. I misunderstood the use of this flag.
0

User is online   Reaper_Man 

  • Once and Future King

#2978

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

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 visibleThe 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] 0So far performance seems okCredit to Mblackwell for letting me know


I'm working on a few performance related things and just want to corroborate this behavior, and I'm not sure if this is a bug in the implementation of EVENT_RESETGOTPICS or if this event is explicitly meant to function only with mirrors. Based on the description and comments in the source code, I assumed it would fire every frame after EVENT_DISPLAYROOMS, but it only seems to be fired when mirror rendering logic is happening. So if you want to reset the gotpic array independent of mirror logic, it seems to be safest to do in a DISPLAYROOMS event after all other DISPLAYROOMS events have been executed, or in any other event that runs after DISPLAYROOMS.

View PostDanukem, 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?


Based on a quick test using the above info, sprites are rendered (or at least, inserted into the gotpic array) even if they are not explicitly on screen, based on A.) if the sprite's sector is being rendered AND B.) if the sprite is within the player's field of vision. Using the example image below, if the player were in the top left of each U, the sprite on the left room would always be rendered no matter where the player is located, as long as the player is facing in its direction, even though the walls block it from being seen. But the sprite in the right room would never be rendered until the player gets in the bottom left corner sector, at which point the sprite's sector begins to be rendered and it begins to follow those rules.

Attached Image: capt0007.png

Basically, if you understand how sector rendering is performed, any sprite in a rendered sector will always be drawn if the sprite's location is within the player's field of vision, even if walls block it from being seen. One-way mask walls would presumably prevent this as they function as white walls during rendering, although I didn't test this here.
1

User is offline   VGames 

  • Extra Crispy

#2979

I've got these missiles that need to appear as if they're shooting out from the sides of the screen due to the position of the cannons onscreen. My problem is to get them to look like they're properly shooting out of the cannons I have to set one missile offset to 100 and the other missile offset to -100. Shooting these missiles while strafing around will cause the missile that has the offset of -100 to occasionally hit the player especially while looking up or down. I think it's mainly this missile killing the player, but it could be the other one too. Is there a way to keep these missiles from hitting the player when using these types of offsets? I've tried making them invisible when they're within a certain player distance and then showing up when they're outside of that player distance to ensure they can't hit the player, but it doesn't work. I've tried giving them the default centered offset setting and then forcing the 100 and -100 offset when they're far enough from the player that they can't hit him along with making them invisible when they're close to the player, but it doesn't work. I've also tried other offset settings like 200 and -200 or 400 and -400 but the missiles start to look off from the cannon positions as I go higher. Please help if you can.

I just tried using the htflags 2048 on the missiles when they're within a certain range of the player to make them clip through him but that didn't work either.

This post has been edited by VGames: 10 September 2022 - 11:07 AM

0

User is offline   jimbob 

#2980

maybe someone here can help me, i have a projectile, that when impacting a wall spawns a wall blood shooter ( using state random_wall_blood ) but the blood does not seem to shoot at the wall, could the sprite be too close? or angled the wrong way? i tried moving it on the Y axis, and rotating it 1024 units but to no avail. sometimes it does seem to shoot at random other walls so im kind of confused how the spawned sprites angle is determinded
0

User is online   Danukem 

  • Duke Plus Developer

#2981

View PostVGames, on 10 September 2022 - 10:55 AM, said:

I've got these missiles that need to appear as if they're shooting out from the sides of the screen due to the position of the cannons onscreen. My problem is to get them to look like they're properly shooting out of the cannons I have to set one missile offset to 100 and the other missile offset to -100. Shooting these missiles while strafing around will cause the missile that has the offset of -100 to occasionally hit the player especially while looking up or down. I think it's mainly this missile killing the player, but it could be the other one too. Is there a way to keep these missiles from hitting the player when using these types of offsets? I've tried making them invisible when they're within a certain player distance and then showing up when they're outside of that player distance to ensure they can't hit the player, but it doesn't work. I've tried giving them the default centered offset setting and then forcing the 100 and -100 offset when they're far enough from the player that they can't hit him along with making them invisible when they're close to the player, but it doesn't work. I've also tried other offset settings like 200 and -200 or 400 and -400 but the missiles start to look off from the cannon positions as I go higher. Please help if you can.

I just tried using the htflags 2048 on the missiles when they're within a certain range of the player to make them clip through him but that didn't work either.


This is one of those situations where offsets just don't cut it. You have to intervene at the instant the rockets spawn in EVENT_EGS and manually reposition the x and y coordinates. I find the rotatepoint command useful for calculating the new coordinates in these situations.
0

User is online   Danukem 

  • Duke Plus Developer

#2982

View Postjimbob, on 10 September 2022 - 11:01 AM, said:

maybe someone here can help me, i have a projectile, that when impacting a wall spawns a wall blood shooter ( using state random_wall_blood ) but the blood does not seem to shoot at the wall, could the sprite be too close? or angled the wrong way? i tried moving it on the Y axis, and rotating it 1024 units but to no avail. sometimes it does seem to shoot at random other walls so im kind of confused how the spawned sprites angle is determinded



Typically when an enemy uses that state, it is facing towards the player and the back of the enemy is facing towards the wall that get bloodied. So maybe those hardcoded wall splat projectiles have a big angle offset and come out the backside of the sprite shooting them. Therefore, I would try making your projectile turn 1024 build degrees right before shooting those blood splats and deleting itself.
0

User is offline   VGames 

  • Extra Crispy

#2983

View PostDanukem, on 10 September 2022 - 12:31 PM, said:

This is one of those situations where offsets just don't cut it. You have to intervene at the instant the rockets spawn in EVENT_EGS and manually reposition the x and y coordinates. I find the rotatepoint command useful for calculating the new coordinates in these situations.


Will do. Thanks a lot
0

User is offline   jimbob 

#2984

View PostDanukem, on 10 September 2022 - 12:40 PM, said:

Typically when an enemy uses that state, it is facing towards the player and the back of the enemy is facing towards the wall that get bloodied. So maybe those hardcoded wall splat projectiles have a big angle offset and come out the backside of the sprite shooting them. Therefore, I would try making your projectile turn 1024 build degrees right before shooting those blood splats and deleting itself.

i already tried that, including some other angles ( 512 and others ) making the sprite spin seems to work so there is definatly a offset involved but finding the right angle seems to be rather difficult. i could always try to make increments in angle offset of about 32 units untill i hit the sweet spot.
[edit] trying to rotate the sprite didnt seem to work, there is probably something else going on in the code. so i hacked it by making a move command and using faceplayer. its a hack but it seems to work :P and because the move isnt instantanious it kind of splatters it allong the wall quite nicely too. its not perfect, but then again what is.

This post has been edited by jimbob: 11 September 2022 - 10:53 AM

0

User is offline   VGames 

  • Extra Crispy

#2985

Ok I'm doing something wrong with the rotatepoint command.

	ifactor ID_ALT1
	{
		rotatepoint player[].posx player[].posy 100 player[].posy player[].ang temp tempb
		setsprite THISACTOR temp player[].posy player[].posz
	}


No matter what I set that 100 to the missile simply does not show up. Even if I set it to 0. What am I doing wrong? This is in the EGS event.
0

User is offline   VGames 

  • Extra Crispy

#2986

I figured it out
0

User is offline   VGames 

  • Extra Crispy

#2987

Is it possible to allow the player to keep and use their weapons when shrunk? I know how to disable the running hands animation when shrunk but it seems like the weapons have been temporarily removed during this shrunk state. Any way to disable this? Or is it hardcoded?
0

User is online   Danukem 

  • Duke Plus Developer

#2988

View PostVGames, on 14 September 2022 - 05:44 AM, said:

Is it possible to allow the player to keep and use their weapons when shrunk? I know how to disable the running hands animation when shrunk but it seems like the weapons have been temporarily removed during this shrunk state. Any way to disable this? Or is it hardcoded?


It is very hardcoded
0

User is offline   VGames 

  • Extra Crispy

#2989

I'm adding blood dripping from the ceiling, and everything is mostly good, but I can't seem to keep the blood drops that fall down from landing on the player's head and creating a blood splat. I've tried setting the seta[].htflags 2048 command to the drip actor but it still hits the player. I even tried making the blood splats it creates check to see if they're on the floor or else they disappear, but they won't. I've tried this in many different events including the game event and the body of the blood splat actor, but they won't disappear. I'd like the actual drip actor to pass through the player if possible.
0

User is online   Danukem 

  • Duke Plus Developer

#2990

What if the drip immediately deleted if it touched the player? Would that be good enough?
0

User is offline   VGames 

  • Extra Crispy

#2991

View PostDanukem, on 16 June 2009 - 11:01 AM, said:

Setting jumping_counter to one of the values that causes upward acceleration would do that.


That would be fine if that’s the best that can be achieved. My work around so far was to have the drops disappear if the player got within a certain distance of them. This is ok but I’d really like the drops to fall right in front of the players face sometimes and with this method I have to set the distance to 2000 or more to keep them from landing on his head. So it looks weird sometimes when they simply disappear mid air. But if they simply disappeared when contacting the player that would be even better. How would I go about doing this?

This post has been edited by VGames: 16 September 2022 - 04:27 AM

0

User is online   Danukem 

  • Duke Plus Developer

#2992

View PostVGames, on 16 September 2022 - 04:25 AM, said:

That would be fine if that’s the best that can be achieved. My work around so far was to have the drops disappear if the player got within a certain distance of them. This is ok but I’d really like the drops to fall right in front of the players face sometimes and with this method I have to set the distance to 2000 or more to keep them from landing on his head. So it looks weird sometimes when they simply disappear mid air. But if they simply disappeared when contacting the player that would be even better. How would I go about doing this?


This is more difficult than it should be. There is no direct way to tell if a sprite is falling onto the player. The getzrange command can be used for this, though. I have had success with it.

https://wiki.eduke32.../wiki/Getzrange

You'll have to examine the floorhit return value to see if the player is being hit, and then compare the floorz return value to the height of the falling sprite and have it delete itself if the z distance is short enough.
0

Share this topic:


  • 124 Pages +
  • « First
  • 98
  • 99
  • 100
  • 101
  • 102
  • 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