The Daily Click ::. Forums ::. Klik Coding Help ::. Help me fix a small bug!
 

Post Reply  Post Oekaki 
 

Posted By Message

Lönnemyr



Registered
  30/06/2008
Points
  69
1st October, 2008 at 20:17:46 -

The new piece of code did work, no complains. I guess TGF is a little behind then. Thank you for all you effort =

 
-

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!
1st October, 2008 at 20:24:12 -

the new piece of code wont do the job though - it's just the same thing but without the abs(), which was there for a reason.

EDIT: This is going to be harder than I thought. It seems clickteam have come a long way since TGF. I think you'd need to download some kind of maths extension to get this method working in TGF
I'll think about it some more...


Image Edited by the Author.

 
n/a

Lönnemyr



Registered
  30/06/2008
Points
  69
1st October, 2008 at 21:10:55 -

I know =/ I`m pretty much back at 0 again then, no battle engine

[EDIT; Thanks, tell me if you find something out, if I use extentions, doesn`t that mean I need to include that in the game somehow for it to work for other people? Meanwhile, how do I set the alternable value outside of the event editor ?]

Image Edited by the Author.

 
-

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!
1st October, 2008 at 22:09:06 -

It looks a lot like you can't set alterable values outside of the event editor - you just have to create an "at start of frame..." event and then set them all that way. I really hadn't realized how primitive TGF was til now

I don't *think* you need to include any extra files with your compiled exe if you use extensions. The exceptions being extensions like DMC that rely on third party dll files. I could be wrong though - as you probably realise by now, I'm not exactly an expert on TGF.

 
n/a

Lönnemyr



Registered
  30/06/2008
Points
  69
1st October, 2008 at 22:38:08 -

" I'm not exactly an expert on TGF. " - Makes two of us

I have played a little with MMF though, so I know how oldschool TGF really is, but unfortunally I don`t have acces to anything better right now so I will have to stick with TGF. I think I will put the battle system on hold for now, maybe Jon Lambert has some good ideas when he gets off on friday. If you get any bright ones Sketchy, shoot! Kaay?


---------------------------
Another question about events though. Should I make all common events global instead of copy this frame to the next (with events) and just remodel it? What would be the most stable. Anyonw know if Global events in TGF is unstable/buggy or will give me som sort of complications later on?

 
-

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!
1st October, 2008 at 22:51:39 -

Here you go - went back to detectors cos I can't get the distance idea to work in TGF. An extension wasn't going to do the job cos of object focus problems - TGF didn't know which Baddy1 I meant.

Anyway, this should at least work...
http://cid-b1e7ee094271bbda.skydrive.live.com/self.aspx/Public/ApurpurtaleNEW.gam

 
n/a

Lönnemyr



Registered
  30/06/2008
Points
  69
2nd October, 2008 at 00:54:49 -

Sketchy

Thanks, seems to work pretty well, didn`t think of using fine detection on one object instead of using two objects. One questions though, why compare two general valuies instead of just using a "start of frame" event?



-----------------

Thing with TGF (especially when you`r not a good klicker) is that when one problem is solved, you find another one. Hehe, My "help me fix a bug!" topic turned into "help me, help me!" topic (seems to happen to my threads =/ ).

Anyway, two more questions, free for anyone to anwser! Knock yourselfs out!

1st question
- Is it recomended to use global events in tgf? Like the event for movement or pushing blocks etc. OR, will this be troublesome later on? Reason I ask is becuse I never use those and I think I`ve read or heard somewhere thata there is some kind of bug involved with global evnets in TGF.

2nd question - For this you`ll have to download the file.. (sorry). I tried to give PurPur a sort of sliding animation when the arrow keys are pressed. It`s easier on the eyes and looks better, even if he`s not doing any actual "walking". I tried to do this as good as I could, but each time he moves a ghost frame blinks in front of him. I looked at the the events and I have no idea what`s causing the problem. I also wanted him to keep moving while an arrow key is pressed down is possible (slowly glide like the animation), but could`t get that to work either. That might not be possible with "snap to grid movement"? Would be great if it was though..





 
-

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!
2nd October, 2008 at 01:41:05 -

The reason for comparing the two values, is that you need the same number of detector objects as you have "Baddy1" objects. All it's doing is creating more detectors until they're equal.

Personally, I've never bothered with Global Events. If it were me though, I'd be building the whole game in one single frame, and loading the level layouts from external files (TGF has the ini object so that's perfectly possible). If you don't want to use Global Events, you can always just copy & paste the event groups relating to movement, pushing etc between frames.

For me, the problem with global events and also behaviours, is that I don't know exactly where the lines fit in.
It's hard to explain, but here's a (really bad) example;

My main code looks like this;

1) always
-> set Car's Alterable Value A to 5

2) always
-> set Car's Direction to Car's Alterable Value A


Now suppose I give the Car a behaviour like this;

1) always
-> set Car's Alterable Value A to 10

What direction does the car end up facing? 5 or 10? Does it always face the same direction? It depends on at what point the behaviour events are run. Like I said, this is a bad example, but with more complex games it could be a problem.


I'll look into the movement thing and get back to you.

One person you could try asking for help is Pixelthief. Without asking, I don't know if he'd want to help or not, but he made a game called GridQuest, which is very similar to what you're attempting, and which was also made in TGF. He certainly knows what he's doing.

http://www.create-games.com/download.asp?id=7169


 
n/a

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!
2nd October, 2008 at 02:41:00 -

Here's new version, with smoother movement;
http://cid-b1e7ee094271bbda.skydrive.live.com/self.aspx/Public/ApurpurtaleFIX.gam


First thing you'll notice, is that it uses "group.traps" a lot. That's because I'm using what are called "qualifiers". You can add a qualifier from object properties. By giving the same qualifier to several different objects, you're telling TGF that they are members of the same group. In this case I arbitrarily chose "traps" to represent a group containing all the different types of object that block PurPur's movement.

One of the limitations of backgrounds, is that they can't be assigned qualifiers. For this reason, any background objects which block PurPur's movement were set to "obstacle".


So, the first 4 events all do basically the same thing, but for different directions. To start with, they check there are no obstacles blocking PurPur's path. They then check that PurPur isn't already moving. If flag 0 = on, PurPur is moving horizontally; if flag 1 is on, PurPur is moving vertically.

The counter I added, keeps track of how many pixels PurPur has left to move before stopping and checking for player input again. If the counter is <0, PurPur is moving up/left. If the counter is >0, PurPur is moving down/right. It might be the other way around, I don't remember, but you should be able to figure it out

Hope it helps

Image Edited by the Author.

 
n/a

Lönnemyr



Registered
  30/06/2008
Points
  69
2nd October, 2008 at 16:12:36 -

Hm, If I have an event that says "purpur can`t pass background obstacles" then There is no need for my "forbidden zones" right?

Some of the changes seems to have made the events for pushing blocks and pusching blocks on top of red arrowblocks corrupt though, I´ll see if I can figure it out on my own. If I can`t I`ll be back

 
-

Lönnemyr



Registered
  30/06/2008
Points
  69
2nd October, 2008 at 18:34:14 -

Finally got the new movement to work, I had som problems untill I found out that I needed to set the counters minumum value to -50 PurPur`s movement speed (the numer which is added or subtracted from the counter) must be something that can be diveded with 50? So 2, 5, 10 and 25 is possible?

Still got a few Q:s though. PurPur is moving when the arrow keys is pressed, BUT, for some reason you can`t hold in the arrow keys to get him to continue to move, you need to press, press and press again to make him take 3 steps. I noticed that you solved that in you FIX gam, and even though I did exactly like you said, in my gam he doesn`t. I`ve added the "repeat while " XYX " is pressed" condition to all four events

I have updated the download if you need to look in the event editor to see whats wrong (even though I looked there like 10 times already.. so unless I am going blind could it be something else?)

http://lonnemyr.googlepages.com/home

 
-

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!
2nd October, 2008 at 19:57:28 -

It's because you added the bit for joystick support.

All you need to do is replace all your "read joystick state" conditions with "repeat while joystick is pressed".

Oh, and since you're using the those conditions, you really need to delete all the "repeat while key is pressed" conditions - otherwise it'll stop working if the player changes the control keys by pressing ctrl+y.

Again, here's one I made earlier;

http://cid-b1e7ee094271bbda.skydrive.live.com/self.aspx/Public/Apurpurtalebackupsave3.gam

Image Edited by the Author.

 
n/a

Lönnemyr



Registered
  30/06/2008
Points
  69
2nd October, 2008 at 20:30:53 -

Hm, I see, didn`t notice you removed those, I guess I`m blind

Anyway, if I delete those conditons, how am I supposed to get the game to ignore player control when PurPur steps on the yellow arrow blocks? =/

 
-

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!
2nd October, 2008 at 21:22:27 -

In reply to an earlier question - yes, it would be good to get rid of the "forbidden zones".

Now, for the movement problem;

Took me a little while to understand what you meant, the arrows look green to me

Anyway, what I'm doing is this;

* This first thibng I did, is completely optional - try with and without and see which effect you prefer. I made the arrow facing opposite the direction of movement to be an obstacle. In other words, PurPur can't move right if there's a left arrow blocking his path. Check the movement events to see what I mean. PurPur is able to walk onto an arrow from any other direction though (is that what you want?).

* Secondly, I'm checking if the X and Y of PurPur and the Arrow he's standing on (hence the "purpur is overlapping arrow" test) are the same. If so, I just change the flags and counters automatically, as if the player has chosen to move in the direction of the arrow.

http://cid-b1e7ee094271bbda.skydrive.live.com/self.aspx/Public/Apurpurtalebackupsave3x.gam

Image Edited by the Author.

 
n/a

Lönnemyr



Registered
  30/06/2008
Points
  69
2nd October, 2008 at 23:37:19 -

Oh! thats exactly how I wanted it, not being able to go against the arrows but all other directions are ok. Phew, now when this is solved I need to find something new to nag about, guess I take som time to update the grapics while I think up something new to add.

When (if) this game is finished, I can put your name in the credits if you like, since you`ve help me so much with the engine I feel like it should be there.

Btw, is that a Swedish flag in your sig?


[EDIT; updated the gam file again so it`s up to date with all changes I made in the event editor if anyone downloads it.. some new grapic also (but that is kind of irrelevant to this topic though) - http://lonnemyr.googlepages.com/home]

Image Edited by the Author.

 
-
   

Post Reply



 



Advertisement

Worth A Click