Gez Posted July 7, 2016 I have the exactly opposite opinion wrt. curly brace placement. ¯\_(ツ)_/¯ 0 Share this post Link to post
Dragonfly Posted July 7, 2016 ^ Fair enough! My main reason for it is probably arbitrary anyways. I feel the code looks cleaner, and it also 'removes fake lines' so when your code is 1000 lines long, it is more justified, as pointless as that is, heh. 0 Share this post Link to post
illuknisaa Posted July 7, 2016 How do you remove actors that have been spawned by other actors? I have this ceiling lamp that can be turned on/off and when it's turned on it creates this lens flare effect. The problem I have is that even if the lamp is turned off the lens flare remains. Is there a way to fix this? 0 Share this post Link to post
everennui Posted July 7, 2016 scifista42 said:Remove the semicolons after each "if()" and "else()", here is why. I'm pretty thick headed. As soon as you said that I thought, "Gee, that sounds familiar." *clicks link* "Gee, I'm rather dense." Thanks Scifista42. Hopefully second time's a charm. No semicolons after if or else. No semicolon after if or else. No semicolon after if or else. No semi colons after if or else. No semicolon after if or else. No semi colon after if or else. No semicolon after if or else. No semicolon after if or else. No semicolon after if or else. No semicolon after if or else. No semicolom after if or else. No semicolon after if or else. No semicolon after if or else. No semicolon after if or else. No semicolon after if or else. No semi colon after if or else. I'm still worried I'll forget. Maybe this should be my custom title? 0 Share this post Link to post
scifista42 Posted July 7, 2016 Dragonfly said:I don't know why I feel the need to bring it up, but I find code more readable if the open curly brace comes immediately after the if statement. Gez said:I have the exactly opposite opinion wrt. curly brace placement. ¯\_(ツ)_/¯ I strongly prefer this way of coding:type function(parameters) { ... } if(condition) { ... } because the other way:type function(parameters) { ... } if(condition) { ... } makes me instinctively inclined to put a semicolon after the ending round bracket!!! The former way results in a program with less lines of code, too. In fact, I often even write everything on one line, like this:type function(parameters) { ... } if(condition) { ... } Of course only if there is a small number of commands in the block between the curly brackets. 0 Share this post Link to post
Gez Posted July 7, 2016 To each their own. With the opening brace at the beginning of a line, I find the block's boundaries are more visible. Also helps distinguish better between stuff like this: somefunction(with, a, lot, of, characters, in, its, parameters, so, many, that, a, line, break, is, introduced);and a block. The one exception is that I kinda like this: somecode(); } else { othercode(); But only with a simple else, not with an else if. 0 Share this post Link to post
everennui Posted July 7, 2016 I always like to indent stuff so I can see where the blocks are. <HTML doc...> <head> <title> A kickass webpage! </title> </head> <body> <center> Stuff <table> <col> <row> <ul> <li> </li> </ul> </row> </col> </table> </center> </body> </html> Looking at a huge page with that formating is something of great beauty. 0 Share this post Link to post
scifista42 Posted July 7, 2016 everennui said:I always like to indent stuff so I can see where the blocks are. That's the case in both of the setups proposed by Dragonfly. The problem is the placement of the opening bracket, which is non-existent in languages like html. 0 Share this post Link to post
Gez Posted July 7, 2016 scifista42 said:That's the case in both of the setups proposed by Dragonfly. The problem is the placement of the opening bracket, which is non-existent in languages like html. <html>< head>< title>A kickass webpage!< /title>< /head>< /html>:p 0 Share this post Link to post
everennui Posted July 8, 2016 Truth be told, I just wanted to add my two cents. Hot metal is the only facet of computering that I feel reasonably comfortable showing an example with. A lot of people end tags at the end of a line instead of stacking them which is hard to read for me. It's not the same thing, but I feel like it illustrates the same principal of organization and art. Maybe not. 0 Share this post Link to post
Empyre Posted July 8, 2016 Way back when I was in college, they used Pascal instead of C (or its children) to teach how to code. In Pascal, instead of the brackets { } to denote the beginning and end of a block of code, the words BEGIN and END are used. In Pascal in those days, it was the tradition (but not actually required) to put the keywords in all caps, but everything else was free to have lower case letters. IF (condition) THEN BEGIN some code; END ELSE BEGIN some code; END; Or sometimes:IF (condition) THEN BEGIN some code; END ELSE BEGIN some code; END; While I think that C (and its children, like C++, C#, etc) is better for coding, I think Pascal is pretty good for learning the basic principles of coding because everything is spelled out. 0 Share this post Link to post
illuknisaa Posted July 8, 2016 It seems I always seem to have issues with scripts like this (see comment at "until" line): script 22 (void) { FloorAndCeiling_LowerByValue (87,20,71*8); Ceiling_LowerByValue (88,20,71*8); TagWait (87); Delay (5*35); until (GCE = 9000) //Apparently this line is missing ")" { FloorAndCeiling_RaiseByValue (87,16,71*8); Ceiling_RaiseByValue (88,16,71*8); TagWait (87); TagWait (88); Delay (5*35); FloorAndCeiling_LowerByValue (87,16,71*8); Ceiling_LowerByValue (88,16,71*8); TagWait (87); TagWait (88); Delay (5*35); } }As far as I know that script is the pinnacle of perfection and there is nothing wrong with it. 0 Share this post Link to post
Dragonfly Posted July 8, 2016 I believe it should read:until(GCE == 0) { //stuff. }Note the double-equale instead of the single. Double is checking for equality between two values, whereas single is telling it that value one should equal value 2. If that's not the issue, then ensure that the variable GCE has even been defined. Never say code is perfect, either. Code has a nasty habit of never, ever being perfect. Also, using 35 * 5 in your delay (5 seconds), it works, but adding a math function surely makes it take a little longer to process? In which case it's not perfect. ;) 0 Share this post Link to post
129thVisplane Posted July 8, 2016 So I made some portals, but I've run into a problem. In this map [GZDoom/Doom 2 in UDMF, ignore the colourful name and the missing textures], the stairs can be ascended fine, but there's an invisible barrier where the top of the stairs meets the upper floor. The barrier can be jumped over like a railing but there's no flags on the linedef that would cause this to happen. I'm pretty much a newbie to portals so I'm pretty sure it's the portals that are broken. Any advice how to fix it? (btw it's not a terrywad or anything, i just name my wads the first thing i think of and then rename them later.) 0 Share this post Link to post
illuknisaa Posted July 8, 2016 Dragonfly said:I believe it should read:until(GCE == 0) { //stuff. } Ty. 0 Share this post Link to post
Poormetheus Posted July 9, 2016 Can anybody think of a reason why my custom monster disappears when performing its MELEE attack?? Here is the code. He spawns and chases just perfectly, but melee causes him to momentarily disappear! ACTOR "Skinny" { Game Doom obituary "%o was eaten by a skinless zombie." health 150 scale 0.29 radius 32 height 52 speed 5 mass 400 painchance 20 +SOLID +SHOOTABLE +FLOORCLIP bloodtype "bloodspatter" activesound "skinny/active" attacksound "imp/melee" deathsound "skinny/death" painsound "skinny/pain" seesound "skinny/sight" MONSTER MaxStepHeight 48 MaxDropOffHeight 48 States { Spawn: QZU0 A 1 A_Look QZUM ABCDEFGHIJKLMN 3 loop See: QZU2 ABCDEFGHIJKLMNOPQ 3 A_Chase loop Melee: QZU6 E 2 A_FaceTarget QZU6 F 6 A_SargAttack QZU6 G 6 QZU6 H 6 goto see 0 Share this post Link to post
scifista42 Posted July 9, 2016 Almost certainly because your wad doesn't contain some of the respective sprites (QZU6 prefix with E-H frames). 0 Share this post Link to post
Poormetheus Posted July 9, 2016 The sprites in question are right there in my sprite folder with the others. I don't get why they aren't displaying for the melee attack 0 Share this post Link to post
scifista42 Posted July 9, 2016 Double check if the filenames of the sprites match the ones in the DECORATE. Check if the filenames don't contain invalid characters, such as spaces. Check if all expected rotations (either just 0, or 1-8, or 1-G) are present. Try converting the sprites to a different graphic format. 0 Share this post Link to post
Poormetheus Posted July 9, 2016 Thanks Scifista, It seems putting '0' after the sprites helped it to work, as well as adding the animation 360 degrees. 0 Share this post Link to post
Agentbromsnor Posted July 9, 2016 So... I'm trying to make my own stand-alone game using a PK3 file and GZDoom (GZDoom-GPL to be specific). I downloaded the Wolf3D.PK3 total conversion as a reference using SLADE, and to get an idea of how the game-data is supposed to be structured. My only previous experience has been with WAD files, so this is all pretty new to me. Through the power of Google, I found this handy little tutorial to get me started: http://www.lofibucket.com/articles/modding_doom.html Using that tutorial, I managed to get my PK3 file recognized as a stand-alone "IWAD" using a GZDoom shortcut with a custom parameter. Hurray! :) When I looked through Wolf3D.PK3's files, I copied over the TITLEPIC from it (since apparently, a PK3 only supports PNG. I think?), and I converted the menu graphics from Doom2.wad to PNG and added those in the "graphics" folder of my PK3 as well. This all worked pretty well, and now my PK3 has a Wolf 3D background and Doom 2 menu items. :P What doesn't work though, is the level start up. It doesn't seem to load MAP01, even though I did import my map as a separate WAD file into the "maps" folder of my PK3. Still, whenever I start up my custom shortcut of GZDoom and try to start a new game, the console shows up and reads "No MAP01 found" (or something along those lines). I'm also not sure where to put my ACS files. I copied the SCRIPTS lump from my level-WAD over to the ACS folder of my PK3, but I'm honestly not sure how this works... Can anybody help me out with this? It would be great to have a clear reference of how to structure my game, so I know where everything goes. If this issue is too 'complex', I can also make this into a separate topic if you guys like. EDIT: instead of renaming my map to "map01" in SLADE, I decided to save my map as "map01.wad" in GZDoom Builder and then import it into the maps directory of my PK3 and it worked! The only problem now is... The player doesn't move. There must still be a couple of important files that I'm missing. 0 Share this post Link to post
MaxED Posted July 9, 2016 Agentbromsnor said:So... I'm trying to make my own stand-alone game using a PK3 file and GZDoom (GZDoom-GPL to be specific). When in doubt, check the documentation. Agentbromsnor said:PK3 only supports PNG. I think? (G)ZDoom supports almost all data/content definition formats regardless of used archive format (the only exception, I think, are models, which can not be stored in WADs). Agentbromsnor said:I copied the SCRIPTS lump from my level-WAD over to the ACS folder of my PK3, but I'm honestly not sure how this works... SCRIPTS lump should stay in the map namespace to be recognized by map editors. Agentbromsnor said:The player doesn't move. Did you configure the controls? GZDoom defaults to arrow keys for player movement. 0 Share this post Link to post
Agentbromsnor Posted July 9, 2016 MaxED said:When in doubt, check the documentation. Hmm... I did read it, but I couldn't figure out the structure aside from the directories it specifies. I do have to admit I have a learning disability, so I need a lot of information to go on, so perhaps I just missed some thing. I apologize if some of the things I'm saying are repetitive. MaxED said:(G)ZDoom supports almost all data/content definition formats regardless of used archive format (the only exception, I think, are models, which can not be stored in WADs). When I tried to copy the TITLEPIC and menu graphics directly from Doom2.wad, it showed up as a horrible purple pixelated nightmare. I think I figured out why this is though, ... Instead of copying Doom 2's COLORMAP lump I created my own empty lump called COLORMAP to replace it... Whoops! I should have seen that coming, haha! I'm an idiot... MaxED said:SCRIPTS lump should stay in the map namespace to be recognized by map editors. I didn't remove it from the map's WAD file. So all the map logic is still contained in the WAD, no matter if it's PK3 or not? Does this mean I technically don't have to touch the ACS folder in my PK3 if all my maps have dedicated SCRIPTS lumps? MaxED said:Did you configure the controls? GZDoom defaults to arrow keys for player movement. I'm also using the same version of GZDoom-GPL for testing my map in GZDoom Builder, and it's configured to the typical WASD configuration. I just tried it out, and the arrow keys do appear to work! Hmm! Thanks a ton for you reply! I love learning my way around this. 0 Share this post Link to post
MaxED Posted July 9, 2016 Agentbromsnor said:Does this mean I technically don't have to touch the ACS folder in my PK3 if all my maps have dedicated SCRIPTS lumps? Unless you are planning to use ACS libraries, no. 0 Share this post Link to post
Agentbromsnor Posted July 9, 2016 Another related question I would like to ask is this: I just exported all the player related sprites to PNG's and imported them into the "sprites" folder of my PK3. Let's say I want to manage my game-data and create a "sprites/player" folder. Will GZDoom recognize this, or do I need to specify the folder first? 0 Share this post Link to post
Agentbromsnor Posted July 9, 2016 Godfather38 said:It should work fine. So as long as the sprites are named after the player sprites it should be able to find it regardless of sub-directory? :o 0 Share this post Link to post
Agentbromsnor Posted July 10, 2016 Great! :D Another question since I'm already on a roll here: how would I go about modifying the player's class? My PK3 doesn't have any player info in it, but it still seems to work pretty okay and I can move the player about in the map. I would like to be able to change player properties though. The ZDoom wiki has an article on 'player pawn' but it states that the DECORATE definition should not be used since the player pawn is already defined. It recommends using inheritance in DECORATE, but I suppose that would mean you have to create a new player actor that inherits the player pawn's definitions? But if that's the case I don't know how to set a custom actor to be the player though. Thanks for being patient with me! 0 Share this post Link to post
scifista42 Posted July 10, 2016 http://zdoom.org/wiki/Creating_new_player_classes 0 Share this post Link to post