Zeige Ergebnis 9.091 bis 9.120 von 10238
Lua Programming Help Thread
This is a discussion on Lua Programming Help Thread within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; How would I implement saving or save states?...
-
08-04-2008, 04:32 PM #9091
How???
How would I implement saving or save states?
My Releases:
---------------------------------------------------
[URL="http://forums.qj.net/showthread.php?t=145654"]ROFLFlasher[/URL]
[URL="http://forums.qj.net/showthread.php?t=144892"]DTS MGS Edition[/URL]
[URL="http://forums.qj.net/showthread.php?t=143735"]Arkanoid Deluxe Beta[/URL]
[URL="http://forums.qj.net/showthread.php?p=2144700#post2144700"]SAVIOR![/URL]
-
08-04-2008, 04:36 PM #9092QJ Gamer Blue
- Registriert seit
- Jan 2007
- Ort
- U.S.
- Beiträge
- 405
- Points
- 7.014
- Level
- 55
- Downloads
- 0
- Uploads
- 0
Well it depends what type of game you're creating. If it's a simple puzzle game with multiple levels, for example, you could just create a text or lua file that says what level the player is on. To save it, update the file; to load it, read or dofile the file. If there is more complexity than that, you could have other variables saved in the file, such as money/gold, items, etc. It would help if you told us what type of game you are trying to implement saving for.
-
08-04-2008, 04:45 PM #9093QJ Gamer Green
- Registriert seit
- Jan 2008
- Beiträge
- 612
- Points
- 3.721
- Level
- 38
- Downloads
- 0
- Uploads
- 0
Take note of this, andy.
Geändert von TurtlesPwn (08-04-2008 um 04:57 PM Uhr)
-
08-04-2008, 04:56 PM #9094QJ Gamer Blue
- Registriert seit
- Jan 2007
- Ort
- U.S.
- Beiträge
- 405
- Points
- 7.014
- Level
- 55
- Downloads
- 0
- Uploads
- 0
Fair enough, but if someone asks for help they shouldn't assume that everyone knows what kind of game they are making. And I also see that in his signature, but it would've been nice if he had specified. It's all good though.
-
08-04-2008, 05:02 PM #9095
My Releases:
---------------------------------------------------
[URL="http://forums.qj.net/showthread.php?t=145654"]ROFLFlasher[/URL]
[URL="http://forums.qj.net/showthread.php?t=144892"]DTS MGS Edition[/URL]
[URL="http://forums.qj.net/showthread.php?t=143735"]Arkanoid Deluxe Beta[/URL]
[URL="http://forums.qj.net/showthread.php?p=2144700#post2144700"]SAVIOR![/URL]
-
08-04-2008, 05:46 PM #9096QJ Gamer Blue
- Registriert seit
- Apr 2008
- Beiträge
- 497
- Points
- 4.268
- Level
- 41
- Downloads
- 0
- Uploads
- 0
umm ok, if you mean for like saving when someone leaves the game and then 2 days later picks it up again and starts the game, then you are going to want .cfg file which is basically a txt file that saves the players.x and .y and current map that it is on, or if it's on a tilemap then just it's position. If you are wanting to just save position when you like pause or something, then you need a state system, I have a tut for state system if you want, and I know of an example of .cfg files if you want that to, just let me know.
-
08-04-2008, 05:55 PM #9097
My Releases:
---------------------------------------------------
[URL="http://forums.qj.net/showthread.php?t=145654"]ROFLFlasher[/URL]
[URL="http://forums.qj.net/showthread.php?t=144892"]DTS MGS Edition[/URL]
[URL="http://forums.qj.net/showthread.php?t=143735"]Arkanoid Deluxe Beta[/URL]
[URL="http://forums.qj.net/showthread.php?p=2144700#post2144700"]SAVIOR![/URL]
-
08-04-2008, 06:01 PM #9098QJ Gamer Blue
- Registriert seit
- Apr 2008
- Beiträge
- 497
- Points
- 4.268
- Level
- 41
- Downloads
- 0
- Uploads
- 0
umm yeah like gamestates :) you should be able to make your entire game into one while true do loop oo and the link is down, but basically it jus i/o functyions
-
08-04-2008, 06:04 PM #9099My Releases:
---------------------------------------------------
[URL="http://forums.qj.net/showthread.php?t=145654"]ROFLFlasher[/URL]
[URL="http://forums.qj.net/showthread.php?t=144892"]DTS MGS Edition[/URL]
[URL="http://forums.qj.net/showthread.php?t=143735"]Arkanoid Deluxe Beta[/URL]
[URL="http://forums.qj.net/showthread.php?p=2144700#post2144700"]SAVIOR![/URL]
-
08-04-2008, 06:41 PM #9100QJ Gamer Blue
- Registriert seit
- Jan 2007
- Ort
- U.S.
- Beiträge
- 405
- Points
- 7.014
- Level
- 55
- Downloads
- 0
- Uploads
- 0
-
08-04-2008, 06:46 PM #9101
Geändert von xXChromeXx (08-05-2008 um 06:55 AM Uhr) Grund: Automerged Doublepost
My Releases:
---------------------------------------------------
[URL="http://forums.qj.net/showthread.php?t=145654"]ROFLFlasher[/URL]
[URL="http://forums.qj.net/showthread.php?t=144892"]DTS MGS Edition[/URL]
[URL="http://forums.qj.net/showthread.php?t=143735"]Arkanoid Deluxe Beta[/URL]
[URL="http://forums.qj.net/showthread.php?p=2144700#post2144700"]SAVIOR![/URL]
-
08-05-2008, 11:47 AM #9102QJ Gamer Blue
- Registriert seit
- Apr 2008
- Beiträge
- 497
- Points
- 4.268
- Level
- 41
- Downloads
- 0
- Uploads
- 0
umm I think, also isn't there a pad:hold() ?? what is that for??
-
08-05-2008, 11:51 AM #9103QJ Gamer Green
- Registriert seit
- Jan 2008
- Beiträge
- 612
- Points
- 3.721
- Level
- 38
- Downloads
- 0
- Uploads
- 0
Use a little bit of common sense and/or googling and take a guess.
-
08-05-2008, 11:51 AM #9104Raining
- Registriert seit
- Jun 2005
- Ort
- In The Fog...
- Beiträge
- 545
- Points
- 7.355
- Level
- 57
- My Mood
-
- Downloads
- 0
- Uploads
- 0
It depends on what LuaPlayer you are using right? Or do all LuaPlayers let you use the Home, Note, etc. buttons?
Also, again, what is the best way to make a rolling credits ending? Would it be to just write each line of text with y-coordinates that are off the screen and just do something like "y = y + 2?" And is there anyway to do simple effects like fadeouts from one image to another by coding them or are these not possible?
-
08-05-2008, 11:51 AM #9105QJ Gamer Platinum
- Registriert seit
- Feb 2006
- Ort
- National Front Disco
- Beiträge
- 13.057
- Points
- 66.627
- Level
- 100
- Downloads
- 0
- Uploads
- 0
-
08-05-2008, 11:53 AM #9106QJ Gamer Blue
- Registriert seit
- Apr 2008
- Beiträge
- 497
- Points
- 4.268
- Level
- 41
- Downloads
- 0
- Uploads
- 0
lol, sry I didn't think of that I was thinking of buttons them self, my bad sry
-
08-05-2008, 12:00 PM #9107Lua guy
- Registriert seit
- Jan 2008
- Ort
- Wales, cardiff
- Beiträge
- 1.442
- Points
- 11.690
- Level
- 71
- My Mood
-
- Downloads
- 0
- Uploads
- 0
I've never used pad:hold() i don't think that any game has used it. Its like the least used controls EVER!!
I just don't think that it would be practical in a game. lol
-
08-05-2008, 12:10 PM #9108QJ Gamer Blue
- Registriert seit
- Apr 2008
- Beiträge
- 497
- Points
- 4.268
- Level
- 41
- Downloads
- 0
- Uploads
- 0
it's used in some apps, I think
-
08-05-2008, 12:42 PM #9109QJ Gamer Green
- Registriert seit
- Jan 2008
- Beiträge
- 612
- Points
- 3.721
- Level
- 38
- Downloads
- 0
- Uploads
- 0
Actually it would be quite practical. If the user accidentally bumps the hold switch, you can make the game pause so they don't die.
-
08-05-2008, 01:24 PM #9110Raining
- Registriert seit
- Jun 2005
- Ort
- In The Fog...
- Beiträge
- 545
- Points
- 7.355
- Level
- 57
- My Mood
-
- Downloads
- 0
- Uploads
- 0
Wipeout Pure puts the game on pause when you flick the hold switch. I actually like that feature.
-
08-05-2008, 02:31 PM #9111
How would I save the number produced by the math.random function?
My Releases:
---------------------------------------------------
[URL="http://forums.qj.net/showthread.php?t=145654"]ROFLFlasher[/URL]
[URL="http://forums.qj.net/showthread.php?t=144892"]DTS MGS Edition[/URL]
[URL="http://forums.qj.net/showthread.php?t=143735"]Arkanoid Deluxe Beta[/URL]
[URL="http://forums.qj.net/showthread.php?p=2144700#post2144700"]SAVIOR![/URL]
-
08-05-2008, 02:45 PM #9112Raining
- Registriert seit
- Jun 2005
- Ort
- In The Fog...
- Beiträge
- 545
- Points
- 7.355
- Level
- 57
- My Mood
-
- Downloads
- 0
- Uploads
- 0
I don't know exactly what you want to do but you could write it to a text file. That would 'save' it.
-
08-05-2008, 02:52 PM #9113
My Releases:
---------------------------------------------------
[URL="http://forums.qj.net/showthread.php?t=145654"]ROFLFlasher[/URL]
[URL="http://forums.qj.net/showthread.php?t=144892"]DTS MGS Edition[/URL]
[URL="http://forums.qj.net/showthread.php?t=143735"]Arkanoid Deluxe Beta[/URL]
[URL="http://forums.qj.net/showthread.php?p=2144700#post2144700"]SAVIOR![/URL]
-
08-05-2008, 02:56 PM #9114QJ Gamer Green
- Registriert seit
- Jan 2008
- Beiträge
- 612
- Points
- 3.721
- Level
- 38
- Downloads
- 0
- Uploads
- 0
Wow. Wow. Wow.
Code:theRandomNumber = math.random(1,10)
-
08-05-2008, 03:03 PM #9115My Releases:
---------------------------------------------------
[URL="http://forums.qj.net/showthread.php?t=145654"]ROFLFlasher[/URL]
[URL="http://forums.qj.net/showthread.php?t=144892"]DTS MGS Edition[/URL]
[URL="http://forums.qj.net/showthread.php?t=143735"]Arkanoid Deluxe Beta[/URL]
[URL="http://forums.qj.net/showthread.php?p=2144700#post2144700"]SAVIOR![/URL]
-
08-05-2008, 03:05 PM #9116QJ Gamer Green
- Registriert seit
- Jan 2008
- Beiträge
- 612
- Points
- 3.721
- Level
- 38
- Downloads
- 0
- Uploads
- 0
Obviously you keep changing it. You need to not keep setting it to math.random, that will keep changing it. Set it once and leave it.
-
08-05-2008, 03:07 PM #9117My Releases:
---------------------------------------------------
[URL="http://forums.qj.net/showthread.php?t=145654"]ROFLFlasher[/URL]
[URL="http://forums.qj.net/showthread.php?t=144892"]DTS MGS Edition[/URL]
[URL="http://forums.qj.net/showthread.php?t=143735"]Arkanoid Deluxe Beta[/URL]
[URL="http://forums.qj.net/showthread.php?p=2144700#post2144700"]SAVIOR![/URL]
-
08-05-2008, 03:09 PM #9118I'm Baaaack!

- Registriert seit
- May 2006
- Ort
- Nowhere
- Beiträge
- 2.186
- Points
- 17.067
- Level
- 83
- Downloads
- 0
- Uploads
- 0
xXChromeXx, you're put the line inside your loop. Don't do that. Then, every time the loop repeats, it'll change the number. (Which should be about 60 times per second. Just put it before your loop, and you'll be all good.

-
08-06-2008, 05:41 AM #9119
How does Lua handle Zip files?
Can it extract or put stuff in them?My Releases:
---------------------------------------------------
[URL="http://forums.qj.net/showthread.php?t=145654"]ROFLFlasher[/URL]
[URL="http://forums.qj.net/showthread.php?t=144892"]DTS MGS Edition[/URL]
[URL="http://forums.qj.net/showthread.php?t=143735"]Arkanoid Deluxe Beta[/URL]
[URL="http://forums.qj.net/showthread.php?p=2144700#post2144700"]SAVIOR![/URL]
-
08-06-2008, 07:05 AM #9120lol

- Registriert seit
- Aug 2006
- Ort
- Whittier, CA
- Beiträge
- 5.791
- Points
- 20.859
- Level
- 91
- Downloads
- 0
- Uploads
- 0
I don't think and LuaPlayer supports ZIP files.
I could be wrong so you can google.


LinkBack URL
About LinkBacks
Mit Zitat antworten

Hello everyone I am new here and I am glad to be part of this amazing community and I think there...
New to forum