The Daily Click ::. Forums ::. Klik Coding Help ::. Question about creating objects.
 

Post Reply  Post Oekaki 
 

Posted By Message

siven

I EAT ROCKS

Registered
  03/11/2008
Points
  604

Wii OwnerVIP Member
3rd January, 2011 at 04:21:09 -

So ive got a quick question. Is there a way to make an event that basically says
-Upon ObjectA being created
do stuff

Cuz what i wanna do is...
-Upon SniperRifle(Common) Created
Set alterable value cooldown to 5

-every 1 second
subtract 1 from alterable value cooldown

any help would be appreciated. thanks!

 
[Game design makes my brain feel like its gonna explode.]

HorrendousGames

Sourpuss

Registered
  31/10/2009
Points
  481

VIP MemberEvil klikerGame Of The Week Winner
3rd January, 2011 at 06:54:48 -

Any time you create an object, thats when you do your code.

for instance:

--event condition for when object is supposed to be created
----Create object
----Do stuff

This is the rare instance in MMF2 where when you create an object, all other commands in that same event pertaining to that object will effect the instance of that object specifically.

If you're just setting that alterable value to 5, however, it'd be much easier to click on the properties of that object, click the tab for alterable values and change it to five there. If you wanted that number to be a float, however, you'd have to do it in the event editor.

Edited by HorrendousGames

 
/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/
That Really Hot Chick
now on the Xbox Live Marketplace!

http://marketplace.xbox.com/en-US/Product/That-Really-Hot-Chick/66acd000-77fe-1000-9115-d80258550942

http://www.create-games.com/project.asp?view=main&id=2160

siven

I EAT ROCKS

Registered
  03/11/2008
Points
  604

Wii OwnerVIP Member
3rd January, 2011 at 08:09:14 -

The idea is that im attempting to make it so that it cant create 2 of the same type of gun within a certain amount of time, so if the alterable value was greater than 0 prevent the gun from being created, so setting the alterable value from the actual objects settings out of game test wouldnt work. Thanks for the info though, i didnt know that.

 
[Game design makes my brain feel like its gonna explode.]

Mkingy



Registered
  05/07/2003
Points
  4771

Box Blue
3rd January, 2011 at 13:55:05 -

So you want to change the initial alterable values of an object, before it is created?

If this is the case my solution would be to have a separate object with alterable values for each of the weapons which are modified instead.

So for instance when you create a sniper rifle

set the cooldown_sniper to 5 or whatever.

Another solution would be to never actual delete the sniper rifle and just move it off screen when it isn't needed on the playing field. This would mean you retain any alterable values that you set.

 
n/a

siven

I EAT ROCKS

Registered
  03/11/2008
Points
  604

Wii OwnerVIP Member
4th January, 2011 at 00:57:21 -

not quite, i want to set the alterable value directly after the gun is created. the game im working on has a random gun generator similar to borderlands, so theres thousands of combinations of guns, so it wouldnt be as simple as just moving the gun off screen. i want it so that once a type of gun is created, it wont create another one for another say, 5 seconds or whatever.

 
[Game design makes my brain feel like its gonna explode.]

Mark McCauley



Registered
  18/02/2009
Points
  291

Has Donated, Thank You!VIP Member
4th January, 2011 at 11:41:47 -

Use an Object that is always there for instance-Object"(Heads_up_display_1)" or (HUD1) for short

- if valueA( HUD1) =0
and your other condition
then create gunobject ; set valueA (gunobject) to random(12) ;set valueA( HUD1) to 5

- every 1 second
and valueA( HUD1)>0
then subtract 1 from valueA( HUD1)


Thats if Im understanding your question correctly hope it helps.


Edited by Mark McCauley

 
http://www.reddwarf.co.uk/forum/messages.cfm?threadid=44227736-C46F-AC56-02EBA05285818C14

siven

I EAT ROCKS

Registered
  03/11/2008
Points
  604

Wii OwnerVIP Member
4th January, 2011 at 20:32:19 -

yup! thanks, that should work just fine. thanks for all the help guys, i couldnt do this whole "game design" thing without the daily click lol.

 
[Game design makes my brain feel like its gonna explode.]

Mark McCauley



Registered
  18/02/2009
Points
  291

Has Donated, Thank You!VIP Member
5th January, 2011 at 10:35:17 -

A Pleasure me ol china

 
http://www.reddwarf.co.uk/forum/messages.cfm?threadid=44227736-C46F-AC56-02EBA05285818C14
   

Post Reply



 



Advertisement

Worth A Click