The Daily Click ::. Forums ::. Klik Coding Help ::. Need to load from file in a "sequence" and being able to edit the file manually
 

Post Reply  Post Oekaki 
 

Posted By Message

Lelle



Registered
  14/08/2003
Points
  82
15th October, 2009 at 21:04:31 -

I'm working on a little shmup where the enemy ships are supposed to come from the top of the sceen.
What i need is a way to read numbers from a file, where each row is a certain second of the level and each digit after the "=" is an enemy ship type/ship formation, like:

1=0
2=0
3=1
4=0
5=1
6=1
7=2
and so on...

i was thinking of using the "Array Object" but i have no way to edit those files with something like a texeditor.
Is there a (or a billion) solution(s) for my problem?

 
n/a

Sumo148

Super amazing fantastic user

Registered
  26/01/2009
Points
  530

360 OwnerThe Cake is a LieVIP MemberPokemon Ball!I am an April FoolI donated an open source projectSanta Hat
15th October, 2009 at 21:13:04 -

you can use the array. You can also edit the array in-game when you test you application. In the debug box on the top, add the array object to the debugger and you can check/change the values.

When you load the array, you can use the "string parser 2" object and set the delimiter to "=". Then you get the left/right of the string entered in the array to separate the data.

 
n/a

Dr. James MD

Addict

Registered
  08/12/2003
Points
  11941

First GOTW AwardSecond GOTW AwardThird GOTW AwardPicture Me This -Round 26- Winner!
15th October, 2009 at 21:51:48 -

First off I wouldn't recommend using times, use the X position of the frame or something more strict than timers.

 
Image
http://uk.youtube.com/watch?v=j--8iXVv2_U
On the sixth day God created Manchester
"You gotta get that sand out your vaj!" x13
www.bossbaddie.com

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
15th October, 2009 at 22:05:04 -


Originally Posted by Sumo148
You can also edit the array in-game when you test you application. In the debug box on the top, add the array object to the debugger and you can check/change the values..



What you CAN? Woo Hoo!
Never used the debugger ever before, maybe I should.

 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49566

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
15th October, 2009 at 22:33:56 -


Originally Posted by Dr. James
First off I wouldn't recommend using times, use the X position of the frame or something more strict than timers.



That's assuming he's even using scrolling. I used timers in my action slip game because the scrolling was custom made.

 
n/a

nim



Registered
  17/05/2002
Points
  7233
16th October, 2009 at 02:39:20 -


Originally Posted by Lelle
I'm working on a little shmup where the enemy ships are supposed to come from the top of the sceen.
What i need is a way to read numbers from a file, where each row is a certain second of the level and each digit after the "=" is an enemy ship type/ship formation, like:

1=0
2=0
3=1
4=0
5=1
6=1
7=2
and so on...

i was thinking of using the "Array Object" but i have no way to edit those files with something like a texeditor.
Is there a (or a billion) solution(s) for my problem?



Use the ini object. That's the simplest way to do what you want to do.
Next is the Array object, which you can edit in the debugger as Sumo said.

I don't see a real problem with using a timer in this situation. I know counters are good practice but I think computers are capable of counting the length of one second.

 
//

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
16th October, 2009 at 02:44:31 -

I'd just use a plain old list object, personally.
I will make an example, but it could be a bit over-complicated...

 
n/a

Dr. James MD

Addict

Registered
  08/12/2003
Points
  11941

First GOTW AwardSecond GOTW AwardThird GOTW AwardPicture Me This -Round 26- Winner!
16th October, 2009 at 03:04:06 -

Timers might work if it's running at a steady pace (like if you can't speed up or whatever). Although I wouldn't trust them at all, if theres slowdown then the timing will break. They only work if the FPS doesn't change from the original speed it was developed to use.

Where's Biax when we need him .

 
Image
http://uk.youtube.com/watch?v=j--8iXVv2_U
On the sixth day God created Manchester
"You gotta get that sand out your vaj!" x13
www.bossbaddie.com

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
16th October, 2009 at 03:22:48 -

Here's the example I promised:
http://cid-b1e7ee094271bbda.skydrive.live.com/self.aspx/Public/TimedEvents.zip

I made it more complicated than it needed to be, just so the data files are a bit more intuitive.
They're basically just text files where each line represents one event, and has a structure like this:

M'SS"T - ObjectToCreate - PositionCreateObject

(M=minutes, SS=seconds, T=tenths of a second incase you were wondering).



EDIT: I made a simpler version here: http://cid-b1e7ee094271bbda.skydrive.live.com/self.aspx/Public/Simple.zip



Edited by Sketchy

 
n/a
   

Post Reply



 



Advertisement

Worth A Click