3DMGAME 3DM首页 新闻中心 前瞻 | 评测 游戏库 热门 | 最新 攻略中心 攻略 | 秘籍 下载中心 游戏 | 汉化 购买正版 论坛

注册 登录

QQ登录

只需一步,快速开始

查看: 9061|回复: 70
打印 上一主题 下一主题

[讨论] 简单的动作+计时Script心得 两天两夜的成果

  [复制链接]

57

主题

1664

帖子

2001

积分

游戏达人

Rank: 7Rank: 7Rank: 7

贡献度
258
金元
9685
积分
2001
精华
0
注册时间
2009-6-22
跳转到指定楼层
主题
发表于 2011-6-12 19:53 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 qjyuio 于 2011-6-14 17:10 编辑

花费了我两天的时间

整体结构已经测试,表现的很好。
主要是因为本人没有什么Script基础 所以说这两天基本决定了我对辐射Script的基础。

如果看不懂这楼的话请看二楼


本Script的基本构架,这个Script只是晕倒部分,玩家醒来部分在三楼。

这个是吃下某不知名植物之后玩家晕倒然后白光一闪传送到别处的动画
植物是Activator,Script使用Object格式


scn ZombiemodDemoScript

REF teleportLocation       /传送地点
short button                  /建立一个按钮短句
float timer                    /建立一个计时器短句
short stage                   /建立一个流程短句
Short TimerCheck          /建立一个检查时间短句,不过此短句并不止用来检查计时器是否开始,还用作检查物体是否被激活过

Begin OnActivate Player           /当玩家激活此Activator的时候运算
if timercheck == 3
   物体已经被激活过后,检查时间短句等于3的时候,随便加一些指令,比如说ShowMessage。
else          /其他情况,下为了保险我把检查时间设置成0

      ShowMessage XXX     /XXX为自定义名称
      ZombieModeEnterREF.activate player       /这个是循环此Script的关键,没有这一行的话Script只会跑一遍,至少我测试如此……
     set timercheck to 0          /保险设置,免得出错

endif       /此条件结束
end        /以上Begin结束


Begin GameMode               /开始游戏模式,不经过任何激活也运算
    if timercheck == 0         /如果检查时间等于 0 ,上面已经保险设置为0
     Set Timer to 300               /计时器数值设定为 300
     Set Stage to 0                   /设定流程为 0
     Set Button to GetButtonPressed      /设定按钮为前面ShowMessage中按下的Message的按钮。
     Set timercheck to 1                        /设定检查时间为 1
       if timercheck == 1     /如果检查时间等于 1,上面刚刚设定
  set Timer to Timer - GetSecondsPassed       /把时间设定为时间减去流逝秒数,也就是倒计时,单位秒。
          if button == 1              /如果按钮等于 1
                 ;nothing       /没有什么事情发生
          elseif Button == 0                   /如果是按钮等于 0
              if ( timer <=  300 && Stage == 0 )         附加条件 时间小于 300 流程 为 0

                     Set TeleportLocation to XXX         /把 XXX 传送地点设置为 XMarker的 REF
                     Player.addscriptpackage VCG01PlayerSection0     这个是动画,摇晃镜头,倒下的镜头我还在找……
                     imod vault106HallucinationISFX       /Imagespacemodifer,屏幕变蓝
                     set stage to 2                           /流程为2

              endif
              IF ( timer <= 180 && Stage == 2 )        /附加条件的流程2,时间小于180的时候,也就是 120个时间单位之后
                    RemoveImageSpaceModifier vault106HallucinationISFX    移除蓝色渲染修改器
                    imod WhiteISFX                         /增加白色渲染修改器,屏幕完全变白
                    Set stage to 3                           /把流程设置为3
                 endif

              IF ( timer <= 120 && Stage == 3 )
                    player.removescriptpackage                   /玩家移除所有强制性的动作
                    RemoveImageSpaceModifier WhiteISFX   /移除渲染修改器,镜头恢复正常
                    Set Timercheck to 3                              /时间检查设置为3,也就是说Activator现在再使用的话就不再是这个流程,而是上面的那个Timercheck == 3的流程
                    Player.MoveTo TeleportLocation
                 endif
       endif
     endif
End


最终Script如下

scn ZombiemodDemoScript
REF teleportLocation
short button
float timer
short stage
Short TimerCheck
Begin OnActivate Player
if timercheck == 3
      ShowMessage ZombieMODEnterTried
else
      ShowMessage ZombieMODEnter
      ZombieModeEnterREF.activate player
     set timercheck to 0
endif
end
Begin GameMode
    if timercheck == 0
Set Timer to 300
     Set Stage to 0
     Set Button to GetButtonPressed
     Set timercheck to 1
    endif
       if timercheck == 1
  set Timer to Timer - GetSecondsPassed
          if button == 1
                 ;nothing
          elseif Button == 0
              if ( timer <=  300 && Stage == 0 )
                     Set TeleportLocation to ZombieMODPlayerStartREF
                     Player.addscriptpackage VCG01PlayerSection0
                     imod vault106HallucinationISFX
                     set stage to 2
              endif
              IF ( timer <= 180 && Stage == 2 )
                    RemoveImageSpaceModifier vault106HallucinationISFX
                    imod WhiteISFX
                    Set stage to 3
                 endif

              IF ( timer <= 120 && Stage == 3 )
                    player.removescriptpackage
                    RemoveImageSpaceModifier WhiteISFX
                    Set Timercheck to 3
                    Player.MoveTo TeleportLocation
                 endif
       endif
     endif
End

评分

3

查看全部评分

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|3DMGAME ( 京ICP备14006952号-1  沪公网安备 31011202006753号

GMT+8, 2026-5-27 23:10 , Processed in 0.027479 second(s), 17 queries , Memcached On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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