The Daily Click ::. Forums ::. Klik Coding Help ::. TGF user having a minor problem.
 

Post Reply  Post Oekaki 
 

Posted By Message

Pontus Lundin



Registered
  31/05/2006
Points
  18
31st May, 2006 at 08:40:34 -

Hello.
I have a problem Im dying to get solved. Im trying to make monsters die. And when I leave the frame and arrive back I want them I killed to be gone. Ive tried many things but I simply dont know how to get it to work?

Another thing. How can I create like objects so I can like save the game?
And when Im already here... Is there any kind of patch or update that will allow me to be able to have as many wav sounds as I want at once. Im a little tired of boring Midi music and Wanna have more real sounds.

Anyway hope i wasnt asking to much?!



 
n/a

lembi2001



Registered
  01/04/2005
Points
  608

VIP MemberIt's-a me, Mario!Wii OwnerI like Aliens!Has Donated, Thank You!PS3 OwnerI am an April Fool
31st May, 2006 at 08:58:09 -

hello pontus

here are the answers to your questions:

q1: you need to make the monster global to the entire game. this is done in the properties of the active object. then set an alterable value. for instance:

Monster has been shot
Set alterable value a to 1
destroy monster

Then put this code in the frame:

Start of level
+Alterable value a of monster = 1
Destroy monster

hope that is clear enough.

Q2: Create an active object that you want to use to save the game then use ini files to save. tutorial can be found on this site but the event editor code is something like this:

Hero is overlapping Save Object
+S key is pressed
Set ini file to.....

Hope that one helps

Q3: You need to enable multiple wav sounds in the game properties.
File --> Game Setup then click multi samples. that should do it. or ypou could always download the dmc2 object from http://www.clickteam.info/extensions/

 
n/a

Pontus Lundin



Registered
  31/05/2006
Points
  18
31st May, 2006 at 09:04:46 -

Oooh I got help fast
Thanks Ill try it out and se if it works.
But I could use value B as well? Im kinda using value A as the monsters life gauge.


 
n/a

Pontus Lundin



Registered
  31/05/2006
Points
  18
31st May, 2006 at 10:03:32 -

This thing with the monster doesnt work. The thing is that I use Value A as life for the monster, and I have several of the same monster.

Tried to:

¤Is Visble
+Monster value A <=0 (Creates a body and destroys as he leavs a dying sound and sets value B to 1)

¤start of level
+monster value B= 0 (set value A to 10)

¤start of level
+monster value B= 1 (make invis and destroy)

I dunno... shouldnt this work?

 
n/a

Deleted User
31st May, 2006 at 11:38:37 -

The method he posted wont work. Alterable values will never be saved across frames, even if they are global objects...

 

Werbad



Registered
  18/09/2002
Points
  235
31st May, 2006 at 12:28:05 -

They did for me when i used TGF...

 
n/a

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
31st May, 2006 at 12:51:45 -

Here's one way of doing it. It won't 'save' the monsters' positions, but it will remember how many monsters you killed, and remove the excessive monsters from the playfield.

*Monster killed:
-Add 1 to global value 1

*Start of level:
-Monster: Spread a value in alterable value A: 0

*Start of level:
*Value A of monster is greater than global value 1
-destroy monster

That should work. Not sure though, haven't tried it.

Image Edited by the Author.

 
n/a

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
31st May, 2006 at 13:00:39 -

There's an array object for TGF, isn't there? That'd do it, but it would take some effort unless you figured out a tricky way to automate it.

 
n/a

Pontus Lundin



Registered
  31/05/2006
Points
  18
31st May, 2006 at 16:51:14 -

Not sure How to find all that. Im not familiar with vaulues and strings at all.
You couldnt be alittle more specific how to obtain all these?
Sorry if im a pain in the ass


"
*Monster killed:
-Add 1 to global value 1

*Start of level:
-Monster: Spread a value in alterable value A: 0

*Start of level:
*Value A of monster is greater than global value 1
-destroy monster
"

 
n/a

Deleted User
31st May, 2006 at 17:09:36 -

Someone give me the link to the array object for TGF, and ill make an example on this. (I just cant find that extension anywhere....)

 

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
31st May, 2006 at 17:12:50 -

The other way would be to spread a value between all the monsters. Then tie this into an INI file and do all your repopulation from loading info off the INI.

INI's work well in TGF for getting by the 3 value per object limit as well.

 
Craps, I'm an old man!

Pontus Lundin



Registered
  31/05/2006
Points
  18
31st May, 2006 at 17:23:43 -

Im not familiar with Ini and stuff like that. Thats the problem.
Isnt there a good helpguide anywere that can help me Understand all these strings and values and stuff like that?



 
n/a

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
31st May, 2006 at 18:33:27 -

Why INI? There are plenty of global data storage extensions for TGF around anyways. I think.

Pontus: Okay, it's not hard at all. Values are similar to counters, they just don't need any objects or anything. In TGF, there are 16 global values. Global values are global to the entire game, ie they won't reset when you jump to another frame. You can find them under the special tool in the event editor.

Alterable values are also like counters. All active objects have three of them; A, B and C. Alterable values are not global however. Actions and conditions for these values can be found under each active object in the event editor.

The spread a value action assigns an unique number in an alterable value of each instance of an object.

Strings are also variables, but they store text, instead of numbers.

What else do you really need to know?

 
n/a

Pontus Lundin



Registered
  31/05/2006
Points
  18
31st May, 2006 at 19:17:35 -

Thanks. Kinda gave me a new perspective of things.

But Might you tell me how to use these in order to killa a bounch of monsters (5)
and when u leave frame and return they will be gone?


 
n/a

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
31st May, 2006 at 22:20:40 -

Agh. Sorry. Here's the code for it:

* Player kills monster
- Add 1 to global value A

* Start of level
- Monster: Spread a value: 0

* Start of level
* Value A of monster is less than global value A
- Destroy monster

So... This is how it works: Each time a monster is killed, it adds 1 to global value A, ie it remembers how many monsters you've killed. Then, at the start of the level, it spreads a value through all monsters, and destroys all monsters with a value less than the kill count.

So, for example, if you have five monsters, and spread value 0 through them like this:

Monster A: 0
Monster B: 1
Monster C: 2
Monster D: 3
Monster E: 4

And if you have killed 3 monsters, it will destroy all monsters with a value less than 3. So monsters A, B and C will be destroyed, and there you have it, two monsters left on the playfield.

This should work, but I can't really test it from where I am now.
I may make an example later.

 
n/a

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
31st May, 2006 at 22:37:24 -

Because, with INI, you can quit the game and come back to where you left off and everything will be the same. Globals clear out when you quit the program. Plus it's much easier to store/retrieve stuff from an INI than a global.

INI
--------------
[Monster1]
Health = 100
Weapon = 1
Smarts = 2

[Monster2]
Health = 75
Weapon = 2
Smarts = 4


Globals
Monster1.health = Global 1
Monster1.weapons = Global 2
Monster1.smarts = Global 3

Monster2.health = Global 4
Monster2.weapon = Global 5
Monster2.smarts = Global 6
=============================
You'd go cross eyed with globals if you had, say, 30 monsters per level. Ini makes it much easier.

 
Craps, I'm an old man!

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
31st May, 2006 at 23:20:50 -

That's a bit overkill. Save monsters' health and everything. In most games all monsters are reset when you quit the game anyway.

But globals can get messy, yes, and they're pretty unpractical when there are only 16 different ones to use. I'd rather go for some sort of array object, if there is one for TGF.

Image Edited by the Author.

 
n/a

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
31st May, 2006 at 23:49:39 -

You completely missed the point.

 
Craps, I'm an old man!

Pontus Lundin



Registered
  31/05/2006
Points
  18
1st June, 2006 at 05:35:35 -

Hmmm... But Im going to use these monsters in several SEVERAL other frames will they be considered as new other objects, or will they be removed as well?

My old system worked out in one way.

I had a counter that was global that said how many monsters that was allowed on the frame. If lets say the counter had the number 5, in the start of the frame there was created 5 monsters. and for each monster I killed the counter was decreased.

Sure it wasnt the most perfect one but it kinda worked except for one minor thing.
sometimes there was like 2 or 3 monsters created at the same time on the same place
and that made the game very unstable.

Example:

#Monster amount counter=1
+Start of level Create Monster in X Y position.
set value A on monster to 10

#Monster amount counter=0
+Start of level Nothing happens

But now I also wanna have abit mor professional look on the game so I need something new. I have big plans for this game so I really need to get this to work.
I simply want to be able to save the games info so that I can quit the game and pick it up later, I also want to be able to kill these monsters and they'll die forever (atleast for this playerscenario)

 
n/a

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
1st June, 2006 at 08:36:04 -

I know what you were trying to say, Shab, but why INI? There are lots of other data storage objects that work as well, but don't create... Annoying INI files?

Besides, INI files can easily be hacked while playing, unless you encrypt them. Is there even a blowfish object for TGF?

But, well. If you want the monsters to be dead "forever", Pontus, then I guess you should be using INI. I wouldn't be bothered, but it's your game.

 
n/a

Pontus Lundin



Registered
  31/05/2006
Points
  18
1st June, 2006 at 08:55:50 -

The frames isnt levels. they are more of rooms. Which the player can enter and exit as many time he/she wants. and if the player has killed a monster the monster should be dead. in that save anyway or atleast until the player decides to exit the game.



 
n/a

Werbad



Registered
  18/09/2002
Points
  235
1st June, 2006 at 19:18:35 -

Dont use ini's if you need to save alot of data often since ini's are SLOW! + you need to encrypt them...

 
n/a
   

Post Reply



 



Advertisement

Worth A Click