PoG: Coding Problem

13 replies [Last post]
Joined: 12/22/2009

I just want to know how do you enlarge monsters by using coding? I was trying to use the advanced level coding and this is what happened:

with (m_bit) {radius=500;} m_emitter.bit_number=1;

Can someone please help me with this?

EVERYTHING AMAZING BY INWOG

inwog, publisher of 407 World of Goo levels since 2009-2015

Joined: 12/11/2009

There's one more thing than radius: Game Maker default parameters image_xscale and image_yscale.
e.g. image_xscale*=2; image_yscale*=2;
(Radius 500 is huge - like a width of screen - you mean 50? Big Pokey has radius=32...)
To apply it to bits you have to put the code to cutom event, because at the beginning there's no bit:
m_emitter.bit_number=1; custom_event="with(m_bit) if(radius<50) {radius=50; image_xscale*=2; image_yscale*=2;}"
You have to experiment what factor for scales is good.

Joined: 12/22/2009

Because I need to enlarge the bit monster like double times the size of a normal bit ball.

EVERYTHING AMAZING BY INWOG

inwog, publisher of 407 World of Goo levels since 2009-2015

Joined: 12/11/2009

I guess radius 28 or 30 would be enough. In general radius is important for m_bomb_d and m_pokey, because they are internaly squares (and radius is used for calculating rotation speed). m_bit is circle, so you can put even too big radius and it won't lead to problems, but scale params are important. m_bit has default image_xscale=0.6;image_yscale=0.6;radius=15;.

Joined: 12/22/2009

Never mind, I scrapped the idea, but thanks for the coding example!

EVERYTHING AMAZING BY INWOG

inwog, publisher of 407 World of Goo levels since 2009-2015

Joined: 12/22/2009

Another thing, how do I separate sounds between objects. For example, I want the Fuse Bonus to have the normal sizzle sound and a Bomb Monster to have a nuke sound.

EVERYTHING AMAZING BY INWOG

inwog, publisher of 407 World of Goo levels since 2009-2015

Joined: 12/11/2009

It cannot be done in any easy way. Ignition sounds are played automaticaly. You can only play additional sounds with "custom event":
m_bomb_s.free=1; custom_event="with(m_bomb_s) if (ignite && free) {sound_play(sd_water); sound_stop(sd_ignite); free=0;}"
If you change sd_water sound (or other not used sound, like sd_bit_death) into nuke sound it should work.

Joined: 12/22/2009

Another thing, can two custom events can be used in a level? For example, I want falling blocks and monster having a can together.

EVERYTHING AMAZING BY INWOG

inwog, publisher of 407 World of Goo levels since 2009-2015

Joined: 12/11/2009

It's same problem like "can two ALCs be used in one level". "custom event" is code executed in every step, so you always can add more instructions.

Joined: 12/22/2009

Please give me an example.

EVERYTHING AMAZING BY INWOG

inwog, publisher of 407 World of Goo levels since 2009-2015

Joined: 12/11/2009

To merge fallin bombs code with bit-balloon write:

with(m_emitter) motor=instance_position(x,y,m_balloon); custom_event = "with(m_emitter) locate(id,motor);if (instance_number(m_bomb_d)<10) instance_create(64+random(room_width-128),-32,m_bomb_d);";

You can use water with any codes using:

execute_file(maindir+"levels\water.alc.txt",200,1,$337733); custon_event+="with(glut} move_wrap(1,0,15);";

Joined: 12/22/2009

Interesting... This is more innovative!

EVERYTHING AMAZING BY INWOG

inwog, publisher of 407 World of Goo levels since 2009-2015

Joined: 12/11/2009

Interesting is vertical wrap with water Smile

Joined: 12/22/2009

That would be weird and more of a supernatural world that the world doesn't exists.

EVERYTHING AMAZING BY INWOG

inwog, publisher of 407 World of Goo levels since 2009-2015