렌파이/게임 따라하기 세리리의 해피버스데이 따라하기 _ 8 이벤트 추가 백안시 2012. 3. 25. 02:07 수정사항 여기저기 수정하고 이벤트를 몇 개 넣어놓았습니다. 스크립트 birthday.zip 어느정도 기본 틀을 다 만드니까 별로 쓸 말이 없군요; 다운받아서 프로젝트 있는 폴더에 압축풀고 런처에서 birthday 선택해서 실행하시면 됩니다. # guis.rpy init python: # 스탯 바뀔 때마다 글씨 색을 바꾸도록 스크립트를 짰습니다. # 예전 스탯에 비해서 얼마나 바뀌었는지 확인해야 하니까 예전 스탯을 저장하는 변수가 있어야 합니다. old_pow = old_wise = old_cute = old_gap = old_kind = old_stress = 0 # 새 값이 이전값보다 크면 파랑, 작으면 빨강. 같으면 흰색 def delta_to_color(new, old): if new > old: return "#0ff" elif new < old: return "#f00" else: return "#fff" # 스트레스는 올라봤자 안좋으니 올라가면 빨강 내려가면 파랑입니다. def delta_to_color_negative(new, old): if new > old: return "#f00" elif new < old: return "#0ff" else: return "#fff" def update_colors(): #스트레스 store.stress_color = delta_to_color_negative(store.stress, store.old_stress) store.old_stress = store.stress #힘 store.pow_color = delta_to_color(store.pow, store.old_pow) store.old_pow = store.pow # 머리.. store.wise_color = delta_to_color(store.wise, store.old_wise) store.old_wise = store.wise # 귀여움 store.cute_color = delta_to_color(store.cute, store.old_cute) store.old_cute = store.cute # 이야기 store.gap_color = delta_to_color(store.gap, store.old_gap) store.old_gap = store.gap # 상냥함 store.kind_color = delta_to_color(store.kind, store.old_kind) store.old_kind = store.kind # 이렇게 저장한 색상은 스크린에서 씁니다. # 일단 먼저 숨긴다음에 보여줘야지 내보였다가 숨기면 스크린이 안나온것처럼 보입니다. renpy.hide_screen('stat_fake') renpy.show_screen('stat_fake') # 증감 효과.. screen stat_fake: frame: style_group 'status' background None xpos 0.1 ypos 0.6 grid 6 2: spacing 10 text '힘' text '[pow]' color pow_color #update_colors 함수에서 pow_color 에 저장했던 변수값을 여기서 색상으로 씁니다. text '지식' text '[wise]' color wise_color text '귀여움' text '[cute]' color cute_color text '이야기' text '[gap]' color gap_color text '상냥함' text '[kind]' color kind_color text '피로' text '[stress]' color stress_color # update_colors 함수는 스탯이 증감하는 스케쥴 (공부 휴식 ..) 이벤트의 맨 마지막 블록에 적었습니다. # events.rpy label swim: #수영 $ spot = '컬처스쿨' python: # 성공시 // 성공확률 60%.. if renpy.random.random() <= 0.6: v = renpy.random.randint(8,9) pow = pow + v v = renpy.random.randint(2,6) kind = kind - v stress = stress + 7 # 실패시 else: v = renpy.random.randint(3,5) pow = pow + v v = renpy.random.randint(2,5) kind = kind - v stress = stress + 7 call txteffect # txteffect 라는 레이블에 update_colors 함수가 있는거죠.. '세리리\n 기운내서 수영하시오!' return # script.rpy # 병이나 기타 상태 판정은 마지막 요일에 합니다. label judgement: # 일주일 스케쥴 결과에 따라 판정 if stress > 55: # 병 상태 판정/ 사실 병이 어떤때 나는지 잘 모르겠습니다 ㅇ<-< $ condition = '병' else: $ condition = '건강' # 스케쥴 저장했던 schedules 리스트 원상복구합니다. $ schedules = ['']*7 # 스케쥴 설정할 때 while문에서 써먹었던 i값 초기화 $ i = 0 # 그리고 커맨드 스크린을 띄우는 start 레이블로돌아ㅏㅂ니다. jump start # 이벤트는 events.rpy/ witch_events.rpy 파일을 참고하시면 될듯. 결과 보면 아시겠지만 스크립트도 그렇고 겜 화면도 그렇고 깔끔하지는 않습니다.. 두 번째 만들어볼 때쯤이면 더 나아지지 않을까 생각중입니다..) 링크파이썬_ 함수 변수값 바뀔 때마다 텍스트 색 바꾸기 DSE 이벤트 만들기 1 DSE 이벤트 만들기 2 공유하기 게시글 관리 구독하기백안시의 공방 - 소설형 게임 제작실 '렌파이/게임 따라하기' Related Articles 아날로그 어 헤이트 스토리 따라하기 - 2 인트로 뼈대 아날로그 어 헤이트 스토리 따라하기 - 1 세리리의 해피버스데이 따라하기 _ 7 스탯/스케쥴 수정, 스케쥴 시스템 세리리의 해피버스데이 따라하기_ 6 스케쥴 설정 화면