Jump to content

erichdusk

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by erichdusk

  1. Ok, I have the timer work, but there's another issue. How do I make the argument in dxdrawimage to render a single random frame at a time? SetTimer's working fine, but since the dxDrawImage still cycles through random frames as fast as it can retrieve them, it ends up creating a feedback loop. local screenWidth,screenHeight = guiGetScreenSize() local imgDims = guiGetScreenSize() local frame = {} frame[1] = "images/noise_1.png" frame[2] = "images/noise_2.png" frame[3] = "images/noise_3.png" frame[4] = "images/noise_4.png" frame[5] = "images/noise_5.png" frame[6] = "images/noise_6.png" frame[7] = "images/noise_7.png" frame[8] = "images/noise_8.png" frame[9] = "images/noise_9.png" frame[10] = "images/noise_10.png" frame[11] = "images/noise_11.png" frame[12] = "images/noise_12.png" frame[13] = "images/noise_13.png" frame[14] = "images/noise_14.png" frame[15] = "images/noise_15.png" frame[16] = "images/noise_16.png" frame[17] = "images/noise_17.png" frame[18] = "images/noise_18.png" frame[19] = "images/noise_19.png" frame[20] = "images/noise_20.png" frame[20] = "images/noise_21.png" frame[20] = "images/noise_22.png" frame[20] = "images/noise_23.png" frame[20] = "images/noise_24.png" frame[20] = "images/noise_25.png" frame[20] = "images/noise_26.png" frame[20] = "images/noise_27.png" frame[20] = "images/noise_28.png" frame[20] = "images/noise_29.png" frame[20] = "images/noise_30.png" function randomframe() dxDrawImage(0, 0, screenWidth, screenHeight, frame[math.random(#frame)], 0, 200, 200, tocolor (200, 200, 200, 5)) setTimer(randomframe,5000,0) end addEventHandler("onClientRender",rootElement, randomframe)
  2. Something like this? I tried this, alternately using the setTimer as the first argument, but neither seemed to work. I'm probably missing something though, I'm pretty new to scripting. function randomframe() dxDrawImage(0, 0, screenWidth, screenHeight, frame[math.random(#frame)], 0, 190, 190, tocolor (200, 200, 200, 5)) setTimer(function()randFrame=math.random(#frame)end,5000,0) --i set it change each 5sec end addEventHandler("onClientRender",rootElement, randomframe)
  3. That is, for a loaded image to key out on white. I've made this script (below), and it does the basic idea, but it's not quite what I want. I have an alternative script based on the blood resource that does key out, but it uses specific imgDims and I don't know how to express "all" in LUA. Also, that one's a real hog at the moment. One other question. How would I rewrite the dxDrawImage line to render a single random frame at a time, using setTimer to render the next frame? Thanks everyone. (BTW, I know the 0,0,0, line isn't necessary, but I couldn't figure out how to exclude it without the alpha turning into the address line.) ________________________________________________________________________________________________________ local rootElement = getRootElement() local screenWidth,screenHeight = guiGetScreenSize() local frame = {} frame[1] = "images/noise_1.png" frame[2] = "images/noise_2.png" frame[3] = "images/noise_3.png" frame[4] = "images/noise_4.png" frame[5] = "images/noise_5.png" frame[6] = "images/noise_6.png" frame[7] = "images/noise_7.png" frame[8] = "images/noise_8.png" frame[9] = "images/noise_9.png" frame[10] = "images/noise_10.png" frame[11] = "images/noise_11.png" frame[12] = "images/noise_12.png" frame[13] = "images/noise_13.png" frame[14] = "images/noise_14.png" frame[15] = "images/noise_15.png" frame[16] = "images/noise_16.png" frame[17] = "images/noise_17.png" frame[18] = "images/noise_18.png" frame[19] = "images/noise_19.png" frame[20] = "images/noise_20.png" frame[20] = "images/noise_21.png" frame[20] = "images/noise_22.png" frame[20] = "images/noise_23.png" frame[20] = "images/noise_24.png" frame[20] = "images/noise_25.png" frame[20] = "images/noise_26.png" frame[20] = "images/noise_27.png" frame[20] = "images/noise_28.png" frame[20] = "images/noise_29.png" frame[20] = "images/noise_30.png" function randomframe() dxDrawImage(0, 0, screenWidth, screenHeight, frame[math.random(#frame)], 0, 0, 0, tocolor (200, 200, 200, 5)) end addEventHandler("onClientRender",rootElement, randomframe)
  4. Preferably no, but that's been the problem. Using the default resource directories, I can start resources manually from the command console, but only during the editor test. Once I exit and restart the test, the console shows the resources as having started, but there's nothing there. The only way to get them to load with the map itself is to merge them with the freeroam resource. I'm having another, possibly related problem with hosting a game. When I start the game using only default resources+freeroam, zombies, and the saved map, I get two errors that crash the game. The first is a sort of generic error. Something about the admin resource being stuck in an infinite loop (no lua code specified) The second is more specific, and I don't understand it. Error: Couldn't find html info.htm for resource freeroam Couldn't find resource freeroam: check if it exists. (It totally does)
  5. For one, it doesn't test or function unless I overwrite it with an older version. Otherwise, all tests revert to a "play" mode that has nothing to do with my map, even if the "play" gamemode and definition is removed. When I do use the older version, the editor test fails to spawn any elements about 3/4 of the time, and /upgrade does nothing unless executed during the editor test. During all of this, the console shows no errors. I've been trying to use the "zombies" resource in freeroam, and I can, but it only works in the most convoluted way possible. I have to drop all of the zombie files into the freeroam folder and merge the metas (but adding the zombie section to the freeroam meta kills the resource, regardless of how it's inserted). I also have to leave the zombies resource separate and maintain identical zombie server.lua files in both directories. It only works with freeroam (copying to saved map folders, or any other gamemode resource folder does nothing) If I attempt to remove either directory or local meta, they don't spawn. This happens with every resource I've attempted to use. I get definitions, confirmation of loaded resources, no errors, and no resources. Anyone know what's going on here? I've reinstalled MTA SA about thirty times now, each time attempting work from a clean, updated version, and it's the same result every time.
×
×
  • Create New...