Jump to content


peterc

Member Since 08 Sep 2007
Offline Last Active Aug 14 2010 06:40 AM

Posts I've Made

In Topic: Saving Text Files As Strings?

17 January 2010 - 05:56 AM

first create a script called 'text_to_string' and paste this:
[codebox]_loop = true
_filename = argument0
_contents = ""
_file = file_text_open_read(_filename)

for(_i = 0;_loop = true; _i+=1)
{
if!(file_text_eof(_file))
{
_contents = string(_contents) + file_text_read_string(_file) + string("#")
file_text_readln(_file)
}else
{
_loop = false
}
}

file_text_close(_file)
return _contents[/codebox]

then when ever you want to load a file into a string use this code:
[string] = text_to_string([filename])

**you have to replace the '[***]' with either a variable or filename

In Topic: ' The Legacy Of The Dragonlord ' New Problem

29 October 2009 - 10:46 AM

your attention to detail from inspirational games is astounding. 'Fantacy'?

In Topic: Pause

12 October 2009 - 05:53 AM

like this:
CREATE:
[codebox]shooting=false
shoot_delay=10 //i think 40 is 1 second
alarm[0]=shoot_delay[/codebox]

ALARM[0]:
[codebox]shooting=false[/codebox]

STEP:
[codebox]if(keyboard_check_pressed(vk_space)&&(shooting=false)
{
shooting=true
alarm[0]=shoot_delay
//put the shooting code here
}[/codebox]

In Topic: How Do You Attach Specific Rules To A Room?

12 October 2009 - 05:39 AM

each room has it's own code, you can access this from the room editor and click the code button

In Topic: Mario Style - Pick Up An Objekt

10 October 2009 - 04:48 AM

do this:

- on your mario object make a variable in create event called 'has_shell=false'
- now on the draw event put this code in:
[codebox]//draw the mario sprite
draw_sprite(sprite_index,image_index,x,y)
//draw the shell if it is ment to be there

if(has_shell=true)
{
draw_sprite(sprite_shell,0,x+4,y)
if(keyboard_check_pressed(vk_space))
{
shell=instance_create(x,y,object_shell)
has_shell=false
}
}[/codebox]

note: you'll need to make an object called object_shell which shoots off in a direction aswell as a sprite called sprite_shell with the picture of the shell