找回密码
 点一下
楼主: yplayers

求助触发

[复制链接]
发表于 2008-8-1 19:12:52 | 显示全部楼层
好吧,以后这句话只在提醒中出现………………
回复

使用道具 举报

 楼主| 发表于 2008-8-1 19:28:55 | 显示全部楼层
好像还不行
冰块大大
你的QQ是多少啊
我们详谈
回复

使用道具 举报

发表于 2008-8-1 21:02:27 | 显示全部楼层
Player(0),那个教程里也有说的吧,是指代玩家1,0到11就是指玩家1-12.

将call TimerStart(T,5,false,function B)
改为call TimerStart(t,3*2,false,function B)
不清楚是不是这样了
回复

使用道具 举报

发表于 2008-8-1 21:07:06 | 显示全部楼层
5改成3+2*GetHeroLevel(GetTriggerUnit())
回复

使用道具 举报

 楼主| 发表于 2008-8-1 19:59:30 | 显示全部楼层

请教J

if (P == Player(0) or P == Player(1) or P == Player(2))then      if (P == Player(0)   里面的Player(0)是指玩家0吗
call ReviveHero( U, 0, 0, true )//队伍1复活坐标                U, 0, 0, true     这个坐标怎么填啊   
endif                                                                                              看过那个求改的人应该知道
if (P == Player(3) or P == Player(4) or P == Player(5))then        就是那个大陆的四个角         
call ReviveHero( U, 0, 0, true )//队伍2复活坐标                        应该可以把这Player(9) or P == Player(10) or P == Player(11))
endif                                                                                                               Player(10) or P == Player(11) or P == Player(12))
if (P == Player(6) or P == Player(7) or P == Player(8))then
call ReviveHero( U, 0, 0, true )//队伍3复活坐标                       还有还有  冰块大大做的哪个buyaoshan
endif                                                                                                           有什么意思   为什么不能删
if (P == Player(9) or P == Player(10) or P == Player(11))then           请指教
call ReviveHero( U, 0, 0, true )//队伍4复活坐标
endif



function Trig_hero_1_dies_Actions takes nothing returns nothing          这个5  怎么改成  3加等级乘以2
local timer T =CreateTimer()
local timerdialog TG = CreateTimerDialog(T)
call StoreInteger(udg_cache,I2S(H2I(T)),"Unit",H2I(GetTriggerUnit()))
call StoreInteger(udg_cache,I2S(H2I(T)),"TG",H2I(TG))
call TimerStart(T,5,false,function B)//其中5为复活时间
set T =null
call TimerDialogSetTitle(TG,"复活时间")
if (GetLocalPlayer()==GetOwningPlayer(GetTriggerUnit()))then
call TimerDialogDisplay(TG,true)

谢谢   
回复

使用道具 举报

发表于 2008-8-1 21:11:52 | 显示全部楼层
关于那个坐标,U是单位,后面两个是x、y坐标,最后一个是是否显示复活特效
坐标是你想复活的地方
回复

使用道具 举报

 楼主| 发表于 2008-8-1 23:35:36 | 显示全部楼层
function Trig_hero_1_dies_Conditions takes nothing returns boolean
return IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true            
endfunction

function B takes nothing returns nothing
local timer T = GetExpiredTimer()
local timerdialog TG =I2TG(GetStoredInteger(udg_cache,I2S(H2I(T)),"TG"))
local unit U = I2U(GetStoredInteger(udg_cache,I2S(H2I(T)),"Unit"))
local player P =GetOwningPlayer(U)
call FlushStoredMission(udg_cache,I2S(H2I(T)))
call DestroyTimer( T )
call DestroyTimerDialog( TG )
if (P == Player(0) or P == Player(1) or P == Player(2) or P == Player(3) or P == Player(4))then
call ReviveHero( U, -2537.5, -3044.7, true )//队伍1复活坐标
endif
if (P == Player(5) or P == Player(6) or P == Player(7) or P == Player(8) or P == Player(9))then
call ReviveHero( U, 0, 0, true )//队伍2复活坐标
endif
if (GetLocalPlayer()==P)then
call PanCameraTo(0,0)
endif
set U =null
set T =null
set TG =null
endfunction

function Trig_hero_1_dies_Actions takes nothing returns nothing
local timer T =CreateTimer()
local timerdialog TG = CreateTimerDialog(T)
call StoreInteger(udg_cache,I2S(H2I(T)),"Unit",H2I(GetTriggerUnit()))
call StoreInteger(udg_cache,I2S(H2I(T)),"TG",H2I(TG))
call TimerStart(T,3+2*GetHeroLevel(GetTriggerUnit()),false,function B)//其中5为复活时间
set T =null
call TimerDialogSetTitle(TG,"复活时间")
if (GetLocalPlayer()==GetOwningPlayer(GetTriggerUnit()))then
call TimerDialogDisplay(TG,true)
endif
set TG =null
endfunction       我是这样编的  出错了  怎样直接发图片 我发上来
回复

使用道具 举报

 楼主| 发表于 2008-8-1 23:59:52 | 显示全部楼层
又改了一下  还是不行
function Trig_hero_1_dies_Conditions takes nothing returns boolean
return IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true        
endfunction

function B takes nothing returns nothing
local timer T = GetExpiredTimer()
local timerdialog TG =I2TG(GetStoredInteger(udg_cache,I2S(H2I(T)),"TG"))
local unit U = I2U(GetStoredInteger(udg_cache,I2S(H2I(T)),"Unit"))
local player P =GetOwningPlayer(U)
call FlushStoredMission(udg_cache,I2S(H2I(T)))
call DestroyTimer( T )
if (P == Player(0) or P == Player(1) or P == Player(2) or P == Player(3) or P == Player(4))then
call ReviveHero( U, -2537.5, -3044.7, true )//队伍1复活坐标
endif
if (P == Player(5) or P == Player(6) or P == Player(7) or P == Player(8) or P == Player(9))then
call ReviveHero( U, 4471.3, 2320.1, true )//队伍2复活坐标
endif
if (GetLocalPlayer()==P)then
call PanCameraTo(0,0)
endif
set U =null
set T =null
set TG =null
endfunction

function Trig_hero_1_dies_Actions takes nothing returns nothing
local timer T =CreateTimer()
local timerdialog TG = CreateTimerDialog(T)
call StoreInteger(udg_cache,I2S(H2I(T)),"Unit",H2I(GetTriggerUnit()))
call StoreInteger(udg_cache,I2S(H2I(T)),"TG",H2I(TG))
call TimerStart(T,3+2*GetHeroLevel(GetTriggerUnit()),false,function B)//其中5为复活时间
set T =null
call TimerDialogSetTitle(TG,"复活时间")
if (GetLocalPlayer()==GetOwningPlayer(GetTriggerUnit()))then
call TimerDialogDisplay(TG,true)
endif
set TG =null
endfunction

//===========================================================================
function InitTrig_hero_1_dies takes nothing returns nothing
    set gg_trg_hero_1_dies = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_hero_1_dies, EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddCondition( gg_trg_hero_1_dies, Condition( function Trig_hero_1_dies_Conditions ) )
    call TriggerAddAction( gg_trg_hero_1_dies, function Trig_hero_1_dies_Actions )
endfunction
回复

使用道具 举报

发表于 2008-8-2 00:06:55 | 显示全部楼层
出错可能
1 retrunbug的那几个函数你没有
2 gamecache没初始化

我觉得你还是先从基础学起吧
回复

使用道具 举报

 楼主| 发表于 2008-8-2 00:13:54 | 显示全部楼层
我也想  不过感觉J好难 想找个师傅 手把手的教
自己一个人只能大概看懂一些
我说的出错是触发器不能打开
地图都存不了
回复

使用道具 举报

发表于 2008-8-2 00:15:02 | 显示全部楼层
给图我看看,你这段J应该是没语法错误的
回复

使用道具 举报

发表于 2008-8-2 00:15:25 | 显示全部楼层
所以问下自定义脚本的内容写了吗??
回复

使用道具 举报

 楼主| 发表于 2008-8-2 00:21:14 | 显示全部楼层
求改.w3x (45 KB, 下载次数: 4)
回复

使用道具 举报

 楼主| 发表于 2008-8-2 00:23:14 | 显示全部楼层
请问猪头大大 什么是自定义脚本
呵呵我是新手嘛
回复

使用道具 举报

发表于 2008-8-2 00:23:39 | 显示全部楼层
[codes=jass]
function H2I takes handle h returns integer
    return h
    return 0
endfunction

function I2U takes integer i returns unit
    return i
    return null
endfunction

function I2TG takes integer i returns timerdialog
    return i
    return null
endfunction
[/codes]

把这段加在自定义代码处就可以了




所谓自定义代码处就是在触发器里地图名字的地方
回复

使用道具 举报

发表于 2008-8-2 00:24:05 | 显示全部楼层
在触发编辑器点左边的地图名字,就能看到了
回复

使用道具 举报

 楼主| 发表于 2008-8-2 00:26:46 | 显示全部楼层
那个自定义代码会不会跟别的J冲突啊
回复

使用道具 举报

发表于 2008-8-2 00:27:21 | 显示全部楼层
代码是自己写的啊,只要自己写的不冲突就好了
回复

使用道具 举报

 楼主| 发表于 2008-8-2 00:29:28 | 显示全部楼层
再请问猪头大大一个问题
地精里面有没有谁愿意收徒弟的
我想学J  可是教程看不懂 用T 太烦了
终于体会到J的好处  虽然要自己编
回复

使用道具 举报

发表于 2008-8-2 00:31:14 | 显示全部楼层
这个,我只知道拜师帖统统被移到番茄海水掉了(我也移掉不少)………………
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 点一下

本版积分规则

Archiver|移动端|小黑屋|地精研究院

GMT+8, 2024-7-21 02:26 , Processed in 0.110589 second(s), 19 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表