Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: [Request / Listing] I need some easy help...  (Read 3116 times)

0 Members and 1 Guest are viewing this topic.

dodgefreak

[Request / Listing] I need some easy help...
« on: April 08, 2006, 08:52:08 pm »
For the game I'm making, Zelda Universe, I need some coding.

First, How do I make Link enter a house?

How do I make NPCs walk around randomly, like Animal Crossing characters?

I need step by step instructions, and I'm using GameMaker 6.

Thanks in advance.
« Last Edit: February 08, 2012, 10:04:49 am by Niek »
Logged
Re: I need some easy help...
« Reply #1 on: April 08, 2006, 09:55:31 pm »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 262
Going to different rooms/go inside houses

You could make an object called obj_gotoroom.
As you need step by step instructions I guess you wish the easiest way. So best is to make a new object for each room you wish to go to.
In that object make a collision event with obj_link with the following code.(adapt with the correct names to get it working)

Code: [Select]
global.createplayerx=xpostition of where you wish link to appear in the room (in numbers)
global.createplayery=yposition of where you wish link to appear in the room (in numbers)
room_goto(roomname)

In the create event of the room where you wish to go( in this case the house)

Code: [Select]
Instance_create(global.createplayerx,global.createplayery,obj_link)
Logged
Re: I need some easy help...
« Reply #2 on: April 08, 2006, 10:03:44 pm »
  • The Broken King
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1259
Assuming this is in GM, you can do the movement with alarms. Set the alarm to a random time, then when it executes, generate a random number from 0-3 (or 1-4 if that's easier for you). Make each possibility a direction (0 is up, 1 is right, 2 is down, 3 is left, for example). Make the NPC move in that direction, and set a second alarm to make the NPC stop. When the second alarm goes off, stop the NPC, and reset the first alarm.
Logged
  • Broken Kings [Temp Site]

Piers

Re: I need some easy help...
« Reply #3 on: April 08, 2006, 10:17:19 pm »
Or (Expanding on TRW post) you could put in (If you want the enemy to move in any direction)

direction = random(360)
« Last Edit: April 08, 2006, 10:44:30 pm by Piers »
Logged
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.158 seconds with 42 queries.