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: [GM 7]Signs Help  (Read 745 times)

0 Members and 1 Guest are viewing this topic.
[GM 7]Signs Help
« on: March 07, 2007, 03:39:36 am »
  • Hookshot to the Future!
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 517
Well i dont remember how to do this bascily if object link is near objsign let him read it :P but it works all over the map.
Code: [Select]
if distance_to_object(objLink)&& x=304 && y=176
{
Say("Testing",true,true,true);
}
theres my code.
Logged
Check my ZRPG development blog at rev2k9blog.spaces.live.com
  • My Blog

mit

Re: [GM 7]Signs Help
« Reply #1 on: March 07, 2007, 03:45:17 pm »
  • QBASIC programmer since age 4. Take that, world.
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 1079
You haven't got an expression or anything for the distance. That is, you're just saying "if the distance to object link" instead of "if the distance to object link is less than...". So if you want it when link is, say, less than 30 pixels away, you'd put:
Code: [Select]
if distance_to_object(objLink)<30  && x=304 && y=176
{
Say("Testing",true,true,true);
}
Logged
Programmer / Spriter / Level designer / Game Director / Web Designer / Music Sequencer for
Random Highscore table:

Play the Kousou Arcade today!
  • Kousou Games
Re: [GM 7]Signs Help
« Reply #2 on: March 07, 2007, 06:32:02 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 2890
Here's a code that will work everywhere:

Code: [Select]
if distance_to_object(objLink)<25 // change the number to how many pixels Link must be within to be able to read the sign
{
Say("Testing",true,true,true);
}

And here's some awesomer code. Make an object called "objSignParent" with this in the Z event (or whatever):

Code: [Select]
if distance_to_object(objLink)<25 // change the number to how many pixels Link must be within to be able to read the sign
{
Say(text_string,true,true,true);
}

And make all your sign objects set to have that as it's parent. And in the create event of all your sign objects:

Code: [Select]
text_string="Testing"
And now whenever you change the execution code, all signs will change to reflect that!
Logged
Re: [GM 7]Signs Help
« Reply #3 on: March 07, 2007, 06:56:02 pm »
  • Hookshot to the Future!
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 517
thats cool and it works thx Mit and CB
Logged
Check my ZRPG development blog at rev2k9blog.spaces.live.com
  • My Blog
Pages: [1]   Go Up

 


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



Page created in 0.054 seconds with 45 queries.

anything