新人求教几个问题(已解决)



kong
2010-12-18 00:14:15

[i=s] 本帖最后由 kong 于 2010-12-23 11:23 编辑 [/i]

[s]如下图,
[/s][attach]17626[/attach]
[s]想将上面的改成用摇杆模拟一个光标(不知道专用名词咋说= =||)进行选择
而且当光标划过选项是就会将选项的图片换另一张的效果
(也就是光标划过时[attach]17627[/attach]换成[attach]17628[/attach])
[/s]
[s]还有,想请教一下bg移动的问题。。。
(也就是“把一张大于屏幕的图片渐渐地往某一个方向移动”的那种效果)

最后还想请教一下各位大大移植的前期处理都用什么工具
不过偶目前还是最苦恼脚本问题,有提不出的,还有提了出来乱码的。。。
还有字符集去哪找怎么装之类的
偶表示没有脚本上面那个手工做得很蛋疼的说~

嘛嘛~名词不知咋说了
最近QQ经常掉线,都不太想用了。。。[/s]


[s][b]2010.12.21更新的问题:
[/b]fgmove();是fg移动的指令没错吧?但是AMP执行指令的时候是从上到下执行
但是如果偶想要N个fg[color=red]同时移动[/color]或者是[color=red]前面的[/color][color=red]未移动完下一个就接着移动[/color]的话,那应该怎样做?[/s]


悸樱奏
2010-12-18 00:25:56

空君乃在做啥好物啊偶这个渣渣目前只能来围观了话说乃为啥不去超级群里问问R叔还在呢~


kong
2010-12-18 00:41:17

偶现在在牧场群里接受总叔的调教中。。。(主要是脚本问题 )


flamesmile
2010-12-18 00:42:23

[i=s] 本帖最后由 flamesmile 于 2010-12-18 00:49 编辑 [/i]

[b]回复 [url=http://www.yayabo.cn/redirect.php?goto=findpost&pid=164403&ptid=14272]1#[/url] [i]kong[/i] [/b]

空君。。。。。。。。。要做出摇杆模拟鼠标效果么。。。。。。那个要切换游戏模式的。。。。。。。很容易混乱的。。。。。。。。。。


具体可以去参考下AMP自带的解谜游戏实例的脚本。。。。。。。。。。。。。。。。不过还是推荐用全按键的。。。。。。感觉特地弄个鼠标来把操作折腾的更复杂没什么意义的。。。。。。。。。。。。。。。。。。。。。。。。。


kong
2010-12-18 00:50:40

那么按键选择的话,光标指到哪里就换选项图标的话要怎么做??


flamesmile
2010-12-18 01:00:30

[i=s] 本帖最后由 flamesmile 于 2010-12-18 04:25 编辑 [/i]

[b]回复 [url=http://www.yayabo.cn/redirect.php?goto=findpost&pid=164415&ptid=14272]5#[/url] [i]kong[/i] [/b][code]function titleselectA(selectA1,selectA2,selectA3,selectB1,selectB2,selectB3,dx,dy,stepx,stepy)
if _discolortitle==nil then
_discolortitle = {}
_discolortitle.blue = {}
_discolortitle.pink = {}
_discolortitle.icondx = dx-2
_discolortitle.icondy = dy-2
_discolortitle.mode = 1
_discolortitle.chose = 1
_discolortitle.blue[1] = LoadImage(selectA1,8888)
_discolortitle.blue[2] = LoadImage(selectA2,8888)
_discolortitle.blue[3] = LoadImage(selectA3,8888)
_discolortitle.pink[1] = LoadImage(selectB1,8888)
_discolortitle.pink[2] = LoadImage(selectB2,8888)
_discolortitle.pink[3] = LoadImage(selectB3,8888)

elseif _discolortitle.mode==1 then

if KeyDown(KEY_UP)==1 then
_discolortitle.chose = _discolortitle.chose - 1
if _discolortitle.chose < 1 then
_discolortitle.chose = 3
end
end
if KeyDown(KEY_DOWN)==1 then

_discolortitle.chose = _discolortitle.chose + 1
if _discolortitle.chose > 3 then
_discolortitle.chose = 1

end
end

if KeyDown(KEY_CIRCLE)==1 then
--CURR_EV = 1;
_discolortitle.mode = 2
end

if KeyUp(KEY_CIRCLE)==1 then
--if CURR_EV == 1 then
--_discolortitle.mode = 2
--end
end

local _dx = dx
local _dy = dy

for i=1,3 do
if _discolortitle.chose==i then
--if CURR_EV == 1 then
--DrawImage(_discolortitle.blue[i],_dx,_dy)
--elseif CURR_EV == 2 then
ImageToScene(_discolortitle.pink[i],_dx,_dy)
--end
else
ImageToScene(_discolortitle.blue[i],_dx,_dy)
end
_dx = _dx + stepx
_dy = _dy + stepy

end


elseif _discolortitle.mode==2 then
FreeImage(_discolortitle.blue[1])
FreeImage(_discolortitle.blue[2])
FreeImage(_discolortitle.blue[3])
FreeImage(_discolortitle.pink[1])
FreeImage(_discolortitle.pink[2])
FreeImage(_discolortitle.pink[3])
_discolortitle = nil
return chose
end

loop()
end[/code]以上~~~~~~~~~~~~~~~~把这个定义进新函数~~~~~~~~~~

selectA的是默认按钮
selectB是选中后的按钮
其他和普通一样



用的时候就像这样:
chose = titleselectA("背景按钮1","背景按钮2","背景按钮3","选中按钮1","选中按钮2","选中按钮3",x坐标,y坐标,x增加步长,y增加步长)
if chose == 1 then XXXXXXXXXXXX;end
if chose == 2 then XXXXXXXXXXXX;end
if chose == 3 then XXXXXXXXXXXX;end


kong
2010-12-18 01:07:17

[quote]回复 kong
chose = titleselectA("背景按钮1","背景按钮2","背景按钮3","选中按钮1","选中按钮2","选中按钮3",x坐标,y坐标,x增加步长,y增加步长)
if chose == 1 then XXXXXXXXXXXX;end
if chose == 2 then XXXXXXXXXXXX;end
if chose == 3 then XXXXXXXXXXXX;end

[size=2][color=#999999]flamesmile 发表于 2010-12-18 01:00[/color] [url=http://www.yayabo.cn/redirect.php?goto=findpost&pid=164416&ptid=14272][img]http://www.yayabo.cn/images/common/back.gif[/img][/url][/size][/quote]


偶用这段好了。。。现在暂时不想学函数之类的东西
还是学会简单点的东西再说~


悸樱奏
2010-12-18 01:07:43

HV5偶果然是个渣渣


flamesmile
2010-12-18 01:09:29

[quote]偶用这段好了。。。现在暂时不想学函数之类的东西
还是学会简单点的东西再说~ ...
[size=2][color=#999999]kong 发表于 2010-12-18 01:07[/color] [url=http://www.yayabo.cn/redirect.php?goto=findpost&pid=164417&ptid=14272][img]http://www.yayabo.cn/images/common/back.gif[/img][/url][/size][/quote]


oh no..........上边那个咱已经帮你写好了,直接用就行了。。。。。。。。。。。
而且如果不把那些复制进自定义函数里的话下面那个语句是无效的。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。


kong
2010-12-18 01:10:10

偶虽然是看明白了上面那函数。。。但是写还是不会。。。


kong
2010-12-18 01:11:09

复制到哪???


flamesmile
2010-12-18 01:14:37

[i=s] 本帖最后由 flamesmile 于 2010-12-18 01:21 编辑 [/i]

好吧。。。。。。具体操作。。。。。。。。
[attach]17629[/attach]
这个扔进脚本堆里
然后在“am_init.lua”这个脚本里
有一堆这样的东西[code]Include("ball_ex.lua");
Include("feather_ex.lua");
Include("rain_ex.lua");
Include("hikari_yellow_ex.lua");
Include("snow_ex.lua");
Include("bloudsakura_ex.lua");
Include("sakura_ex.lua");
Include("behindmove.lua");
Include("end_ex.lua");

Include("module_switch.lua");
Include("module_select.lua");
Include("select_plus.lua");
Include("module_find.lua");
Include("module_menu.lua");
Include("module_title.lua");
Include("module_sav.lua");
Include("module_memory.lua");[/code]在其中插一行写上:
Include("titleselectA.lua");




之后再在自己的脚本里用[code]chose = titleselectA("背景按钮1","背景按钮2","背景按钮3","选中按钮1","选中按钮2","选中按钮3",x坐标,y坐标,x增加步长,y增加步长)
if chose == 1 then XXXXXXXXXXXX;end
if chose == 2 then XXXXXXXXXXXX;end
if chose == 3 then XXXXXXXXXXXX;end[/code]这样的代码就能用了


flamesmile
2010-12-18 01:19:57

[i=s] 本帖最后由 flamesmile 于 2010-12-18 02:49 编辑 [/i]

oh no。。。。。。。。。刚才用论坛模式手打的代码。。。。有几个地方用了全角标点,。,。。。。读取不能的说。。。。
[attach]17631[/attach]
更正了下。。。。。。。。。

刚试过能读取了。。。。。。。。。。


『兔寳貝』
2010-12-18 03:14:14


那个……HDV5.
另向未来技术帝请安……


yyeg
2010-12-18 12:22:06

夏色的纸飞机么全年龄没语音?


gyyfifafans
2010-12-18 13:45:30

围观hd调教kong君……


gyyfifafans
2010-12-18 14:02:00

hd,乃居然扔下俺,来找kong君……


kong
2010-12-18 15:15:48

不可以莫~

话说这里不是版聊的地方。。。偶不想说内容相关以外的话
(这句之后你就别回帖了= =)


沁ぅ純の寳貝
2010-12-18 16:30:08

[i=s] 本帖最后由 沁ぅ純の寳貝 于 2010-12-18 16:35 编辑 [/i]

顺便一提摇杆是相当简单的 切换模式自动 加个函数进去就行了
function discolortitle()
if findtest() == 1 then
fgon(1);
elseif findtest() == 2 then
fgon(2);
elseif findtest() == 3 then
fgon(3);
else
local i;
for i = 1,3 do
fgoff(i);
end
end
end

然后把这个函数贴到am_init.lua里面去 然后在find模式之前调用进来即可:setfindfunc(discolortitle);

find模式其实不麻烦 跳转脚本的时候加上一句sysMode(EVENT_MOUDLE);即可

以及前提脚本的操作:像俺这种已经化为尘埃的家伙么就能看得懂一些简单的脚本 而一些自己写引擎的而不是通用引擎(KRKR,NS啥的)俺则必须找人帮忙了。。。
建议找的人:威廉叔,浪叔,掌叔 如果白叔实在是没事干的话白叔也回来帮乃的 前提是白叔正在兴头上……


flamesmile
2010-12-20 00:17:57

[quote]顺便一提摇杆是相当简单的 切换模式自动 加个函数进去就行了
function discolortitle()
if findte ...
[size=2][color=#999999]沁ぅ純の寳貝 发表于 2010-12-18 16:30[/color] [url=http://www.yayabo.cn/redirect.php?goto=findpost&pid=164632&ptid=14272][img]http://www.yayabo.cn/images/common/back.gif[/img][/url][/size][/quote]


[img]http://www.yayabo.cn/images/smilies/cat/2.gif[/img]
宝贝师父再次用0.3秒做了咱30天才能做到的事,膜拜宝贝师父,宝贝师父威武


牧濑红莉栖
2010-12-20 21:32:12

新手来膜拜并学习19L


kong
2010-12-21 02:50:53

小白继续求调教!!


悸樱奏
2010-12-21 17:40:24

OH NO偶也想被调教


kong
2010-12-21 18:32:01

乃个受的~


悸樱奏
2010-12-21 18:34:13

OH NO果断滴被空君乃给坑了


諾亞
2010-12-21 18:36:26

围观KONG君被调教。 一人一


沁ぅ純の寳貝
2010-12-21 18:53:14

俺看看有啥好办法。。。

_imagemovedx = {};
_imagemovedy = {}
_imagemovevx = {};
_imagemovevy = {};
_imagemovemode = {};
_imagemovecount = {};
_imagemovetime = {};
_imagemoveif = {};
_imagemoveend = 1;

function imagexy(index,dx,dy)
_imagemovedx[index] = dx;
_imagemovedy[index] = dy;
fgxy(index,dx,dy);
end

function imagemove(index,vx,vy,time)
_imagemovevx[index] = vx;
_imagemovevy[index] = vy;
_imagemovetime[index] = time/1000*60;
_imagemoveif[index] = 1;
_imagemovemode[index] = 0;
_imagemovecount[index] = 0;
end

function imagemovebegin()
if true then
for index=1,16 do
if _imagemoveif[index]==1 then
_imagemovemode[index] = 1;
end
end
for index=1,16 do
if _imagemoveif[index]==1 then
if _imagemovemode[index]==1 then
_imagemovecount[index] = _imagemovecount[index] + 1;
if _imagemovecount[index] == 0 then
_imagemovedx[index] = _imagemovedx[index] + _imagemovevx[index]/20;
_imagemovedy[index] = _imagemovedy[index] + _imagemovevy[index]/20;
end
fgxy(index,_imagemovedx[index],_imagemovedy[index]);
if _imagemovecount[index] >= _imagemovetime[index] then
_imagemovemode[index] = 2;
end
end
end
end
_imagemoveend = 1;
for index=1,16 do
if _imagemoveif[index]==1 then
if _imagemovemode[index]==2 then
_imagemovemode[index] = 0;
_imagemovecount[index] = 0;
_imagemoveif[index] = 0;
elseif _imagemovemode[index]==1 then
_imagemoveend = 0;
end
end
end
if _imagemoveend == 1 then return;end
end
loop();
end

上述的函数新开一个lua脚本然后粘贴进去 Include一下 用的时候这样子:

fg(1,"demopic1.png",0,0);--载入fg1
fg(2,"demopic2.png",0,0);--载入fg2
imagexy(1,0,0); --fg1号初始坐标设定
imagexy(2,0,0); --fg2号初始坐标设定
imagemove(1,80,80,1000); --fg1号移动距离设定
imagemove(2,80,80,1000); --fg2号移动距离设定
imagemovebegin(); --开始移动fg

移动的fg限定为1~16号 理应是足够的
这是前台移动 想要后台移动的话可以把loop去掉然后自己适当做一些修改 加入到switch里面即可
顺便一提俺只是搬运而已 想来说些啥的同学们可以回家喝茶去了


悸樱奏
2010-12-21 19:17:53

偶只是来学习兼被调教滴


q0989588968
2010-12-24 13:51:58

問 寶貝叔巴XD


俺當年也是 寶貝叔 幫俺搞定的XD