Jump to content
SSForum.net is back!

Bak

★ VIP
  • Posts

    1064
  • Joined

  • Last visited

Everything posted by Bak

  1. you're right that it keeps them packed. However, if you create a folder inside the zone folder with the name of an arena, and put graphics inside, it will override the lvz graphics/images for that arena. I think the order continuum checks is: 1. arena folder (zoneName/arenaname/graphic.png) 2. (?)zone folder (zoneName/graphic.png) 3. lvz file graphic 4. default graphic (graphics/graphic.png) Maybe it would be good to keep them internal for discretion too, although that would require substantial rework so maybe just unzipping will suffice for now. Well, you can either unzip them into both directories, which I agree is bad, or change them all to have the SDL folder. SDL_net and SDL_image are cross platform libraries in the spirit of SDL. Check out http://www.libsdl.org/libraries.php for a complete list of libraries and their development packs.
  2. Right now the way it looks for paths is on a per-zone basis. Ideally, it would also have subfolders for each arena as continuum does. Right now per-zone is fine. In the future, I'll expand it to be unique for each arena (a lot of other things also need to be upgraded to handle multiple arenas). So the short answer is, don't worry about it.
  3. download the sdl development library: http://www.libsdl.org/download-1.2.php . That should have one dealy full of header files, and one with library files. Copy the contents of the lib folder into "MinGW\lib", copy the SDL folder (from the include folder) into "MinGW\include". Otherwise, you can add custom paths on a per project basis if you prefer, but the method I mentioned is easier. The settings for unique image look like this ;;; This section defines additional images for UniqueImage to Use [images] TurretPath = turret TurretFrames = (10, 4) The name of the UniqueImage here would be "Turret", path specifies the path to use (should first check zone folder, than default graphics folder, also automatically figures out the extension). Frames specifies the number of frames in the image (turret.png is a tiled image with 40 frames, 10 wide 4 high) you can then use uniqueImage->getImageHandle to get a handle for the image given the name ("turret"). Afterwards, if you want to draw static images (you'll instead use the animations interface to do it for you), you can register a callback CB_PRERENDER (which is called every frame), and within it call graphics->drawImage(int imageHandle, int xPixel, int yPixel, int frame, int layer, int blend) to draw it on the screen. However, you'll want to instead use the animations interface and not uniqueimage/graphics directly. Animations, behind the scenes, will use uniqueImage and graphics as I described above. The settings for animation are ;;; This section defines the named animations used by the Animations Module. ;;; This allows you to create a unique image for the animation you want, and specify it in a common format, then use it in code by it's name, ;;; which is much easier than worrying about timing and image handles, and since it uses a UniqueImage there won't be memory issues [Animations] ;<anim name> Unique Image = Flag ;<anim name> Frame Offset = 0 ;<anim name> Frame Count = 20 ;<anim name> Animation Milliseconds = <int> ;<anim name> Animation Offset Milliseconds = <int> Warp Unique Image = Warp Warp Animation Milliseconds = 500 RedExhaust Unique Image = Exhaust RedExhaust Frame Offset = 0 RedExhaust Frame Count = 19 RedExhaust Animation Milliseconds = 500 Here, the animation is called "RedExhaust". It will use the image from UniqueImage "Exhaust" (which in turn defines a path for the actual file). Here, the animation also defines the frame offset and count (you should know what these are), and an animation time for one cycle of the animation. Notice that with warp, the entire image is used (which I think is always true for lvz animations, so you can actually omit frame offset and frame count when defining the settings). The functions you'll want to use are in the animations interface /** * Play an animation that will loop until we tell it to stop using stopLoopingAnimation * @param name the name used to identify the animation int the [Animations] section of hte settings * @param xPixel the x pixel of the animation * @param yPixel the y pixel of the animation * @param centered is this a centered animation? (false = top left corner was specified) * @param layer the later to draw it on * @return a const Animation* index you can use to stop the animation, or move it around (through this interface) */ Animation* (*playLoopingAnimation)(const char* name, int xPixel, int yPixel, bool centered, int layer); /** * Stop a looping animation (a is invalid after the function finishes), you don't need to stop single animations * @param a the animation returned by playLoopingAnimation which we're stopping */ void (*stopLoopingAnimation)(Animation* a); You'll probably want to add a function into the animations interface like playTimedLoopingAnimation which takes in a milliseconds parameters for the time to display the animation. The implementation will be almost identical to that of animations->playSingleAnimation Samp is the first person to honestly try to make a module :))))))))))))))
  4. ^^ funny I think it's a bad idea. Based on previous topics here, I say you, and a few others are quite practical, whereas me, and a few others, are instead more idealistic. Thus, when making my decision, I think ideally criminals would be treated humanely. Life in prison (or at least a long sentence) for attempted murder and mutilation seems fair. Not to mention that no court is perfect, so that although this attack may be an open and shut case, another one may be less obvious (DNA evidence has freed dozens of people after spending decades in prison). There is no way to undo mutilation. Plus I believe I have read some studies where the biggest deterrent against crime is not the severity of the punishment, but rather the chance of getting caught. Consider stealing music. If you steal music online, there's a low chance of getting punished, but a very high punishment (thousands of dollar per song). If you steal music in a store, the punishment is significantly less, but your chance of getting caught is much greater. Rationally, you would do a trade off analysis of amount of punishment times the chance of getting caught. I'd say even if they raise the punishment for online music theft so it was even with shoplifting, or even above that, you would still see more online theft than shoplifting. Would you be less likely to speed if each ticket cost twice as much, or if your chance of getting caught doubled? This justifies the idea that having severe punishments isn't necessarily the best way to deter crimes.
  5. gcc supports pragma pack, use this one if you want: #pragma pack(push, 1) struct LvzObjectDefinition { unsigned isMapObject :1; unsigned objectID :15; union /* Unnamed union */ { struct { signed xCoord :16; signed yCoord :16; }mapObjectCoord; struct { unsigned xReference :4; //Coordinate reference in x, see LvzScreenObjectReference signed xCoord :12; //X coordinate unsigned yReference :4; //Coordinate reference in y, see LvzScreenObjectReference signed yCoord :12; //Y coordinate }screenObjectCoord; //Only used for CLV2 screenobjects }; unsigned imageNumber :8; unsigned objectLayer :8; unsigned displayTime :12; unsigned displayMode :4; }; #pragma pack(pop) My concern is that fread on a structure (or casting from a byte array) will vary depending on the endianness of the architecture. http://www.gamedev.net/reference/articles/article2091.asp . Then again, I'm pretty sure I fread a structure when reading in the tileset, so it may not be a huge deal; up to you.
  6. two notes: the way you're doing it you probably need to #pragma pack(1) to make sure there's no bytes buffering structures, which I suspect is what is happening. However, that method not compatible across platforms (And pragma pack is the devil), so is there anyway you could manually read a u32 and pick out the bits by hand and store them in the appropriate structure? It's not much more work but it's full proof in terms of compatibility across platforms. So for example something like u8 rawData[10]; while (fread(rawData, sizeof(rawData),1, f)) { LvzObjectDefinition l; l.isMapObject = (rawData[9] & 0x80) ? 1 : 0; l.objectId = ((rawData[9] & 0x7F) << | rawData[8]; ... myInteralDataStructure.push_back(l); } Yes all files will be downloaded correctly, including lvz files. It will be put in the zone's path. I believe UniqueImage will check the zone's path when looking for images, which override the default graphics path.
  7. debug terminal trick is having SDL print to the terminal, which normally I would need to recompile SDL since the normal output goes into .txt files (look at the FrontEnd/cskinviewer project near the start of main if you're interested). There is no security check for what you are doing, your module is simply crashing (segment fault = crash). You might check the bin/errorlog.txt file which may or may not contain useful information. If you can't find it attach your code and I'll take a look.
  8. Eclipse has a notion of a workspace, which contains projects. Try to change your current workspace (use file menu) to the Modules folder; there should be an eclipse workspace file there with all the modules included (if I added it to the svn). If not, tell me and I'll add it. You can then build all projects (which, for me, is faster than build solution in VC++, by the way), or build individual projects. The way dll export works is in plain C (see the expansion of the DLLEXPORT macro), so using anything public functions and such is out of the question. Maybe that's not a perfect answer because I don't understand dynamic loading completely. This was the way MervBot and ASSS did it, so it's the way I do it. If you want to use classes within a specific module to better organize your code, feel free. Yes callbacks are events you listen to, which are sort of like interrupts. Rather than periodically polling if a player has died, it's much cleaner to simply say "call this function when a player dies". This is the idea with callbacks. For the packets, however, you'll want to do the following: register and wait for the CB_REGPACKETS callback to occur, then call Net::regPacketFunc for any packets they wish to handle. regPacketFunc takes in a string for the type of packet you want to listen for and a callback-like function. The packet types and relevant fields are defined in conf/modules/net.conf in the [Packet Templates] section. grep for regPacketFunc to see some examples. You are correct, yes there is no limit to the number of map objects save the computer's memory (also, don't reuse animation names and/or unique image names, obviously). Ideally I should use bools everywhere except in interface functions (since they get exported as C, although honestly I don't think it matters). I didn't pay too much attention to this, admittedly.
  9. How do you do this?
  10. Bak

    Glenn Beck

    we shouldn't be trying to strive for world peace?
  11. Bak

    Glenn Beck

    we should still strive for the ideal situation, not give up on it
  12. Uh that path is definitely wrong (svn did that?) If you copy the selfship module, make SURE that you delete the .svn folder, as it will be invalid. You can then readd the correct folder to the repository using "svn add " and it will create the proper .svn folder. Give eclipse another chance it's wonderful. .so and .dll are the same exact thing. Having two different extensions was pointless and only caused more trouble. For LVZ, I would use the SettingsHandler->updateSetting function to add settings in the [Animation] and [uniqueImage] section as it expects (look in the default config file for animations settings), and then use the Animations module exclusively which will load from the settings you create (treating static images as 1 frame animations, much like I suspect continuum does). One thing I noticed that Animations doesn't support yet is screen coordinates (ScreenObjects). Mapobjects seem doable now though. I don't think you need to mess with Level*. You'll probably want to use Utilities to decompress the .lvz file.
  13. Needed to test other player deaths... easier than doing damage detection!
  14. Goldeye was adamant that the svn should not contain binary files, so I removed the .so files (.dlls) from the svn a while ago. I readded them now, just for you (screw Goldeye!). There will be debug output to the console as I'm actively developing the version in the svn, although it should work just fine. Yes that's correct. It also would build the .dll (.so) and put it in the right place. You can copy one of the other folders if you want an existing project (SelfShip is the one I usually use), just make sure you rename the build artifact from SelfShip to whatever name you want.
  15. He got pretty messed up for getting hit once. Broken nose and two teeth. http://news.bbc.co.uk/2/hi/europe/8411198.stm I'm quite surprised his approval rating is as high as it is (over 50%). He's definitely makes deals with the mob (paying them off to clean up garbage link ), passed a law to give the prime minister immunity from trails because of his tax fraud case (which the supreme court had to overrule), there were the tabloid pictures of the sex party he had a year ago or so, he bought an expensive diamond necklace for a 18 year old on her birthday (he's 73, check out http://www.dailymail.co.uk/news/worldnews/article-1176839/Berlusconi-demands-apology-wife-admits-Our-marriage-over.html lots of great pics of his mistresses), his second wife is in the process of divorcing him, he at one point called for her to apologize for tainting his public image. He owns a significant percentage of the media in Italy, and the rest is state run which he also effectively controls being the prime minister. Still, probably not a good idea to physically attack him.
  16. Bak

    Todo List

    yes. Anti-cheat is done partially server side, and partially peer-to-peer but forwarded through the server, both of which need server-side modifications.
  17. Bak

    Todo List

    Subgame2 can't be supported since I have no way to put in the anti-cheat extensions that I have been working on the last few months. Cheating would be impossible to prevent.
  18. those pics look so fake initially... amazing stuff http://cosmiclog.msnbc.msn.com/archive/2009/12/11/2150063.aspx
  19. 1. Finish unreliable packets server-side security checks 2. Officially release Discretion server package 3. Fix timer sync and client position prediction 4. Linux version (I don't own a mac??) 5. fix server-side checks (didn't commit files ) 6. support for changing arenas / multiple arenas
  20. pretty
  21. virgin interactive entertainment unveils subspace 2?!? Oh wait never mind... cool anyway
  22. I don't believe you. Where did you get this information? Uh.. standard police protocol? You can't shoot unless your life or civilian's life is in immediate danger or if you are shot at.. Your life in danger is different from being shot at first. Choose your words more carefully next time.
  23. I made a simple program to parse the discretion module header files and output relevant structures to help with programming (and added it to the svn). It outputs two types of files, one with all structures and callbacks you may care about (discretionCompleteDoc.txt), and another with just module interfaces and their functions (discretionInterfaceDoc.txt). This should help with development, especially if you're unsure of which interface to go to for the function you care about. I've attached the current version of the files. Let me know if there is anything else that would be useful which I may have omitted. discretionCompleteDoc.txt discretionInterfaceDoc.txt
×
×
  • Create New...