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

Jump to content

  • 119 Pages +
  • « First
  • 105
  • 106
  • 107
  • 108
  • 109
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

EDuke32 Scripting  "CON coding help"

#3181

One other thing was I indexed all of the BOSS4 sprites I drew to duke's palette to reduce the size. Their appearance didn't change ingame since it was being converted to 8bit already but the previous files were 32bit with translucent pixels.
After doing this the load time dropped quite a bit and that was about when I was trying out the htflag.
1

User is online   VGames 

#3182

Is there a way to force walls, floors, and ceilings to allow bullet holes? I've noticed that on some walls especially bullet holes simply do not appear. I've tried using damageeventtile to force the specific texture to use the same settings as other wall textures but there's no change.
1

User is offline   Aleks 

#3183

 VGames, on 02 January 2023 - 10:35 AM, said:

Is there a way to force walls, floors, and ceilings to allow bullet holes? I've noticed that on some walls especially bullet holes simply do not appear. I've tried using damageeventtile to force the specific texture to use the same settings as other wall textures but there's no change.

This is probably due to these walls being parts of moving sectors (like doors), the bulletholes won't appear on them, as they wouldn't be carried along (and would look stupid just hanging there in the air if the door moves :) ), remember bulletholes are essentially wall-aligned sprites.
1

#3184

You'll end up with decals on exploded walls too.
You should be able to spawn a wall aligned decal on the event where the bullet impacts by getting the angle to the wall etc to get around the default setting preventing it though you'll want to delete them whenever that wall shifts, with the exception of the decal sitting in a rotating sector. If the original decal won't spawn make a dupe of it.

-
Is there a way to pass down a projectile's palette to the sprite it spawns on impact (proj_spawns)? This projectile is using noshade and taking on the palette from the actor shooting it
1

User is offline   Danukem 

  • Duke Plus Developer

#3185

Grab palette off the owner in EVENT_EGS. Or anything else you need to grab. That's going to come up for a lot of stuff, so make a note of that everyone.
1

User is online   VGames 

#3186

Ok so I should just leave the walls alone then. I don’t want to add more problems to my plate.

How do I code this model to use different skins for different palettes?

model "models/nailgun/nailgun.MD2" {
   scale 20
   skin { pal 0 file "models/nailgun/nailgun.png" }

   anim { frame0 "shot1" frame1 "shot1" fps 4  }
   frame { frame "shot1" tile0 6872 tile1 6872 }

   anim { frame0 "shot2" frame1 "shot9" fps 40  }
   frame { frame "shot2" tile0 6873 tile1 6874 }	

   hud { tile0 6872 tile1 6874 xadd -0.38 yadd 0.3 zadd 0 angadd 0 }
}


This post has been edited by VGames: 02 January 2023 - 05:01 PM

1

User is offline   Danukem 

  • Duke Plus Developer

#3187

Just add another skin clause, exactly like the one it has already, but make it for pal # and refer to whatever the file name is for the other one.
1

User is offline   MC84 

#3188

Following on from my last query re: custom explosions, how the heck do you override EXPLOSION2's default action EXPLOSION_FRAMES (20 by default)? I have two alternate explosions, SMOKEBLAST1 (16 frames) and SMOKEBLAST2 (33 frames) but they will both play 20 frames when spawned.

action EXPLOSION_FRAMES 0 20 1 1  4
action ASMOKEBLAST1 3743 16 1 1 8 // 3743 tiles from original EXPLOSION2 (1890) = 5633
action ASMOKEBLAST2 3763 33 1 1 4
actor EXPLOSION2 1 EXPLOSION_FRAMES
{
  ife extrasaved 1 
   ifaction EXPLOSION_FRAMES
    { action ASMOKEBLAST1 cstat 0 }
  
  else
  ife extrasaved 2
   ifaction EXPLOSION_FRAMES
   { action ASMOKEBLAST2 cstat 0 }
   
  else
   { ifactioncount 20 
     killit
   }
}
enda


I have also tried placing a CACTOR command, but this just froze the actions on their first frame when spawned;

{
  ife extrasaved 1 
   ifaction EXPLOSION_FRAMES
    { 
	 cactor SMOKEBLAST1
	 action ASMOKEBLAST1 cstat 0 }


And I tried placing the following in EVENT_EGS;

  case EXPLOSION2 // Alternate explosions
  { 
   ifn sprite[].owner -1   // owner being the SEENINE sprite that spawned the EXPLOSION2 actor
   getav[sprite[].owner].extrasaved extrasaved
   
   ife extrasaved 1
    {
	 ifactioncount 16
	 killit
	}
   else
   
   ife extrasaved 2
    {
	 ifactioncount 33
	 killit
	}
    else nullop	
  }
  break


But that doesn't seem to do anything either...
0

User is offline   Danukem 

  • Duke Plus Developer

#3189

action EXPLOSION_FRAMES 0 20 1 1  4
action ASMOKEBLAST1 3743 16 1 1 8 // 3743 tiles from original EXPLOSION2 (1890) = 5633
action ASMOKEBLAST2 3763 33 1 1 4
actor EXPLOSION2 1 EXPLOSION_FRAMES

  ife extrasaved 1 
   ifaction EXPLOSION_FRAMES
    { action ASMOKEBLAST1 cstat 0 }
  
  else
  ife extrasaved 2
   ifaction EXPLOSION_FRAMES
   { action ASMOKEBLAST2 cstat 0 }
   
ifaction EXPLOSION_FRAMES
   ifactioncount 20 
     killit
else
ifaction ASMOKEBLAST1 
  ifactioncount 16
      killit
else
ifaction ASMOKEBLAST2
   ifactioncount 33
      killit

enda


Just change the actor, don't try to mess with the animations in EGS
2

User is online   VGames 

#3190

Yeah that kind of stuff dealing with animations needs to be taken care of in the actor’s body of code.
1

#3191

 VGames, on 02 January 2023 - 04:21 PM, said:

Ok so I should just leave the walls alone then. I don’t want to add more problems to my plate.

The one thing that should be ok in every case is adding decals to sector 0 masked walls only if you can find a way to exempt textures with alpha. I can't think of any cases where a solid masked surface would create trouble having a bullet hole on it.
1

User is online   VGames 

#3192

@Dan
Ok so this:

model "models/nailgun/nailgun.MD2" {
   scale 20
   skin { pal 0 file "models/nailgun/nailgun.png" }
   skin { pal 1 file "models/nailgun/nailgunB.png" }
   skin { pal 2 file "models/nailgun/nailgunR.png" }
   skin { pal 8 file "models/nailgun/nailgunG.png" }

   anim { frame0 "shot1" frame1 "shot1" fps 4  }
   frame { frame "shot1" tile0 6872 tile1 6872 }

   anim { frame0 "shot2" frame1 "shot9" fps 40  }
   frame { frame "shot2" tile0 6873 tile1 6874 }

   hud { tile0 6872 tile1 6874 xadd -0.38 yadd 0.3 zadd 0 angadd 0 }
}


does nothing for the view model of the gun. I tried the multiple skin lines like you said for the pickup model for the weapon and it worked just like you said it would:

model "models/nailgun_pick/nailgun_pick.md2" {
   scale 2.6 shade 0
   skin { pal 0 file "models/nailgun_pick/nailgun_pick.png" }
   skin { pal 1 file "models/nailgun_pick/nailgun_pickB.png" }
   skin { pal 2 file "models/nailgun_pick/nailgun_pickR.png" }
   skin { pal 8 file "models/nailgun_pick/nailgun_pickG.png" }

   anim { frame0 "shot1" frame1 "shot1" fps 4  } 
   frame { frame "shot1" tile0 6871 tile1 6871 }
}


But for the view model it does nothing. Only the pal 0 skin is used.
1

User is offline   Danukem 

  • Duke Plus Developer

#3193

Yeah hud models are a different beast. There's even a whole set of hud commands for models on the wiki: https://wiki.eduke32...wiki/Model_(DEF)

I don't know if you can make them use different pals, though, I don't recall ever trying that.
1

User is online   VGames 

#3194

 Danukem, on 03 January 2023 - 08:13 PM, said:

Yeah hud models are a different beast. There's even a whole set of hud commands for models on the wiki: https://wiki.eduke32...wiki/Model_(DEF)

I don't know if you can make them use different pals, though, I don't recall ever trying that.


Ok cool. I’ll check this stuff out again. Maybe I missed something
1

User is offline   MC84 

#3195

What is the best way to create an actor that has multiple damage levels? The following code gets stuck after the first ifstrength statement;

useractor notenemy DOORBOARDED 120
{
 cstat 273 // blocked, hittable
 ifaction 0
  {
   ifhitweapon
    { ifstrength 100
      action ONE 
      break 
     }
    else
    { ifstrength 80
      action TWO 
      break 
     }
    else 
    { ifstrength 60
      action THREE 
      break 
    }
   else
   { ifstrength 40 
     action FOUR 
     break 
    }
   else
   { ifstrength 20
     action FIVE 
     break 
    }
   else
   { ifstrength 0
     killit 
    }
   }
}
enda
	

0

User is offline   Danukem 

  • Duke Plus Developer

#3196

 MC84, on 05 January 2023 - 12:56 PM, said:

What is the best way to create an actor that has multiple damage levels?




It's easy enough, but first we need to get clear on the intent. What is supposed to happen if you do enough damage to reduce it multiple levels in one hit? Do you want it reduced by only one damage level anyway?
1

User is offline   MC84 

#3197

 Danukem, on 05 January 2023 - 01:13 PM, said:

It's easy enough, but first we need to get clear on the intent. What is supposed to happen if you do enough damage to reduce it multiple levels in one hit? Do you want it reduced by only one damage level anyway?


Well I guess in my simplistic understanding I assumed that the 'ifhitweapon' branch included the multiple else statements to handle the possibility that you shoot the actor with an RPG and it takes it down multiple levels... Those actions are relative to the zero/default tile of the actor right? So if the actor was hit by a weapon, and it takes the damage down to 20 (from 120), then action 5 will skip ahead to the 5th damaged state of the actor right? I mean obviously it's not working - but that was the intent!

This post has been edited by MC84: 05 January 2023 - 02:06 PM

0

User is online   VGames 

#3198

 MC84, on 05 January 2023 - 02:05 PM, said:

Well I guess in my simplistic understanding I assumed that the 'ifhitweapon' branch included the multiple else statements to handle the possibility that you shoot the actor with an RPG and it takes it down multiple levels... Those actions are relative to the zero/default tile of the actor right? So if the actor was hit by a weapon, and it takes the damage down to 20 (from 120), then action 5 will skip ahead to the 5th damaged state of the actor right? I mean obviously it's not working - but that was the intent!


Something like this should work:

useractor notenemy DOORBOARDED 120
{
 	cstat 273 // blocked, hittable
 	ifaction 0
  	{
   		ifhitweapon
		{
    			ifstrength 100
			{
      			action ONE 
      			break
			}
    			else	ifstrength 80
			{
     	 			action TWO 
      			break 
     			}
    			else ifstrength 60
			{
      			action THREE 
      			break 
    			}
   			else ifstrength 40
			{
     				action FOUR 
     				break 
    			}
   			else ifstrength 20
			{
     				action FIVE 
     				break 
    			}
   			else
     				killit 
   		}
   	}
}
enda


Notice where the brackets are.

This post has been edited by VGames: 05 January 2023 - 05:30 PM

1

User is online   VGames 

#3199

Is there any way to check what HUD is being used as in the HUD you pick by pressing the - or = keys? I tried messing around with "statubarrange" by getting the value and saving it in a variable, but I don't know what the number is for the specific HUD type I'm trying to mess with.

This post has been edited by VGames: 05 January 2023 - 05:38 PM

1

User is offline   MC84 

#3200

 VGames, on 05 January 2023 - 05:29 PM, said:



Something like this should work:

Notice where the brackets are.


Thanks for trying to help - however now when I shoot the actor it goes straight to killit... Although you have taught me something - I now realize that the brackets should have followed the else if statements.
0

User is offline   Reaper_Man 

  • Once and Future King

#3201

 MC84, on 05 January 2023 - 12:56 PM, said:

What is the best way to create an actor that has multiple damage levels? The following code gets stuck after the first ifstrength statement;

The way "ifstrength" works is it returns true if the health value is less than or equal to X. The reason it gets stuck after the first one is because every value is less than or equal to 100, so it never enters the other branches. You should be able to easily fix this by ordering your ifstrength statements from lowest to highest, rather than highest to lowest. Also, yes the bracket should go after the next if statement, not after else

ifstrength 20
{
	// something
}
else
ifstrength 40
{
	// something else
}

etc.

2

#3202

 MC84, on 05 January 2023 - 12:56 PM, said:

What is the best way to create an actor that has multiple damage levels? The following code gets stuck after the first ifstrength statement;

useractor notenemy DOORBOARDED 120
{
 cstat 273 // blocked, hittable
 ifaction 0
  {
   ifhitweapon
    { ifstrength 100
      action ONE 
      break 
     }
    else
    { ifstrength 80
      action TWO 
      break 
     }
    else 
    { ifstrength 60
      action THREE 
      break 
    }
   else
   { ifstrength 40 
     action FOUR 
     break 
    }
   else
   { ifstrength 20
     action FIVE 
     break 
    }
   else
   { ifstrength 0
     killit 
    }
   }
}
enda
	


It's getting stuck because all of that only fires on IFACTION 0. Changing the action to anything else stops meeting that condition.
After that it is getting stuck on the first strength check because 'ifstrength 100' is true until death (if strength <= 100).

Spoiler

2

User is offline   MC84 

#3203

Thanks guys! I appreciate the help!
0

User is online   VGames 

#3204

 VGames, on 05 January 2023 - 05:32 PM, said:

Is there any way to check what HUD is being used as in the HUD you pick by pressing the - or = keys? I tried messing around with "statusbarrange" by getting the value and saving it in a variable, but I don't know what the number is for the specific HUD type I'm trying to mess with.


Still looking for some help with this if it’s even possible.

But also wanted to ask if “digitalnumber” is deprecated now what is its replacement?

This post has been edited by VGames: 06 January 2023 - 07:55 AM

0

User is offline   Reaper_Man 

  • Once and Future King

#3205

You want the screen_size userdef property.

https://wiki.eduke32...iki/Screen_size

Screentext should be used for all HUD text drawing. At the bottom of the wiki page are examples on how to convert deprecated screen text commands to screentext.

https://wiki.eduke32...wiki/Screentext
0

User is online   VGames 

#3206

 Reaper_Man, on 06 January 2023 - 10:41 AM, said:

You want the screen_size userdef property.

https://wiki.eduke32...iki/Screen_size

Screentext should be used for all HUD text drawing. At the bottom of the wiki page are examples on how to convert deprecated screen text commands to screentext.

https://wiki.eduke32...wiki/Screentext


This is what I’ve been looking for thanks
0

User is offline   jimbob 

#3207

i want to use EVENT_SOUND to check if a sound if playing, then use rotatesprite to display a subtitle for it, adding a regular quote works fine, but rotatesprite doesnt seem to work the way it should... well i am guessing it triggers for a single tick then stops so the graphic isnt displayed correctly. any way to make the graphic stay on screen longer?
i use this in event_sound
case PSA1 { quote 125 rotatesprite 0 0 65536 0 6282 0 0 0 0 0 xdim ydim } break



so the quote works fine, but tile 6282 isnt rendered, or too briefly to be seen.
0

User is offline   Reaper_Man 

  • Once and Future King

#3208

That's likely correct, it would only be displaying for a single gametic when EVENT_SOUND captures the sound playback. EVENT_SOUND only triggers when a sound is played, NOT while a sound is playing. What you can do is create a subtitle timer gamevar, and in EVENT_SOUND set the timer, then in a DISPLAYREST event, display the subtitle if the timer is non-zero. You don't want to decrement the timer in DISPLAYREST because that's tied to the player's framerate, so you'll want a separate EVENT_WORLD or similar event to decrement the timer down to zero.
0

User is offline   jimbob 

#3209

i got it working :) i did do it all in event EVENT_DISPLAYREST but thats something i'll fix this afternoon, for now it works :) thanks
0

User is online   VGames 

#3210

Is there a sprite flag that can keep sprites from reacting to the dynamic lights when using Polymer?
0

Share this topic:


  • 119 Pages +
  • « First
  • 105
  • 106
  • 107
  • 108
  • 109
  • 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