펑크랜드 개발자 센터
Ask or search…
K
Comment on page

파티클 스크립팅

  • Scripts 폴더 안에 Client.lua 파일을 만들어 아래 내용을 넣습니다.
예) 파티클을 이용한 불 오브젝트 생성
1
function fireParticleUnitID(posx,posy,id)
2
local p = ParticleSystem();
3
p.AttachToUnitID(Point(posx,posy),id)
4
5
p.shape = 4
6
p.sortOrder = 499
7
8
p.material = 0
9
p.startLifetime = 1.5
10
p.startSpeed = 1
11
p.startSize = 25
12
p.gravityModifier = -10
13
p.angle = 50
14
p.radius = 7
15
p.shapeRotX = -90
16
p.shapeScaleZ = 13.5
17
p.scale = 3
18
p.sizeOverLifeTime = true
19
p.sizeoVerLifeTimePrefab = 2
20
21
-- 파티클 불 설정
22
p.colorOverLifeTime = true
23
p.SetColorOverLifeTimeColor(0,Color(255,0,0,255))
24
p.RemoveColorOverLifeTimeColor(1);
25
p.SetColorOverLifeTimeColorAlpha(0,0)
26
p.AddColorOverLifeTimeAlpha(0.5,255)
27
28
p.SetMaterialTexture("Pictures/fireEffect.png","Pictures/fireEffect.png")
29
30
local p2 = ParticleSystem();
31
p.AddChild(p2)
32
p2.visible = true
33
34
p2.shape = 4
35
p2.sortOrder = 500
36
37
p2.material = 4
38
p2.startLifetime = 1.5
39
p2.startSpeed = 1
40
p2.startSize = 20
41
p2.gravityModifier = -10
42
p2.angle = 50
43
p2.scale = 3
44
p2.radius = 7
45
p2.shapeRotX = -90
46
p2.shapeScaleZ = 13.5
47
48
p2.sizeOverLifeTime = true
49
p2.sizeoVerLifeTimePrefab = 2
50
51
-- 파티클 불 설정
52
p2.colorOverLifeTime = true
53
p2.SetColorOverLifeTimeColor(0,Color(255,255,0,255))
54
p2.RemoveColorOverLifeTimeColor(1);
55
p2.SetColorOverLifeTimeColorAlpha(0,0)
56
p2.AddColorOverLifeTimeAlpha(0.5,255)
57
58
--불 그림 설정
59
p2.SetMaterialTexture("Pictures/fireEffect.png","Pictures/fireEffect.png")
60
end
클라이언트 스크립트에 해당 코드 내용 넣기 → 네코랜드 스튜디오상 자동 시작이나 버튼 입력 이벤트를 만들기 → 스크립트 이벤트 등록하기 → fireParticleUnitID(0,0,event.id) 넣기
위 순서를 거치면 해당 이벤트의 위치에 불 파티클이 생성됩니다.
event.id 대신 unit.id를 넣으면 플레이어 위치에 생성됩니다. 0,0은 생성될 위치입니다.