I'm creating a new object

Posted by Kingsmill on Sat 15 Jul 2006 05:22 PM — 27 posts, 89,653 views.

USA #0
I tried to put this in the area editor code but my version of visual c++ didn't like it, however if I can't change the editor I'd like to change the smaug server itself or the area file itself, and I want to know where(I should put code), plus how(I should adapt the code).
This was my code for the area editor:
case ITEM_RING:
{
CString strResult;

if (m_pDoc->skill_name (value[1], true) != "NONE")
strResult += "'" + m_pDoc->skill_name (value[1]) + "' ";
if (m_pDoc->skill_name (value[2], true) != "NONE")
strResult += "'" + m_pDoc->skill_name (value[2]) + "' ";
if (m_pDoc->skill_name (value[3], true) != "NONE")
strResult += "'" + m_pDoc->skill_name (value[3]) + "' ";

if (strResult.IsEmpty ())
strResult = "'NONE'";

return CFormat ("Level %i, max charges: %i, charges: %i, spell(s): %s",
value[0],
value[1],
value[2],
(LPCTSTR) strResult);
}
(Thanks in advance...)
USA #1
Are you compiling SMAUG, or Nick's Area Editor? If the former, what is this 'area editor' you are referring to? If the latter, this should be in the area editor section. :-)

Anyhow, you will need to be more specific than simply saying that VC++ "didn't like it". What was the error message?
USA #2
Yes, I am using the area editor that Nick created,
I believe that I am using too recent of a version.
It gives no errors but gives a couple of warnings,
and I've already gotten rid of the VC++.
I would like to know where to get the right version of VC++
in a trial version...
Australia Forum Administrator #3
Trial version? As in you don't pay for it?

Don't know if there is such a beast. The Area Editor uses MFC libraries so you probably (almost certainly) can't compile it with g++ or the Borland or other compilers.

The modern versions of the Microsoft compilers will probably compile it, possibly after doing some work to bring it up to date.
USA #4
I used a trial version of vc++ on it and it didn't work...
USA #5
If you go to the Microsoft Development Network (msdn.microsoft.com), they have an "Express" VC++ version that is in fact free and comes with the bells and whistles you need. (The catch is that you're not supposed to use it for commercial software.) Is that the trial version you are referring to?

If you got warnings but no errors, that's probably quite ok. What were the warnings you got? You need to tell us so we can figure out how to help. :-)
Australia Forum Administrator #6
When you create a new thread in this forum (in this section) it says this:


If there is an error, an exact copy of the error message(s) ...


Saying "it didn't work" is not an exact copy of the error message. It is impossible to help you if you don't tell us the message(s).
USA #7
AreaEditor : warning PRJ0041 : Cannot find missing dependency 'afxres.h' for file 'AreaEditor.rc'. Your project may still build, but may continue to appear out of date until this file is found.


AreaEditor : warning PRJ0041 : Cannot find missing dependency 'afxres.rc' for file 'AreaEditor.rc'. Your project may still build, but may continue to appear out of date until this file is found.


AreaEditor : warning PRJ0041 : Cannot find missing dependency 'afxprint.rc' for file 'AreaEditor.rc'. Your project may still build, but may continue to appear out of date until this file is found.

Creating temporary file "i:\areaeditor_source_1.35\areaeditor\Debug\RSP0000018002896.rsp" with contents
[
/Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_VC80_UPGRADE=0x0600" /D "_AFXDLL" /Gm /EHsc /MDd /Yc"stdafx.h" /Fp".\Debug/AreaEditor.pch" /Fo".\Debug/" /Fd".\Debug/" /FR".\Debug\\" /W3 /c /ZI /TP .\StdAfx.cpp
]
Creating command line "cl.exe @i:\areaeditor_source_1.35\areaeditor\Debug\RSP0000018002896.rsp /nologo /errorReport:prompt"
Creating temporary file "i:\areaeditor_source_1.35\areaeditor\Debug\RSP0000028002896.rsp" with contents
[
/Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_VC80_UPGRADE=0x0600" /D "_AFXDLL" /Gm /EHsc /MDd /Yu"stdafx.h" /Fp".\Debug/AreaEditor.pch" /Fo".\Debug/" /Fd".\Debug/" /FR".\Debug\\" /W3 /c /ZI /TP .\Socials.cpp

There are the errors, I was wrong there are errors...
USA #8
Sorry guys but I had uninstalled vc++ when I made this thread and I just got it back...
Thus I did NOT have the errors.
But now I do and I have them posted in the post above.
Thank you for putting up with me.
USA #9
I'm a little confused; are those warnings before or after uninstalling or reinstalling VC++? The more precise you are the more we can help you.

Also I don't see any errors, just several warning messages; are there more messages?
USA #10
i:\areaeditor_source_1.35\areaeditor\stdafx.h(22) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directory
BSCMAKE: error BK1506 : cannot open file '.\Debug\AreaEditor.sbr': No such file or directory
USA #11
OK. Could you explain in as much detail as possible what you have done to install VC++, what version, etc.?

You might need to install the Platform SDK if you don't have it already. It should be available on the MSDN site.
USA #12
I am using the express version of vc++ and when I used it it updated all my area editor files then gave me those errors and warnings.
USA #13
When you say that it updated your area editor files, do you mean that it updated the project files? (Please try to be very specific in these matters.)

Did you install the Platform SDK? You might need that for some of the MFC stuff.
USA #14
I only saw vc++ do it once so my memory isn't great, but it said something about project files...
Which files should I download from the site ?
USA #15
You should be careful about the messages it gives you; they are very important and the slightest detail could mean the success or failure of a project. It also makes it much easier to help if we know exactly what happened.

You want the Platform SDK from the MSDN site. (msdn.microsoft.com) Go in Visual C++ > Downloads > Microsoft Products and SDKs and get the Platform SDK. It'll take a while to download and install but if you want to do Windows development you'll most probably need it.
USA #16
Well, next time I royaly screw something up I'll remember to copy&paste everything that pops up into a notepad doc...
USA #17
I am away from my computer now but I managed to start the installation so it installs while I'm away.
Australia Forum Administrator #18
On the page from which you downloaded the Area Editor source, it says "The source uses MFC (Microsoft Foundation Class) libraries ...".

Your error messages are referring to MFC include files:


Cannot find missing dependency 'afxres.h'
Cannot find missing dependency 'afxres.rc'
Cannot open include file: 'afxwin.h': No such file or directory


There files are part of the MFC libraries - I cannot supply those, for one thing that would not be permitted by Microsoft, for another you need a lot of other files as well (such as the libraries to link against).

I was wondering whether this Visual Studio 2005 Express Edition (which I had not previously heard about) supports MFC, so I went to their forum page:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=126606&SiteID=1&PageID=1

This is what I found:




>> I would like to ask: Can I develop MFC applications in Visual C++ Express?

> Unfortunately no, you need Visual Studio Standard or higher to develop MFC applications.
>
> Thanks,
> Dan Fernandez
> Product Manager





According to this page:

http://msdn.microsoft.com/vstudio/howtobuy/default.aspx

Visual Studio 2005 Standard Edition full version retails for $US 299.00.

I doubt if you will be able to compile the Area Editor with any "free tool", I am sorry, but I paid for the Visual Studio (years ago) to develop the program. I am happy to make the source code available, as I have done, but you will need to purchase the Visual Studio 2005 Standard Edition (or equivalent product) to compile it yourself.

I compiled it myself under Microsoft Visual C++ compiler version 6.0, it is possible you will be able to find a cheap copy of that, as that is years old (1994-1998 according to the About box).

I'm not sure I would spend $299 just to be able to compile the Area Editor to make a minor change. Perhaps there is another way of achieving the same result?
USA #19
Just in case it matters, I just tested the source and it compiled correctly without any problems. This was using MSC++ .NET.
USA #20
A lot of schools have MS Visual Studio available for relatively cheap or even free, but only for students. You mentioned going to school in the near future, I think, so that might be another option.

You could always try Googling for them, I suppose, if you're really desperate, but I would suggest going with what Nick said and seeing if there's another way for you to achieve the same result.
USA #21
Would I be able to edit the smaug code directly to make this object type available ?
Or would I have to edit something else, or would it just flat out not be posible until I get into school again ?
Australia Forum Administrator #22
Quote:

... if I can't change the editor I'd like to change the smaug server itself or the area file itself, ...


If you want to add a new object type to the MUD, then you need to change the smaug server.

I strongly suggest you carefully read this page:

http://www.gammon.com.au/smaug/howtocompile.htm

You seem to be confused about the difference between the source files, the object files, the executable, the area files, and what each one does. That page tries to explain all that.

I should point out that if you change the server a lot, the Area Editor may no longer be useful for editing the area files. However you can always edit the area files "by hand", that is with a text editor.
USA #23
If I were to edit act_obj.c would I have to create my new item in the middle or the end of the file ?
I plan to do this:
-create an item a "ring"
-make it have both the charges/max charges that wands and staves have but also have three spells instead of one
-and if I have enough time make it be sacrificable
USA #24
I'm confused, I think.

What does creating a new object have to do with coding? Unless you want to create a new item type?
USA #25
Oh, I'm sorry, yes I am creating a new item type, I forgott to specify.
I am creating a ring that will be worn on either finger r or l, it will have everything I mentioned before and I don't think I could make a new item type without coding.
USA #26
Yes, Kingsmill, I think you need to be clear on the differences between building online using the in-game building controls, and then what's in the coding, etc. I would suggest looking through building guides; Herne's seems to be fairly good. (It's also the only one I really know about...)

It sounds like what you're doing can for the most part be done strictly in-game. Not sure about having three spells, though.