- Joined
- May 1, 2014
- Messages
- 17
- Reaction score
- 1
- First Language
- English
- Primarily Uses
Hi, I've been tinkering with MGC's First Person Labyrinth Explorer script for a while. While I'm making (or trying to make) a "main" project with FPLE2 for XP, I'm using Ace's version for other things. My question is regarding the Ace version, specifically the position of events. MGC defined their visibility through a dy and dx set of values. Specifically, this is the relevant part in the code (line 728 if anyone uses the script):
#--------------------------------------------------------------------------
# * Vérifie la visibilité d'une surface liée à un évènement et l'ajoute
# à la liste des surfaces à afficher le cas échéant
# param surface : FPLE::Surface_Characters
# param dy : Integer
# param dx : Integer
# param surfaces_temp : Array<Array<integer>>
# param i : Integer
# param dir : Integer
#--------------------------------------------------------------------------
def add_character_surfaces(surface, dy, dx, surfaces_temp, i, dir)
return unless surface.character && surface.character.fple_type # [1.3]
j = i << 7
if dy.between?(128, j) && dx.between?(-j, j)
# the surface is visible
surface.set_relative_attributes(dir)
# adjustements depending on the surface type
if surface.type == 1
if surface.d_align == 0
dy -= 64
elsif surface.d_align == 2
dy += 64
else
end
elsif surface.type == 2
if surface.d_align == 0
dx -= 64
elsif surface.d_align == 2
dx += 64
end
end
# add the surface to the list
surfaces_temp.push([0, dy, dx, 5, 0, 0,
surface.bitmap.__id__, surface.type,
surface.v_align, surface.character.fple_stretch,
surface.opacity, surface.blend_type,
surface.fit, surface.zoom, surface.mirror]) # [1.5]
surface.displayed = true
end
end
Now, I know the 64 defines the relative position of the event alignment, but these are global. I've tried calling the first function ($add_character_surfaces), and using what I think are the arguments, but Ace always tells me I'm using an excess of arguments (4 or 5 instead of 0). What I'd like to do is call this function individually for an event, so that it wouldn't affect global positioning but would allow me to specify a different value (ie., 12, 35, 88, etc) instead of the fixed range. This would enable me to simulate non orthodox geometry (non orthodox as per what the script allows, such a longer wall corner or a rectangular prism).
Does anyone know if and how this can be made? Thanks in advance
#--------------------------------------------------------------------------
# * Vérifie la visibilité d'une surface liée à un évènement et l'ajoute
# à la liste des surfaces à afficher le cas échéant
# param surface : FPLE::Surface_Characters
# param dy : Integer
# param dx : Integer
# param surfaces_temp : Array<Array<integer>>
# param i : Integer
# param dir : Integer
#--------------------------------------------------------------------------
def add_character_surfaces(surface, dy, dx, surfaces_temp, i, dir)
return unless surface.character && surface.character.fple_type # [1.3]
j = i << 7
if dy.between?(128, j) && dx.between?(-j, j)
# the surface is visible
surface.set_relative_attributes(dir)
# adjustements depending on the surface type
if surface.type == 1
if surface.d_align == 0
dy -= 64
elsif surface.d_align == 2
dy += 64
else
end
elsif surface.type == 2
if surface.d_align == 0
dx -= 64
elsif surface.d_align == 2
dx += 64
end
end
# add the surface to the list
surfaces_temp.push([0, dy, dx, 5, 0, 0,
surface.bitmap.__id__, surface.type,
surface.v_align, surface.character.fple_stretch,
surface.opacity, surface.blend_type,
surface.fit, surface.zoom, surface.mirror]) # [1.5]
surface.displayed = true
end
end
Now, I know the 64 defines the relative position of the event alignment, but these are global. I've tried calling the first function ($add_character_surfaces), and using what I think are the arguments, but Ace always tells me I'm using an excess of arguments (4 or 5 instead of 0). What I'd like to do is call this function individually for an event, so that it wouldn't affect global positioning but would allow me to specify a different value (ie., 12, 35, 88, etc) instead of the fixed range. This would enable me to simulate non orthodox geometry (non orthodox as per what the script allows, such a longer wall corner or a rectangular prism).
Does anyone know if and how this can be made? Thanks in advance
Last edited by a moderator:
