Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

ArrivedHero

Members
  • Content count

    24
  • Joined

  • Last visited

Everything posted by ArrivedHero

  1. ArrivedHero

    Hitboxes and PlayerClasses

    Ok, two quick questions. How small (or large) can a hitbox be without the engine running into problems with collisions? Like, say you wanted to make a 1 by 1 projectile for a bullet, or several 4 by 4 hitbox for the torso of an enemy. Would that be possible without problems with collision detection? Maybe in ZScript, there is a way to add more vertices to the hitboxes? Second is just a preference advice. If I were to have the player have multiple outward appearances, such as changing the sprite to match what kind of armor they are wearing; should I just stick to that one player class and try to work with the state machine, or have them morph into other classes to avoid any confusions and mishaps during development?
  2. ArrivedHero

    Zscript HUD Font

    Update: Found the problem. I had to add the updated version into the ZScript file "version '4.1.2'". I know, I'm a version behind but I'm working on it.
  3. ArrivedHero

    Zscript HUD Font

    Hey, I've been trying to create my own HUD with my own fonts but of course I am running into trouble. I am following along with how the DoomStatusBar class added it's own fonts in it's Init() function but I keep getting a "expression must be a modifiable value" error. Here is my code. class TheLastIconHUD : BaseStatusBar { HUDFont visor; HUDFont damageEffects; override void Init() { Super.Init(); SetSize(0, 1920, 1080); Font fnt = "TESTFONT"; visor = HUDFont.Create(fnt, fnt.GetCharWidth("0"), Mono_CellLeft, 1, 1); fnt = "DAZEFONT"; damageEffects = HUDFont.Create(fnt); } override void Draw(int state, double TicFrac) { super.Draw(state, TicFrac); DrawImage("hud0", (0, 0), DI_ITEM_OFFSETS); } } What exactly am I doing wrong?
  4. ArrivedHero

    ZScript: Custom Pointers

    The issue has been resolved but it has left my head scratching.
  5. ArrivedHero

    ZScript: Custom Pointers

    I'm sorry I keep asking the same questions over and over again but I'm struggling with another thing with ZScript. I am trying to make a custom pointer for the player for the player's children and weapons to access. I made a public Actor class variable of targetSights, that constantly updates to whatever is underneath the players crosshairs in an overridden Tick function. { Actor targetSights; override void PostBeginPlay() { Super.PostBeginPlay(); //other stuff targetSights = null; } override void Tick() { // if/else statement to make sure that this is not a voodoo of the player. GetTarget(); } void GetTarget() { targetSights = GetPointer(AAPTR_PLAYER_GETTARGET); } } For the weapon I am using the fist for experimentation but the code I got for it to use is in a custom action function A_PlayerPunch() the code is this. Actor fistOwner = NewMarine(invoker.owner); if(fistOwner != null) { if(fistOwner.targetSights !=null) { Actor fistTarget = fistOwner.targetSights; A_PrintBold(fistTarget.Species); } } I keep getting an error that it does not know what targetSights is in the ZScript I typed up for the custom melee attack. What am I doing wrong?
  6. ArrivedHero

    ZScript: Custom Pointers

    Partially resolved. Instead of using "let" I used "actor" in the attack function; however, it is still not printing out the intended target. It only "sees" the player and not what the player is looking at.
  7. ArrivedHero

    ZScript: The Elephant In The Room

    Oh ok, yeah. I'm familiar with that. Thank you.
  8. ArrivedHero

    ZScript: The Elephant In The Room

    ZScript has proven to do absolute wonders. Currently, I am learning C# and that has helped me out so far as I have been about to create void functions, functions with parameters, virtual and a few custom actor properties. (Still trying to wrap my head around actor flags though; I assume they are like simple bools). I got data types down as well as arrays (does zscript do lists and dictionaries as well?). I started with converting my custom monsters from decorate to zscript as to clean up their codes so it they aren't a jumbled mess of frames and {} blocks. But I have attempted to convert weapons over and I keep getting an error "incompatible self pointer", which seems to be a common error people are getting for zscript weapons. What exactly is causing this and how do you do it right? Below is my own sample code for a custom melee attack for the player. class Knuckles : Fist Replaces Fist { States { Fire: PUNG B 4; PUNG C 4; PUNG D 5 {invoker.A_PlayerPunch();} //I included the "invoker" because I read that it is //need from another forum. However, the function will //print but the player can't land a punch. PUNG C 4; PUNG B 5 A_ReFire; Goto Ready; } void A_PlayerPunch() { A_PrintBold("Test"); if(Owner && Owner is "MaleMarine") { if(countinv("PowerStrength")) { A_CustomPunch(2*random(1, 10), true, 0, "MeleePuff", 0, 0, 0, "none", "player/male/fist", "skeleton/swing"); } else { A_CustomPunch(4*random(1, 10), false, 0, "MeleePuff", 0, 0, 0, "none", "player/male/fist", "skeleton/swing"); } } else { if(!countinv("PowerStrength")) { A_CustomPunch(random(1, 10), true, 0, "MeleePuff", 0, 0, 0, "none", "player/male/fist", "skeleton/swing"); } else { A_CustomPunch(2*random(5, 15), false, 0, "MeleePuff", 0, 0, 0, "none", "player/male/fist", "skeleton/swing"); } } } }
  9. ArrivedHero

    ZScript: The Elephant In The Room

    Wait, holdup, that makes sense now thinking about it.
  10. ArrivedHero

    ZScript: The Elephant In The Room

    Ok, is this a Java thing or just one of the many quirks of ZScript?
  11. ArrivedHero

    ZScript: The Elephant In The Room

    Ok, so I am trying not to make too many threads and keep them under the same categories. My next question is concerning class variables, I understand the difference between private and public variables but I see that they can only be private for ZScript. I was wondering if there was any way, say a weapon class was able to read a variable of its owner. Or, am I stuck with declaring global variables with Event Handlers?
  12. What exactly is the engine doing when the player chooses to crouch? I poured through ZScript in "shared" for anything and the closest I could find what I am looking for were a couple of internal functions that handling crouch movement but none of them really explained how the sprites change or the player's height. Also, is there a button for toggle crouch? I don't mean the option to toggle but like an actual "BT_TOGGLECROUCH". Because currently I'm working on a ZScript that will switch the player's camera from their own to a child tracer, and I can only get it to work by using the hold down method. Does the engine morph the player and retain all their items and stats or something when they crouch?
  13. ArrivedHero

    Crouching: What exactly is going on?

    Ok, figured it out, it is in CheckCrouch(). The if else statement that has the CrouchMove() function is where I want to place my code. Thanks again.
  14. ArrivedHero

    Crouching: What exactly is going on?

    I appreciate the help, but this does seem like something that I am going to have to simulate through a "crouch" state or morph, I will continue looking through this. Thank you.
  15. ArrivedHero

    ZScript: The Elephant In The Room

    Alright, that's interesting. Thank you.
  16. ArrivedHero

    ZScript: The Elephant In The Room

    To answer previous questions, Empyre asked if "is" is an operator. Yes it is, you are correct in your assumption that it is similar to the "==" operand. Partly the reason I am using ZScript is because I feel like it is a lot neater and two is because I am currently learning a programming language and I want to push myself. In all fairness, there is some documentation for ZScript but it is not so friendly to people using it for the first time and you do need some prior knowledge to understand it. Here is the new code: (Please follow example if you need help ;) class NewKnuckles : Fist { States { Fire: PUNG B 4; PUNG C 4; PUNG D 5 A_PlayerPunch; PUNG C 4; PUNG B 5 A_ReFire; Goto Ready; } action void A_PlayerPunch() { A_PrintBold("Test"); if(invoker.Owner && invoker.Owner is "MaleMarine") { if(countinv("PowerStrength")) { A_CustomPunch(2*random(1, 10), true, 0, "MeleePuff", 0, 0, 0, "none", "player/male/fist", "skeleton/swing"); } else { A_CustomPunch(4*random(1, 10), false, 0, "MeleePuff", 0, 0, 0, "none", "player/male/fist", "skeleton/swing"); } } else { if(!countinv("PowerStrength")) { A_CustomPunch(random(1, 10), true, 0, "MeleePuff", 0, 0, 0, "none", "player/male/fist", "skeleton/swing"); } else { A_CustomPunch(2*random(5, 15), false, 0, "MeleePuff", 0, 0, 0, "none", "player/male/fist", "skeleton/swing"); } } } } Lastly, I did promise a demo for ladders, so I should get on that.
  17. ArrivedHero

    ZScript: The Elephant In The Room

    Thank you SaladBadger! It works now! Though now I have to ask, why do I need to append "action" to the void function?
  18. OK, so the first thing I have here is my PlayerMorph actor in Decorate actor PlayerClimber: DoomPlayer //Or whatever class that is your playerpawn { Player.ForwardMove 0 Player.SideMove 0 +NOGRAVITY -TELESTOMP states { spawn: PLAY A 2 goto Spawn2 spawn2: PLAY A 4 loop } } now i have my playermorph powerup actor PlayerClimbMorph: PowerMorph { PowerMorph.PlayerClass "PlayerClimber" PowerMorph.MorphFlash "NoFlash" PowerMorph.UnMorphFlash "NoFlash" PowerUp.Duration -0x7fffffff } ///////////// //This is for morphing without a flash ///////// actor NoFlash { states { spawn: TNT1 A -1 stop } } If you want to create an animation of the player grabbing onto the ladder then the flash can be used for the morph flash. the last thing in decorate is the morphweapon which is what is used to have the player move up or down the ladder. actor Climb: weapon //in this one i had added a flashlight ability onto the player (another work in progress im making) and i added a reload ability so the player can { ///// remove the power morph ability and essentially "let go" of the ladder +WEAPON.NOALERT states { select: goto Ready deselect: goto Ready ready: TNT1 A 0 A_JumpIfInventory("FlashLight", 1, "ReadyLight") TNT1 A 0 A_JumpIfInventory("Reloader", 1, "Reload") TNT1 A 0 A_WeaponReady TNT1 A 1 loop ReadyLight: TNT1 A 0 A_FireCustomMissile("FlashLightPlacer", 0, 0, 0, -25, 48) TNT1 A 0 A_JumpIfInventory("Reloader", 1, "LightReload") TNT1 A 0 A_WeaponReady TNT1 A 1 goto Ready Fire: TNT1 A 0 A_JumpIfInventory("FlashLight", 1, "LightFire") TNT1 A 1 ThrustThingZ(0, 8, 0, 0) TNT1 A 2 A_ReFire goto Ready LightFire: TNT1 A 0 A_FireCustomMissile("FlashLightPlacer", 0, 0, 0, -25, 48) TNT1 A 1 ThrustThingz(0, 8, 0, 0) TNT1 A 2 A_ReFire goto Ready AltFire: TNT1 A 0 A_JumpIfInventory("FlashLight", 1, "LightAltFire") TNT1 A 1 ThrustThingZ(0, -8, 0, 0) TNT1 A 1 A_ReFire goto Ready LightAltFire: TNT1 A 0 A_FireCustomMissile("FlashLightPlacer", 0, 0, 0, -25, 48) TNT1 A 1 ThrustThingz(0, -8, 0, 0) TNT1 A 0 A_FireCustomMissile("FlashLightPlacer", 0, 0, 0, -25, 48) TNT1 A 1 A_ReFire TNT1 A 0 A_FireCustomMissile("FlashLightPlacer", 0, 0, 0, -25, 48) goto Ready Reload: TNT1 A 0 A_JumpIfInventory("FlashLight", 1, "LightReload") TNT1 A 0 A_TakeInventory("Reloader", 1) TNT1 A 1 A_ChangeFlag(NOGRAVITY, 0) TNT1 A 0 ACS_Execute(244, 0, 0, 0, 0) TNT1 A 1 A_TakeInventory("PlayerClimbMorph", 1) TNT1 A -1 stop LightReload: TNT1 A 0 A_FireCustomMissile("FlashLightPlacer", 0, 0, 0, -25, 48) TNT1 A 0 A_TakeInventory("Reloader", 1) TNT1 A 1 A_ChangeFlag(NOGRAVITY, 0) TNT1 A 0 A_FireCustomMissile("FlashLightPlacer", 0, 0, 0, -25, 48) TNT1 A 0 ACS_Execute(244, 0, 0, 0, 0) TNT1 A 1 A_TakeInventory("PlayerClimbMorph", 1) TNT1 A 0 A_FireCustomMissile("FlashLightPlacer", 0, 0, 0, -25, 48) TNT1 A -1 stop } } Now moving on to ACS, this one is a bit tricky because I have different values because I've been working on other things in the game such as armor and health statuses. Basically there are scripts that are going to record how much armor the player has BEFORE morphing then they do some math work to pass those values onto the morphed player. int ArmorAmount; int SecurityMorphArmor; int CombatMorphArmor; int ChargeMorphArmor; int DemolitionMorphArmor; int PlayerPitch; script 5 (void) { if(getactorz(0) < x) // x being what ever value your player is at when you approach your ladder, you can make it whatever you want, mine is basically the bottom rung of { ///my ladder print(s:"fire to climb up and alt fire to climb down and reload to let go."); acs_execute(245, 0, 0, 0, 0); PlayerPitch = GetActorPitch(0); delay(1); giveinventory("PlayerClimbMorph", 1); setactorpitch(0, PlayerPitch); delay(1); if(checkinventory("greenbar")) { giveinventory("SecurityArmor", 1); delay(1); takeinventory("Armor", SecurityMorphArmor); } if(checkinventory("bluebar")) { giveinventory("DamagedArmor", 1); delay(1); takeinventory("Armor", CombatMorphArmor); } if(checkinventory("redbar")) { giveinventory("DemolitionArmor", 1); delay(1); takeinventory("Armor", DemolitionMorphArmor); } if(checkinventory("bluearmorcheck")) { giveinventory("Charge", 200); delay(1); takeinventory("Armor", ChargeMorphArmor); } acs_execute(244, 0, 0, 0, 0); acs_execute(13, 0, 0, 0, 0); } else //this script also lets the player "let go" of the ladder { takeinventory("PlayerClimbMorph", 1); setplayerproperty(0, 0, PROP_FLY); acs_execute(244, 0, 0, 0, 0); } } this script is whats doing the math int Health; script 245 open { Health = getactorproperty(0, APROP_HEALTH); ArmorAmount = checkinventory("Armor"); SecurityMorphArmor = 100 - ArmorAmount; CombatMorphArmor = 100 - ArmorAmount; ChargeMorphArmor = 200 - ArmorAmount; DemolitionMorphArmor = 250 - ArmorAmount; } this script transfers the player's health script 244 (void) { setactorproperty(0, APROP_HEALTH, Health); } this last script tells when the player has reached the top of the ladder script 13 (void) { until(getactorz(0) >= x) // again, x can be what ever value you want, it can be however tall your want you ladder to be. { PlayerPitch = getactorpitch(0); delay(1); } thing_move(0, 44, 1); //this is where the player teleports when you reach the top of the ladder as sort of "stepping off" the ladder. setactorpitch(0, PlayerPitch); takeinventory("PlayerClimbMorph", 1); setplayerproperty(0, 0, PROP_FLY); acs_execute(244, 0, 0, 0, 0); PlayerPitch = GetActorPitch(0); delay(1); setactorpitch(0, PlayerPitch); } The only bug I can think if is when you climb to the top but there is a monster or another object in the teleport point. This can be fixed with the block monsters line around it but won't work for another player who is in your way. The reason being it doesn't make sense to telestomp something at the end of a ladder hence the -TELESTOMP flag being set for the PlayerClimber.
  19. ArrivedHero

    Lockdef messages not working

    Hey so I'm wrapping things up with my first wad and I wanted to edit the messages a locked door gives you when you don't have the key. It will only print the remote message and not the actual door message. I have even tried to use the language lump and that doesn't even work. It will only print out the look up name "PD_REDC" and I include the '$' as well.
  20. ArrivedHero

    MAPINFO/intermission

    I'm almost done with a mega wad and I was wanting to make a custom intermission if you don't survive the final level. So I read up in Zdoom Wiki and discovered there is an intermission definition and a DeathSequence property for MAPINFO. Just what I was looking for! So I tried it in SLumpED but got the errors "intermission is an unknown top level keyword" and "DeathSequence is an unknown property". I know how to make a custom text screen after completing a cluster but has anyone been able to create a custom intermission?
  21. ArrivedHero

    actor has no frames

    Yup, I'm an idiot it's supposed to go into a sprites folder. Ok thanks guys!
  22. ArrivedHero

    actor has no frames

    So I've been playing around with decorate in Slumped and I was able to create fire using the archvile's flame. It worked pretty good so I decided to create my own using ms paint to learn how to create my own monsters in the future. So I made the actor, gave it a png for a sprite and gave it a four letter name with frame letters A and B and a 0. But whenever I load up the map I get the "!" error and I check through tab and it tells me that the actor as n frames. How could that be if I gave it a frame in its name? This is the code that I used. actor shitflame 401 { //$Category "fire" height 64 radius 64 meleerange 64 meleedamage 1 obituary "%o died in a shitty fire" -SOLID +NOGRAVITY states { spawn: FLME AB 4 A_Look loop see: melee: FLME AB 4 A_MeleeAttack goto see } } Can anyone explain what I did wrong?
  23. ArrivedHero

    actor has no frames

    No, is it supposed to? I'll try it.
  24. ArrivedHero

    actor has no frames

    Its names are FLMEA0 and FLMEB0 Do they have to have markers separating them and in a sprite folder from the rest? And it's in a pk3 file.
×