Wiki source code of hmm.en.txt
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | = Notes = | ||
2 | |||
3 | English translation (via Google) of [[hmm\.txt]]. | ||
4 | |||
5 | = Contents = | ||
6 | {{{ | ||
7 | Standard Functions | ||
8 | |||
9 | ☆☆☆ | ||
10 | HMMINIT p1 | ||
11 | |||
12 | Argument | ||
13 | p1: Initialize mode. | ||
14 | Sets the first bit of p1 and initializes DirectSound. Required to use the instruction of DS system. | ||
15 | Sets the second bit of p1 and initializes DirectMusic. Required to use the instruction of DM system. | ||
16 | Sets the third bit of p1 and initializes DirectInput. Required to use the instruction of DI system. | ||
17 | Sets the fourth bit of p1 and initializes DirectDraw. Required to use the instruction of DD system. | ||
18 | Sets the fifth bit of p1 and initializes DirectGraphics. Required to use the instruction of DG system. | ||
19 | Sets the sixth bit of p1 and initializes DirectShow. Required to use the instruction of DSH system. | ||
20 | Return value (stat) | ||
21 | Success:1 or HMM_OK | ||
22 | Failure:0 or HMM_ERR | ||
23 | |||
24 | Function | ||
25 | Initializes this plugin. Call the function at the very start of its usage. | ||
26 | |||
27 | Example) hmminit 3 ; Initializes DirectSound and DirectMusic. | ||
28 | |||
29 | dsinit: dminit ; Does the same as above example and doesn't matter which method is used. | ||
30 | |||
31 | |||
32 | ☆☆☆ | ||
33 | HMMEND No Argument | ||
34 | |||
35 | Return value (stat) | ||
36 | 1 will always come back. | ||
37 | |||
38 | Function | ||
39 | Ends this plugin. When HSP ends, this line is called in automatically so there's no need to be constantly aware of this. | ||
40 | |||
41 | ☆☆☆ | ||
42 | HMMBITON p1, p2 | ||
43 | |||
44 | Argument | ||
45 | p1: Controls a certain integer type variable name you want. | ||
46 | p2: Controls a certain bit number you want. | ||
47 | |||
48 | Return value (stat) | ||
49 | Always 1 | ||
50 | |||
51 | Function | ||
52 | Turns p2 bit of p1 variable into 1. | ||
53 | |||
54 | Example) | ||
55 | int a | ||
56 | a = 0 | ||
57 | HMMBITON a, 2 ;Turns 2nd bit into 1. | ||
58 | if a == 4 : dialog "The 2nd bit has been set" | ||
59 | HMMBITON a, 0 | ||
60 | if a == 5 : dialog "The 0th bit has been set" | ||
61 | stop | ||
62 | |||
63 | |||
64 | ☆☆☆ | ||
65 | HMMBITOFF p1, p2 | ||
66 | |||
67 | Argument | ||
68 | p1:Controls a certain integer type variable name you want. | ||
69 | p2:Controls a certain bit number you want. | ||
70 | |||
71 | Return value(stat) | ||
72 | Always 1 | ||
73 | |||
74 | Function | ||
75 | Turns p2 bit of p1 variable into 0. | ||
76 | |||
77 | |||
78 | ☆☆☆ | ||
79 | HMMBITCHECK p1, p2 | ||
80 | |||
81 | Argument | ||
82 | p1: Checks a certain integer type variable name you want. | ||
83 | p2: Checks a certain bit number you want. | ||
84 | Return value (stat) | ||
85 | When set at 1 | ||
86 | When not set at 0 | ||
87 | |||
88 | Function | ||
89 | Checks if p2 bit of p1 variable is set. | ||
90 | |||
91 | |||
92 | ☆☆☆ | ||
93 | HMMGETFPS p1 | ||
94 | |||
95 | Argument | ||
96 | p1: Retains a frame rate you want in integer type variable name. | ||
97 | |||
98 | Return value (stat) | ||
99 | 1 is returned | ||
100 | |||
101 | Function | ||
102 | Obtains frame rate. | ||
103 | |||
104 | ☆☆☆ | ||
105 | HMMHITCHECK p1, p2, p3, p4, p5, p6, p7, p8, p9 | ||
106 | |||
107 | Argument | ||
108 | p1: Parameter entering in collision detection results. | ||
109 | p2: Array variable 1 that checks certain collision detection you want. | ||
110 | p3: Number you want to search for in actual array variable 1. | ||
111 | p4: Parameter number required to configure a single character. | ||
112 | p5: Collision detection you want to examine array variable 2. | ||
113 | p6: Parameter number required to configure a single character. | ||
114 | p7: Starts number search of array variable 2. | ||
115 | p8: Ends number search of array variable 2. | ||
116 | p9: Searches a target type value (Holds the same meaning as p3's parameter of ex_check of hspdx.dll) | ||
117 | |||
118 | Return value | ||
119 | Always 1 | ||
120 | |||
121 | Function | ||
122 | Same character of rectangle of collision detection is taken care of. キャラクター同士の矩形の当たり判定処理をします。 | ||
123 | ここでいうキャラクターとは、最低でも表示座標と当たり判定の領域と検索タイプ値のデータが入っている1次元または2次元配列をさします。 | ||
124 | 1つのキャラで最低でも必要なパラメーターの内訳は表示座標x, y(Upper left side of the rectangle) | ||
125 | Collision detection regarding rectangle's starting position: sx, sy. | ||
126 | Collision detection regarding rectangle's width and height: w, h. | ||
127 | 検索タイプ値typeの7ぐのパラメーターが必要になります。 | ||
128 | 配列1のキャラクターと配列2のキャラクターが当たっている場合は、p1に配列2のキャラクターの番号が帰ってきます。 | ||
129 | 当たりが1つもない場合はp1に-1が帰ります。 | ||
130 | p9が0の時は配列2のキャラクター全てを検索します。 | ||
131 | The question of it's usefullness is strange one, therefore only users who understands how to use the sample should apply this. | ||
132 | |||
133 | Example) | ||
134 | dim sb, 7, 16 | ||
135 | /* | ||
136 | Player Character's bullet. | ||
137 | Changes the position of element number containing parameters used in collision detection. | ||
138 | Where n is a character number (means numerical value, I'm guessing). | ||
139 | sb.0.n Displays x coordinates. | ||
140 | sb.1.n Displays y coordinates. | ||
141 | sb.2.n The x coordinates of a rectangle starting position's collision detection. | ||
142 | sb.3.n The y coordinates of a rectangle starting position's collision detection. | ||
143 | sb.4.n Width of the rectangle's collision detection. | ||
144 | sb.5.n Length of the rectangle's collision detection. | ||
145 | sb.6.n Searches type value. | ||
146 | */ | ||
147 | |||
148 | dim ene, 7*32 | ||
149 | /* | ||
150 | Enemy | ||
151 | The configuration parameters that can appear in seven to 32 animals | ||
152 | Configurable parameters that can be registered from 7 which can go up to 32 enemies. | ||
153 | Where n is a character number. | ||
154 | ene.(7*n) Displays x coordinates. | ||
155 | ene.(7*n+1) Displays y coordinates. | ||
156 | ene.(7*n+2) The x coordinates of a rectangle starting position's collision detection. | ||
157 | ene.(7*n+3) The y coordinates of a rectangle starting position's collision detection. | ||
158 | ene.(7*n+4) Width of the rectangle's collision detection. | ||
159 | ene.(7*n+5) Length of the rectangle's collision detection. | ||
160 | ene.(7*n+6) Searches type value. | ||
161 | */ | ||
162 | ;Collision detection of PC's bullet and enemy. | ||
163 | repeat 16 | ||
164 | hmmhitcheck res, sb, 7, cnt, ene, 7, 0, 0 | ||
165 | if res == -1 : continue | ||
166 | ;If it comes here that means the PC's bullet has hit the enemy. | ||
167 | break | ||
168 | loop | ||
169 | |||
170 | ☆☆☆ | ||
171 | HHMMHITCHECKSETINDEX p1, p2, p3 | ||
172 | |||
173 | Argument | ||
174 | p1:表示x座標のパラメターが入っている要素番号 | ||
175 | p2:当たり判定の矩形の開始位置x座標のパラメターが入っている要素番号 | ||
176 | p3:検索タイプ値のパラメターが入っている要素番号 | ||
177 | |||
178 | Return value | ||
179 | Always 1 | ||
180 | |||
181 | Function | ||
182 | Changes the position of element number containing parameters used in collision detection. | ||
183 | |||
184 | Example) | ||
185 | hmmhitchecksetindex 5, 1, 0 | ||
186 | dim sb, 7, 16 | ||
187 | /* | ||
188 | PC's bullet. | ||
189 | Configurable number of parameters that can be discharged from 7 which can go up to 16 bullets. | ||
190 | Where n is a character number. | ||
191 | sb.0.n Searches type value. | ||
192 | sb.1.n The x coordinates of a rectangle starting position's collision detection. | ||
193 | sb.2.n The y coordinates of a rectangle starting position's collision detection. | ||
194 | sb.3.n Width of the rectangle's collision detection. | ||
195 | sb.4.n Length of the rectangle's collision detection. | ||
196 | sb.5.n Displays x coordinates. | ||
197 | sb.6.n Displays y coordinates. | ||
198 | */ | ||
199 | }}} |