请选择 进入手机版 | 继续访问电脑版
跳转到:
打印 上一主题 下一主题

[求助] 地图里面怎么用汉字

[复制链接]
LV4 Corporal

阅读权限
50
积分
521
食物
16
木材
13
钱币
13
茶叶
0
钻石
0
经验
518
跳转到指定楼层
楼主
发表于 2022-5-8 16:50:10 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
比如汉字提示,我定义一个string赋汉字就加载不了
LV20 ????

三好萌新

阅读权限
255
积分
32711
食物
4275
木材
2070
钱币
3544
茶叶
187
钻石
1325
经验
15287

幸运勋章

沙发
发表于 2022-5-8 18:03:38 | 只看该作者
只能调用srtingtabley的文字
比如我制作的某些地图的触发程序是需要使用酋长单位的,单一亚洲王朝是无法加载成功的,会卡住无法开局,然后我在开局聊天输出了下面的文字

        <String _locID="68440" symbol="cStringRequiresXpackContent">%s -- 需要“帝国时代 III: 战争酋长”资料片</String>


        rmCreateTrigger("Message2        active        runImmediately{"+"trChatSendSpoofed(0,\"{68440}\");trChatSendSpoofed(0,\"<color=0,1,0>If you don't have the WarChiefs"+" Content, please press the Alt + F4 key.\");xsDisableSelf();}/*");
        rmCreateTrigger("*/rule        _Message2End");





%s -- 需要“帝国时代 III: 战争酋长”资料片
If you don't have the WarChiefs Content, please press the Alt + F4 key.
回复
不是萌新,不是大佬,只是云玩家。
LV4 Corporal

阅读权限
50
积分
521
食物
16
木材
13
钱币
13
茶叶
0
钻石
0
经验
518
板凳
 楼主| 发表于 2022-5-8 19:22:26 | 只看该作者
青天小羽 发表于 2022-5-8 18:03
只能调用srtingtabley的文字
比如我制作的某些地图的触发程序是需要使用酋长单位的,单一亚洲王朝是无法加 ...

谢谢!我们可以用rmGetPlayerCiv()和rmGetPlayerName()获得玩家的一些信息,还能获得其他信息吗?哪里能查到这些函数的列表呀?
回复
LV20 ????

三好萌新

阅读权限
255
积分
32711
食物
4275
木材
2070
钱币
3544
茶叶
187
钻石
1325
经验
15287

幸运勋章

地板
发表于 2022-5-8 19:42:23 | 只看该作者
cms1314258 发表于 2022-5-8 19:22
谢谢!我们可以用rmGetPlayerCiv()和rmGetPlayerName()获得玩家的一些信息,还能获得其他信息吗?哪里能 ...

1.png

return7无法获取是错误的,只能说是我以前犯傻,不怎么懂语法,直接当成string字符输出了

2.png

3.png

回复
不是萌新,不是大佬,只是云玩家。
LV20 ????

三好萌新

阅读权限
255
积分
32711
食物
4275
木材
2070
钱币
3544
茶叶
187
钻石
1325
经验
15287

幸运勋章

5#
发表于 2022-5-8 20:25:50 | 只看该作者


487636277b6e2e5b8b.png

        oxy("rule _Debug46 active runImmediately { ");
        oxy("if((trTime()-cActivationTime) >= 2.00000000){");
        oxy("xsSetContextPlayer(0);");
        for(i=0;<8)
        {
                oxy("trChatSendSpoofed(0,\"Player:"+i+"rmGetPlayerCiv:"+rmGetPlayerCiv(i)+"\");");
                oxy("trChatSendSpoofed(0,\"Player:"+i+"rmGetPlayerCulture:"+rmGetPlayerCulture(i)+"\");");
                oxy("trChatSendSpoofed(0,\"Player:"+i+"rmGetPlayerTeam:"+rmGetPlayerTeam(i)+"\");");
                oxy("trChatSendSpoofed(0,\"Player:"+i+"rmGetHomeCityLevel:"+rmGetHomeCityLevel(i)+"\");");
                oxy("trChatSendSpoofed(0,\"Player:"+i+"rmGetNumberFairLocs:"+rmGetNumberFairLocs(i)+"\");");

        }
        for(i=0;<=3)
        {
                oxy("trChatSendSpoofed(0,\"Team:"+i+"rmGetNumberPlayersOnTeam:"+rmGetNumberPlayersOnTeam(i)+"\");");
        }
        oxy("trChatSendSpoofed(0,\"rmGetHighHomeCityLevel:"+rmGetHighHomeCityLevel()+"\");");
        oxy("trChatSendSpoofed(0,\"rmGetAverageHomeCityLevel:"+rmGetAverageHomeCityLevel()+"\");");
        oxy("trChatSendSpoofed(0,\"rmGetIsRelicCapture:"+rmGetIsRelicCapture()+"\");");
        oxy("trChatSendSpoofed(0,\"rmGetLowHomeCityLevel:"+rmGetLowHomeCityLevel()+"\");");

        oxy("trChatSendSpoofed(0,\"rmGetMapXSize:"+rmGetMapXSize()+"\");");
        oxy("trChatSendSpoofed(0,\"rmGetMapZSize:"+rmGetMapZSize()+"\");");
        oxy("trChatSendSpoofed(0,\"rmGetNomadStart:"+rmGetNomadStart()+"\");");
        oxy("trChatSendSpoofed(0,\"rmGetSeaLevel:"+rmGetSeaLevel()+"\");");
        oxy("xsDisableRule(\"_Debug46\");");
        oxyZ("}} /*");






       rule _Debug46 active runImmediately {
       if((trTime()-cActivationTime) >= 2.00000000){
       xsSetContextPlayer(0);
       trChatSendSpoofed(0,"Player:0rmGetPlayerName:大自然");
       trChatSendSpoofed(0,"Player:0rmGetPlayerCiv:0");
       trChatSendSpoofed(0,"Player:0rmGetPlayerCulture:-1");
       trChatSendSpoofed(0,"Player:0rmGetPlayerTeam:-1");
       trChatSendSpoofed(0,"Player:0rmGetHomeCityLevel:10");
       trChatSendSpoofed(0,"Player:0rmGetNumberFairLocs:0");
       trChatSendSpoofed(0,"Player:1rmGetPlayerName:1");
       trChatSendSpoofed(0,"Player:1rmGetPlayerCiv:20");
       trChatSendSpoofed(0,"Player:1rmGetPlayerCulture:12");
       trChatSendSpoofed(0,"Player:1rmGetPlayerTeam:0");
       trChatSendSpoofed(0,"Player:1rmGetHomeCityLevel:131");
       trChatSendSpoofed(0,"Player:1rmGetNumberFairLocs:0");
       trChatSendSpoofed(0,"Player:2rmGetPlayerName:拿破仑");
       trChatSendSpoofed(0,"Player:2rmGetPlayerCiv:3");
       trChatSendSpoofed(0,"Player:2rmGetPlayerCulture:1");
       trChatSendSpoofed(0,"Player:2rmGetPlayerTeam:0");
       trChatSendSpoofed(0,"Player:2rmGetHomeCityLevel:10");
       trChatSendSpoofed(0,"Player:2rmGetNumberFairLocs:0");
       trChatSendSpoofed(0,"Player:3rmGetPlayerName:海华沙");
       trChatSendSpoofed(0,"Player:3rmGetPlayerCiv:15");
       trChatSendSpoofed(0,"Player:3rmGetPlayerCulture:11");
       trChatSendSpoofed(0,"Player:3rmGetPlayerTeam:1");
       trChatSendSpoofed(0,"Player:3rmGetHomeCityLevel:10");
       trChatSendSpoofed(0,"Player:3rmGetNumberFairLocs:0");
       trChatSendSpoofed(0,"Player:4rmGetPlayerName:阿克巴大帝");
       trChatSendSpoofed(0,"Player:4rmGetPlayerCiv:21");
       trChatSendSpoofed(0,"Player:4rmGetPlayerCulture:13");
       trChatSendSpoofed(0,"Player:4rmGetPlayerTeam:0");
       trChatSendSpoofed(0,"Player:4rmGetHomeCityLevel:10");
       trChatSendSpoofed(0,"Player:4rmGetNumberFairLocs:0");
       trChatSendSpoofed(0,"Player:5rmGetPlayerName:拿骚的莫里斯");
       trChatSendSpoofed(0,"Player:5rmGetPlayerCiv:5");
       trChatSendSpoofed(0,"Player:5rmGetPlayerCulture:1");
       trChatSendSpoofed(0,"Player:5rmGetPlayerTeam:1");
       trChatSendSpoofed(0,"Player:5rmGetHomeCityLevel:10");
       trChatSendSpoofed(0,"Player:5rmGetNumberFairLocs:0");
       trChatSendSpoofed(0,"Player:6rmGetPlayerName:夸乌特莫克");
       trChatSendSpoofed(0,"Player:6rmGetPlayerCiv:17");
       trChatSendSpoofed(0,"Player:6rmGetPlayerCulture:9");
       trChatSendSpoofed(0,"Player:6rmGetPlayerTeam:0");
       trChatSendSpoofed(0,"Player:6rmGetHomeCityLevel:10");
       trChatSendSpoofed(0,"Player:6rmGetNumberFairLocs:0");
       trChatSendSpoofed(0,"Player:7rmGetPlayerName:Kira");
       trChatSendSpoofed(0,"Player:7rmGetPlayerCiv:27");
       trChatSendSpoofed(0,"Player:7rmGetPlayerCulture:15");
       trChatSendSpoofed(0,"Player:7rmGetPlayerTeam:1");
       trChatSendSpoofed(0,"Player:7rmGetHomeCityLevel:10");
       trChatSendSpoofed(0,"Player:7rmGetNumberFairLocs:0");
       trChatSendSpoofed(0,"Team:0rmGetNumberPlayersOnTeam:4");
       trChatSendSpoofed(0,"Team:1rmGetNumberPlayersOnTeam:4");
       trChatSendSpoofed(0,"Team:2rmGetNumberPlayersOnTeam:0");
       trChatSendSpoofed(0,"Team:3rmGetNumberPlayersOnTeam:0");
       trChatSendSpoofed(0,"rmGetHighHomeCityLevel:131");
       trChatSendSpoofed(0,"rmGetAverageHomeCityLevel:25");
       trChatSendSpoofed(0,"rmGetIsRelicCapture:0");
       trChatSendSpoofed(0,"rmGetLowHomeCityLevel:10");
       trChatSendSpoofed(0,"rmGetMapXSize:310");
       trChatSendSpoofed(0,"rmGetMapZSize:310");
       trChatSendSpoofed(0,"rmGetNomadStart:0");
       trChatSendSpoofed(0,"rmGetSeaLevel:0.000000");
       xsDisableRule("_Debug46");
       }







一般来说:rm命令不建议使用rmGetPlayerName,会出严重问题
1.AI名称由于stringtabley不统一造成无法同步(我曾经用来测试两个人分别加载不同地形)
2.触发程序因为中文字全部失效
3.自己体会

取而代之可以使用kbGetPlayerName;只能用于触发程序
        oxy("rule _Debug47 active runImmediately { ");
        oxy("if((trTime()-cActivationTime) >= 2.00000000){");
        for(i=0;<=8)
        {
                oxy("xsSetContextPlayer("+i+");");
                oxy("trChatSendSpoofed(0,\"Player:"+i+";kbGetPlayerName("+i+"):\"+kbGetPlayerName("+i+"));");

        }
        oxy("xsDisableSelf();");
        oxyZ("}} /*");

上面最终输出,因为原代码层不涉及中文字,所以能成功输出
      rule _Debug47 active runImmediately {  
      if((trTime()-cActivationTime) >= 2.00000000){
      xsSetContextPlayer(0);
      trChatSendSpoofed(0,"Player:0;kbGetPlayerName(0):"+kbGetPlayerName(0));
      xsSetContextPlayer(1);
      trChatSendSpoofed(0,"Player:1;kbGetPlayerName(1):"+kbGetPlayerName(1));
      xsSetContextPlayer(2);
      trChatSendSpoofed(0,"Player:2;kbGetPlayerName(2):"+kbGetPlayerName(2));
      xsSetContextPlayer(3);
      trChatSendSpoofed(0,"Player:3;kbGetPlayerName(3):"+kbGetPlayerName(3));
      xsSetContextPlayer(4);
      trChatSendSpoofed(0,"Player:4;kbGetPlayerName(4):"+kbGetPlayerName(4));
      xsSetContextPlayer(5);
      trChatSendSpoofed(0,"Player:5;kbGetPlayerName(5):"+kbGetPlayerName(5));
      xsSetContextPlayer(6);
      trChatSendSpoofed(0,"Player:6;kbGetPlayerName(6):"+kbGetPlayerName(6));
      xsSetContextPlayer(7);
      trChatSendSpoofed(0,"Player:7;kbGetPlayerName(7):"+kbGetPlayerName(7));
      xsSetContextPlayer(8);
      trChatSendSpoofed(0,"Player:8;kbGetPlayerName(8):"+kbGetPlayerName(8));
      xsDisableSelf();
      }}
127936277bd58a3645.png





回复
不是萌新,不是大佬,只是云玩家。
您需要登录后才可以回帖 登录 | 注册

本版积分规则