Though I have searched and found similar topics, I cannot understand how to implement Near's View Range like the old non-SDK view range script.
Here is the script:
Can someone please demonstrate how to implement the following features that I used to use, based on the knowledge I understand scripting 0%.
1 The Sound Range
What do I need to put into the event box to have various sound effects play dependant on what event you are near to i.e river, fire, waterfall. So when you are standing near none of them, no SFX plays, and when you approach them, depending on the range you have set the SFX for it gets louder and louder.
2 The Sight Range
I need to implement it where a sentry is on patrol, and if he sees you within the range you have set, a self switch is triggered and he approaches/game over etc. This should only be within a semi circle in front of him [so you can sneak past behind him].
Many thanks to anyone who helps, but I really need a demonstration on what to write in the call script, could you please demonstrate it as if it was in an event box.
Here is the script:
Code:
#==============================================================================
# â– View Range Module
#==============================================================================
# Near Fantastica
# Version 4
# 29.11.05
#==============================================================================
#--------------------------------------------------------------------------
# * SDK Log Script
#--------------------------------------------------------------------------
SDK.log("View Range", "Near Fantastica", 4, "29.11.05")
#--------------------------------------------------------------------------
# * Begin SDK Enable Test
#--------------------------------------------------------------------------
if SDK.state("View Range") == true
module VR
#----------------------------------------------------------------------------
def VR.in_range?(element, object, range)
x = (element.x - object.x) * (element.x - object.x)
y = (element.y - object.y) * (element.y - object.y)
r = x + y
if r <= (range * range)
return true
else
return false
end
end
#----------------------------------------------------------------------------
def VR.range(element, object)
x = (element.x - object.x) * (element.x - object.x)
y = (element.y - object.y) * (element.y - object.y)
r = x + y
r = Math.sqrt(r)
return r.to_i
end
end
#==============================================================================
class Interpreter
#----------------------------------------------------------------------------
def event
return $game_map.events[@event_id]
end
end
#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end
Can someone please demonstrate how to implement the following features that I used to use, based on the knowledge I understand scripting 0%.
1 The Sound Range
What do I need to put into the event box to have various sound effects play dependant on what event you are near to i.e river, fire, waterfall. So when you are standing near none of them, no SFX plays, and when you approach them, depending on the range you have set the SFX for it gets louder and louder.
2 The Sight Range
I need to implement it where a sentry is on patrol, and if he sees you within the range you have set, a self switch is triggered and he approaches/game over etc. This should only be within a semi circle in front of him [so you can sneak past behind him].
Many thanks to anyone who helps, but I really need a demonstration on what to write in the call script, could you please demonstrate it as if it was in an event box.