找回密码
 点一下
查看: 1946|回复: 4

继续关于japi的问题及讨论~~(已将所有文件发上~~)

[复制链接]
发表于 2009-3-9 13:14:06 | 显示全部楼层 |阅读模式
看到以前的贴已经沉了~~于是新发一个~~
问:
现在我已经将一切做好了。
但是创建新地图,后导入common.j之后。发现出现如下错误:
【未发现的本地函数。】
我仔细检查。发现应该是.xjp的链接出了些问题。
但是未发现与教程中相异的错误。
现发
组建步骤,请japi强人为我解答一下:
1.创建.dll工程(我用VC6.0)。
2.将.cpp文件传入工程。
3.组建.dll文件。
4.将.dll文件直接重命名为.xjp文件。
5.将.xjp复制到\jNatives目录下。
6.将japi.lst的内容改为jNatives\DataLibrary.xjp(我的.xjp文件的名字)
7.运行weloader.exe。
8.创建新地图,导入common.j。
9.显示错误。
希望高人解答~~

附:
jAddNative的代码:
[codes=C++]        jAddNative(InitDataLibrary,"InitDataLibrary","(II)I");
        jAddNative(FlushDataLibrary,"FlushDataLibrary","(I)I");
        jAddNative(SettingLibrary,"SettingLibrary","(I)V");
        jAddNative(SettingLibraryNull,"SettingLibraryNull","(V)V");
        jAddNative(GetRightLibrary,"GetRightLibrary","(I)I");
        jAddNative(GetIndexLine,"GetIndexLine","(I)I");
        jAddNative(InitNewLine,"InitNewLine","(III)I");
        jAddNative(LibraryAddNext,"LibraryAddNext","(I)I");
        jAddNative(FlushLine,"FlushLine","(I)V");
        jAddNative(InitLibraryLines,"InitLibraryLines","(I)V");
        //above is library's jass native

        jAddNative(SettingLine,"SettingLine","(I)V");
        jAddNative(SettingLineNull,"SettingLineNull","(V)V");
        jAddNative(SetLineInt,"SetLineInt","(II)V");
        jAddNative(SetLineReal,"SetLineReal","(IR)V");
        jAddNative(SetLineStr,"SetLineStr","(IS)V");
        jAddNative(GetLineInt,"GetLineInt","(I)I");
        jAddNative(GetLineReal,"GetLineReal","(I)R");
        jAddNative(GetLineStr,"GetLineStr","(I)S");
        jAddNative(GetRightLine,"GetRightLine","(I)I");
        jAddNative(GetIndexNode,"GetIndexNode","(I)I");
        jAddNative(InitNewNode,"InitNewNode","(II)I");
        jAddNative(LineAddNext,"LineAddNext","(II)I");
        jAddNative(FlushNode,"FlushNode","(I)V");
        jAddNative(InitLineElements,"InitLineElements","(I)V");
        jAddNative(InitLineNodes,"InitLineNodes","(I)V");
        //above is line's jass native

        jAddNative(SettingNode,"SettingNode","(I)V");
        jAddNative(SettingNodeNull,"SettingNodeNull","(V)V");
        jAddNative(SetNodeInt,"SetNodeInt","(II)V");
        jAddNative(SetNodeReal,"SetNodeReal","(IR)V");
        jAddNative(SetNodeStr,"SetNodeStr","(IS)V");
        jAddNative(GetNodeInt,"GetNodeInt","(I)I");
        jAddNative(GetNodeReal,"GetNodeReal","(I)R");
        jAddNative(GetNodeStr,"GetNodeStr","(I)S");
        jAddNative(GetRightNode,"GetRightNode","(I)I");
        jAddNative(NodeAddNext,"NodeAddNext","(I)I");
        jAddNative(InitNodeElements,"InitNodeElements","(I)V");
        //above is node's jass native[/codes]

common.j添加的内容:
[codes=jass]native InitDataLibrary takes integer index, integer size returns integer
//index = num of library(0-9), size = line size
native FlushDataLibrary takes integer index returns integer
//index = num of library(0-9)
native SettingLibrary takes integer pLibrary returns nothing
//setting library = plibrary
native SettingLibraryNull takes nothing returns nothing
native GetRightLibrary takes integer index returns integer
native GetIndexLine takes integer index returns integer
//index = location of line
native InitNewLine takes integer index, integer N_Num, integer E_Num returns integer
//index = location of line, N_Num = line's node size, E_Num = line's element size
native LibraryAddNext takes integer num returns integer
//num = line size
native FlushLine takes integer index returns nothing
//index = location of line
native InitLibraryLines takes integer L_Num returns nothing
//L_Num = line size
//above are library's jass natives

native SettingLine takes integer pLine returns nothing
//setting line = pline
native SettingLineNull takes nothing returns nothing
//below are work of setting line
native SetLineInt takes integer index, integer value returns nothing
native SetLineReal takes integer index, real value returns nothing
native SetLineStr takes integer index, string value returns nothing
native GetLineInt takes integer index returns integer
native GetLineReal takes integer index returns real
native GetLineStr takes integer index returns string
//index = location of element
native GetRightLine takes integer index returns integer
//index = location of node
native GetIndexNode takes integer index returns integer
//index = location of node
native InitNewNode takes integer index, integer num returns integer
//num = Element size, index = location of node
native LineAddNext takes integer num, integer E_Num returns integer
//num = Node size, E_Num = Element size
native FlushNode takes integer index returns nothing
//index = location of node
native InitLineElements takes integer E_Num returns nothing
native InitLineNodes takes integer N_Num returns nothing
//N_Num = Node size, E_Num = Element size
//above are line's jass natives

native SettingNode takes integer pNode returns nothing
//setting node = pnode
native SettingNodeNull takes nothing returns nothing
//below are work of setting node
native SetNodeInt takes integer index, integer value returns nothing
native SetNodeReal takes integer index, real value returns nothing
native SetNodeStr takes integer index, string value returns nothing
native GetNodeInt takes integer index returns integer
native GetNodeReal takes integer index returns real
native GetNodeStr takes integer index returns string
native GetRightNode takes integer index returns integer
//index = location of element
native NodeAddNext takes integer E_Num returns integer
native InitNodeElements takes integer E_Num returns nothing
//E_Num = Element size
//above are node's jass natives
[/codes]

japi_mine.rar

128 KB, 下载次数: 45

发表于 2009-3-10 16:23:43 | 显示全部楼层
不知道你用什么工具的,如果你用newgen的话,修改下ongameload.lua,加一个loaddll 自己japi的函数

我使用Newgen + japi一直很正常
回复

使用道具 举报

 楼主| 发表于 2009-3-10 16:29:10 | 显示全部楼层
我们家的newgen有问题…………不能测试魔兽
算了,直接将整个japi_mine文件夹发上吧~~
回复

使用道具 举报

发表于 2009-3-10 16:49:08 | 显示全部楼层
引用第2楼血戮魔动冰于2009-03-10 16:29发表的  :
我们家的newgen有问题…………不能测试魔兽……(居然告诉我没有魔兽CD囧)
(应该是我有问题不买正版吧(其实是丢了))
算了,直接将整个japi_mine文件夹发上吧~~

这个没关系,使用1.21b官方免CD的魔兽就可以了,另外,升级NewGen到最新的5b版,不过,需要修改一个配置文件才可以使用JAPI(NewGen 5b的BUG,把1.21b版本的魔兽当成1.22处理了)
NewGen的源代码我也研究了不少了,相对还是比较熟悉的。

可以加我Q讨论下
回复

使用道具 举报

 楼主| 发表于 2009-3-10 16:51:21 | 显示全部楼层
那你能帮我测试一下我的japi吗~~谢谢,就是附件~~
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-23 21:46 , Processed in 0.033508 second(s), 21 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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