Avangs

  • 게임 정보
    • 게임 소개
    • 게임 리뷰
    • 게임 실황
    • 게임 공략
    • 모바일 테스트
  • 게임 작품new
    • 완성작 게임new
    • 체험판 게임
    • 한글판 게임
    • 온라인 게임
    • 추천작 제작자 저장소
  • 투표선정 작품
    • 아방스 추천작
    • 완성 기대작
    • 투표 신청
    • 투표소
    • 투표 결과
  • 강좌new
    • 아방스 칼럼
    • 비주얼노벨 강좌
    • 알만툴 강좌
      • MZ 강좌
      • MV 강좌
      • VX Ace 강좌
      • VX 강좌
      • XP 강좌
      • 2003 강좌
      • 2000 강좌
    • 게임메이커 강좌
    • 울프툴 강좌
    • 3D 게임제작 강좌
    • 2D 게임제작 강좌
    • 그래픽 제작 강좌
    • 기타 강좌
  • 질문과 답변new
    • 자주 묻는 질문new
    • 질문과 답변new
    • 제작의뢰
  • 커뮤니티new
    • 구인·구직·외주
    • 테스트 요청
    • 자유게시판new
    • 게임계 소식
    • 유머&정보
    • 사이트링크
    • 이벤트&대회
  • 창작
    • 게임 기획
    • 맵배치
    • 글쓰기
    • 그리기
    • 음악
  • 자료실
    • 게임제작툴
    • 예제 및 샘플
    • 그래픽 소재
      • 오리지널 소재
      • 이차창작 소재
      • 수정·개조 소재
      • 외부 소재
    • 사운드 소재
    • 확장·플러그인·스크립트
      • MZ 플러그인
      • MV 플러그인
      • Ace 스크립트
      • VX 스크립트
      • XP 스크립트
      • 2k3 플러그인
      • VN 플러그인·확장
    • 외부 소재사이트
    • 기타 자료
      • 한글화툴
      • 무료 폰트
      • 유틸리티
    • 디자인 참고자료
  • 고객센터new
    • 공지사항new
    • 건의 및 신고
    • 핫 이슈
로그인 회원가입
Avangs
  • 게임 정보
    • 게임 소개
    • 게임 리뷰
    • 게임 실황
    • 게임 공략
    • 모바일 테스트
  • 게임 작품new
    • 완성작 게임new
    • 체험판 게임
    • 한글판 게임
    • 온라인 게임
    • 추천작 제작자 저장소
  • 투표선정 작품
    • 아방스 추천작
    • 완성 기대작
    • 투표 신청
    • 투표소
    • 투표 결과
  • 강좌new
    • 아방스 칼럼
    • 비주얼노벨 강좌
    • 알만툴 강좌
      • MZ 강좌
      • MV 강좌
      • VX Ace 강좌
      • VX 강좌
      • XP 강좌
      • 2003 강좌
      • 2000 강좌
    • 게임메이커 강좌
    • 울프툴 강좌
    • 3D 게임제작 강좌
    • 2D 게임제작 강좌
    • 그래픽 제작 강좌
    • 기타 강좌
  • 질문과 답변new
    • 자주 묻는 질문new
    • 질문과 답변new
    • 제작의뢰
  • 커뮤니티new
    • 구인·구직·외주
    • 테스트 요청
    • 자유게시판new
    • 게임계 소식
    • 유머&정보
    • 사이트링크
    • 이벤트&대회
  • 창작
    • 게임 기획
    • 맵배치
    • 글쓰기
    • 그리기
    • 음악
  • 자료실
    • 게임제작툴
    • 예제 및 샘플
    • 그래픽 소재
      • 오리지널 소재
      • 이차창작 소재
      • 수정·개조 소재
      • 외부 소재
    • 사운드 소재
    • 확장·플러그인·스크립트
      • MZ 플러그인
      • MV 플러그인
      • Ace 스크립트
      • VX 스크립트
      • XP 스크립트
      • 2k3 플러그인
      • VN 플러그인·확장
    • 외부 소재사이트
    • 기타 자료
      • 한글화툴
      • 무료 폰트
      • 유틸리티
    • 디자인 참고자료
  • 고객센터new
    • 공지사항new
    • 건의 및 신고
    • 핫 이슈
로그인 회원가입

NOTICE

공지사항
더보기
  • 홈페이지 개편 및 시스템 정비 작업 안내 04.13

Recently Added Games

최근 등록 게임
  • 어드벤쳐 [1치킨 수상작] 로봇 관리자 newfile 04.13
  • 퍼즐/보드 알파벳 용사 2 file 04.08
  • 롤플레잉 스틱 파이터 섬 1 체험판 file 03.31
  • 어드벤쳐 9th Existence file 03.26
  • 어드벤쳐 악역스타 훈발이 file 03.13
기타
2009.02.22 18:30

Sized Events 0.1 by Toby@rmxp.org

백호
조회 수 903 추천 수 0 댓글 0
크게 작게 위로 아래로 댓글로 가기 인쇄 첨부
크게 작게 위로 아래로 댓글로 가기 인쇄 첨부
http://www.rmxp.org/forums/showthread.php?t=7121
(로그인 필요)
이벤트에 지정된 스프라이트의 크기가 클 경우, 거기에 맞춰서 이벤트의 '크기'를 지정하는 것입니다.(여기서 말하는 이벤트의 '크기'는 해당 이벤트를 플레이어나 다른 이벤트가 통과할 수 있는가 여부와 관련있습니다) 일단 작동은 첨부된 데모를 참조하기 바랍니다.


class Game_Character

attr_accessor :size_x # event size x
attr_accessor :size_y # event size y
attr_accessor :tiles_left # sizing - tiles to the left
attr_accessor :tiles_right # sizing - tiles to the right

def initialize
@id = 0
@x = 0
@y = 0
@real_x = 0
@real_y = 0
@tile_id = 0
@character_name = ""
@character_hue = 0
@opacity = 255
@blend_type = 0
@direction = 2
@pattern = 0
@move_route_forcing = false
@through = false
@animation_id = 0
@transparent = false
@original_direction = 2
@original_pattern = 0
@move_type = 0
@move_speed = 4
@move_frequency = 6
@move_route = nil
@move_route_index = 0
@original_move_route = nil
@original_move_route_index = 0
@walk_anime = true
@step_anime = false
@direction_fix = false
@always_on_top = false
@anime_count = 0
@stop_count = 0
@jump_count = 0
@jump_peak = 0
@wait_count = 0
@locked = false
@prelock_direction = 0
@size_x = 1
@size_y = 1
@tiles_left = 0
@tiles_right = 0
end

#--------------------------------------------------------------------------
# *** BEGIN Sized Events v1.0
#--------------------------------------------------------------------------
# By Toby Zerner
# USAGE:
# In a parallel process event, call this script-x:
# $game_map.events[ID].size(SIZE_X, SIZE_Y)
# Replacing the words in capitals with the actual details.
#--------------------------------------------------------------------------
def size(x, y)
# Set instance variables
@size_x = x
@size_y = y
# Work out the number of tiles either side of the event
tiles_x = (@size_x - 1) / 2
@tiles_left = tiles_x.floor
@tiles_right = tiles_x.ceil
end

#--------------------------------------------------------------------------
# * Determine if Passable
# x : x-coordinate
# y : y-coordinate
# d : direction (0,2,4,6,8)
# * 0 = Determines if all directions are impassable (for jumping)
#--------------------------------------------------------------------------
# EDITED FOR SIZED EVENTS
#--------------------------------------------------------------------------
def passable?(x, y, d)
# Get new coordinates
new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)
new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)
# If coordinates are outside of map
unless $game_map.valid?(new_x, new_y)
# impassable
return false
end
# If through is ON
if @through
# passable
return true
end

# Check map passability settings
# Loop through each x tile
for i in 0...@size_x
# Check x coordinates
# If unable to leave first move tile in designated direction
unless $game_map.passable?(x - @tiles_left + i, y, d, self) then return false end
unless $game_map.passable?(new_x - @tiles_left + i, new_y, 10 - d) then return false end
# Loop through each y tile
for j in 0...@size_y
# Check y coordinates
# If unable to leave first move tile in designated direction
unless $game_map.passable?(x, y - j, d, self) then return false end
# If unable to enter move tile in designated direction
unless $game_map.passable?(new_x, new_y - j, 10 - d) then return false end
# Check x and y coordinates
# If unable to leave first move tile in designated direction
unless $game_map.passable?(x - @tiles_left + i, y - j, d, self) then return false end
# If unable to enter move tile in designated direction
unless $game_map.passable?(new_x - @tiles_left + i, new_y - j, 10 - d) then return false end
end
end

# Loop through map events
for event in $game_map.events.values
# If self is in range of [event]'s sizing, we can't pass
if event_collide?(self, event, new_x, new_y)
return false
end
end

# If player coordinates are consistent with move destination
if event_collide?(self, $game_player, new_x, new_y) and self != $game_player
return false
end

# passable
return true
end

#--------------------------------------------------------------------------
# * Check if two events collide (event sizing)
# event1 : the first event
# event2 : the second event
# new_x : the new x coordinate of event 1
# new_y : the new y coordinate of event 1
#--------------------------------------------------------------------------
def event_collide?(event1, event2, new_x, new_y)
if event1.id == event2.id then return false end
collision = false
# Check if there is a collision on the y axis
# Loop through each individual tile on both events and compare them
for i in (new_y - (event1.size_y - 1))..new_y
for j in (event2.y - (event2.size_y - 1))..event2.y
# If event 1's tile is the same as event 2's tile, we have a collision
if i == j
unless event1.through or event2.through
# Make sure there is a graphic - if not, no collision
if event1.character_name != "" and event2.character_name != ""
# There was a collision
collision = true
end
end
end
end
end
# If there was a collision on the y axis...
if collision == true
# Check the x axis
# Loop through each individual tile on both events and compare them
for i in (new_x - event1.tiles_left)..(new_x + event1.tiles_right)
for j in (event2.x - event2.tiles_left)..(event2.x + event2.tiles_right)
# If event 1's tile is the same as event 2's tile, we have a collision
if i == j
unless event1.through or event2.through
# Make sure there is a graphic - if not, no collision
if event1.character_name != "" and event2.character_name != ""
# There was a collision
return true
end
end
end
end
end
end
# No collision
return false
end

end

class Game_Player

#--------------------------------------------------------------------------
# * Same Position Starting Determinant
#--------------------------------------------------------------------------
def check_event_trigger_here(triggers)
result = false
# If event is running
if $game_system.map_interpreter.running?
return result
end
# All event loops
for event in $game_map.events.values
# If event coordinates and triggers are consistent
# EDITED FOR SIZED EVENTS
# If player's coordinates collide with the event and its sizing
if @x >= event.x - event.tiles_left and @x <= event.x + event.tiles_right and
@y >= event.y - (event.size_y - 1) and @y <= event.y and
triggers.include?(event.trigger)
# If starting determinant is same position event (other than jumping)
if not event.jumping? and event.over_trigger?
event.start
result = true
end
end
end
return result
end
#--------------------------------------------------------------------------
# * Front Envent Starting Determinant
#--------------------------------------------------------------------------
def check_event_trigger_there(triggers)
result = false
# If event is running
if $game_system.map_interpreter.running?
return result
end
# Calculate front event coordinates
new_x = @x + (@direction == 6 ? 1 : @direction == 4 ? -1 : 0)
new_y = @y + (@direction == 2 ? 1 : @direction == 8 ? -1 : 0)
# All event loops
for event in $game_map.events.values
# If event coordinates and triggers are consistent
# EDITED FOR SIZED EVENTS
# If player's new coordinates collide with the event and its sizing
if new_x >= event.x - event.tiles_left and new_x <= event.x + event.tiles_right and
new_y >= event.y - (event.size_y - 1) and new_y <= event.y and
triggers.include?(event.trigger)
# If starting determinant is front event (other than jumping)
if not event.jumping? and not event.over_trigger?
event.start
result = true
end
end
end
# If fitting event is not found
if result == false
# If front tile is a counter
if $game_map.counter?(new_x, new_y)
# Calculate 1 tile inside coordinates
new_x += (@direction == 6 ? 1 : @direction == 4 ? -1 : 0)
new_y += (@direction == 2 ? 1 : @direction == 8 ? -1 : 0)
# All event loops
for event in $game_map.events.values
# If event coordinates and triggers are consistent
# EDITED FOR SIZED EVENTS
# If player's new coordinates collide with the event and its sizing
if new_x >= event.x - event.tiles_left and new_x <= event.x + event.tiles_right and
new_y >= event.y - (event.size_y - 1) and new_y <= event.y and
triggers.include?(event.trigger)
# If starting determinant is front event (other than jumping)
if not event.jumping? and not event.over_trigger?
event.start
result = true
end
end
end
end
end
return result
end
#--------------------------------------------------------------------------
# * Touch Event Starting Determinant
#--------------------------------------------------------------------------
def check_event_trigger_touch(x, y)
result = false
# If event is running
if $game_system.map_interpreter.running?
return result
end
# All event loops
for event in $game_map.events.values
# EDITED FOR SIZED EVENTS
# If passed coordinates collide with the event and its sizing
if x >= event.x - event.tiles_left and x <= event.x + event.tiles_right and
y >= event.y - (event.size_y - 1) and y <= event.y and [1,2].include?(event.trigger)
event.start
result = true
end
end
return result
end

end


사용법: 맵에 병렬처리되는 이벤트를 하나 만들고 다음처럼 지정합니다 -
$game_map.events[ID].size(SIZE_X, SIZE_Y)
size_x/y는 이벤트의 가로/세로 크기(단위가 어떻게 되는지는 데모를 보세요).

Who's 백호

?

이상혁입니다.

http://elab.kr

0 추천 0 비추천
Atachment
첨부 '1'
  • Sized_Events_Demo.exe,
Facebook Twitter Google Pinterest KakaoStory Band
위로 아래로 댓글로 가기 인쇄 첨부
에디터 선택하기
✔ 텍스트 모드 ✔ 에디터 모드
?
댓글 쓰기 권한이 없습니다. 로그인 하시겠습니까?
Comment '0'

Category
  • 그래픽(16)
  • 맵/타일(15)
  • 메뉴(88)
  • 메시지(26)
  • 미니맵(9)
  • 버그픽스(0)
  • 변수/스위치(10)
  • 상점(14)
  • 상태/속성(8)
  • 스킬(49)
  • 아이템(34)
  • 액터(4)
  • 원경(0)
  • 영상(7)
  • 오디오(8)
  • 온라인(23)
  • 이동 및 탈것(62)
  • 이름입력(10)
  • 장비(34)
  • 저장(34)
  • 전투(174)
  • 제작도구(1)
  • 직업(2)
  • 퀘스트(3)
  • 키입력(18)
  • 타이틀/게임오버(24)
  • 파티(11)
  • HUD(34)
  • 기타(254)
List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 9750
1021 제작도구 [XP/VX/VXA] Doodad's Editor by newold Alkaid 2020.07.12 597
1020 메시지 Taylor's Simple Message System 2000 Alkaid 2020.07.05 426
1019 이름입력 한글조합입력기(영어가능) file 조규진1 2019.11.10 731
1018 맵/타일 맵연결 스크립트 (데모첨부) file 게임애호가 2018.06.15 900
1017 전투 전투중에 장비들 교체하기 file 레이스89 2017.08.19 930
1016 온라인 인터넷 웹 상에서의 시간을 취득하는 스크립트 1 이우 2016.05.24 1084
1015 장비 착용한 장비에 따라 모습이 달라지는 스크립트 예제 5 file 게임애호가 2015.02.14 2244
1014 기타 [All RGSS] File-Ex file Cheapmunk 2014.12.29 1097
1013 기타 [All RGSS] FileTest (Unicode) file Cheapmunk 2014.12.29 745
1012 기타 [RGSS XP] 게임 해상도 조절 스크립트 (*2) 11 file Cheapmunk 2014.10.03 2825
1011 그래픽 Drago - Custom Resolution II 1 Alkaid 2014.09.10 1242
1010 기타 레벨업스크립트(xp) 2 게임을만들자! 2014.08.05 1928
1009 메뉴 MOG - Scroll Bar for XP file 습작 2014.07.06 1714
1008 기타 [All RGSS] 윈도우 메세지박스 스크립트 (Completed ver) 5 file Cheapmunk 2014.06.22 2374
1007 기타 [All RGSS] 게임 다중 실행 방지 스크립트 1 file Cheapmunk 2014.05.24 1544
1006 기타 RM2kXP file 습작 2014.03.17 1696
1005 기타 [All RGSS] 윈도우 커서 숨기기/보이기 1 file Cheapmunk 2014.03.02 2140
1004 기타 Drago - Custom Resolution by LiTTleDRAgo Alkaid 2014.02.13 1301
1003 그래픽 [XP/VX/VXA] Drago - Transition Pack Alkaid 2014.02.13 1365
1002 기타 [XP/VX/VXA] Map Screenshot by LiTTleDRAgo 1 Alkaid 2014.02.13 1019
쓰기
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 52 Next
/ 52
AVANGS

게임 제작, 창작, 자료, 강좌를 연결하는 커뮤니티

  • 개인정보 취급방침

Copyright © 2026 Avangs