.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Raging Tiger- Save $9.00
World Supremacy- Save $9.00

   







Go Back   .com.unity Forums > Illwinter Game Design > Dominions 3: The Awakening > Scenarios, Maps and Mods

Reply
 
Thread Tools Display Modes
  #1  
Old October 8th, 2006, 12:15 PM

Leif_- Leif_- is offline
Sergeant
 
Join Date: Sep 2003
Location: Norway
Posts: 346
Thanks: 0
Thanked 0 Times in 0 Posts
Leif_- is on a distinguished road
Default Emacs modes for mods and maps

I've thrown together two major modes for Emacs, dommod-mode and dommap-mode, for editing Dominions mods and .map files respectively. The modes mainly do syntax highlighting, and some simple navigation. They're still not up-to-date with Dominions 3 keywords, as I haven't got a copy of the up-to-date modding manuals. Let me know if you have any requests or complaints for them.

Edit: New mode files with support for Dominions 3. Now attached to this post rather than posted elsewhere.
Attached Files
File Type: zip 454138-Emacs_modes.zip (4.1 KB, 90 views)
__________________
"Freefall, my old nemesis! All I have to do is activate my compressed gas rocket boots and I will cheat you once again! Belt control ON!…On?" [i]Othar Trygvasson[i]
Reply With Quote
  #2  
Old October 8th, 2006, 02:31 PM
Johan K's Avatar

Johan K Johan K is offline
Brigadier General
 
Join Date: Aug 2003
Location: Mictlan
Posts: 1,767
Thanks: 12
Thanked 165 Times in 22 Posts
Johan K is on a distinguished road
Default Re: Emacs modes for mods and maps

Cool, now how do I install it?
__________________
http://www.illwinter.com
Reply With Quote
  #3  
Old October 8th, 2006, 02:43 PM

Leif_- Leif_- is offline
Sergeant
 
Join Date: Sep 2003
Location: Norway
Posts: 346
Thanks: 0
Thanked 0 Times in 0 Posts
Leif_- is on a distinguished road
Default Re: Emacs modes for mods and maps

Put the two files somewhere in Emacs' loadpath. It varies by system, but you can display yours by entering emacs and asking for help on the variable load-path (C-h i). The directory ~/.emacs.d is often on the load-path for many systems, and if it isn't, you can add it by inserting the following line early in your .emacs file:

(setq load-path (cons "~/.emacs.d" load-path))

Now, add the two lines below to your .emacs file:

('require dommod-mode)
('require dommap-mode)

Opening any file with the ending .dm or .map should active the correct mode; although you might have to turn on font lock manually (again, depending on your emacs setup): M-x font-lock-fontify-buffer

Alternatively, and easier if you just want to try them out to see if they're useful, you can load them manually. M-x load-file and specify either dommap-mode.el or dommod-mode.el; then open a .map or .dm file.

P.S. A really good resource on Emacs is the EmacsWiki
__________________
"Freefall, my old nemesis! All I have to do is activate my compressed gas rocket boots and I will cheat you once again! Belt control ON!…On?" [i]Othar Trygvasson[i]
Reply With Quote
  #4  
Old October 8th, 2006, 03:01 PM

Tortanick Tortanick is offline
Corporal
 
Join Date: Mar 2006
Posts: 93
Thanks: 0
Thanked 0 Times in 0 Posts
Tortanick is on a distinguished road
Default Re: Emacs modes for mods and maps

Of course you must now do Vi or face a swarm of zelots ;p
Reply With Quote
  #5  
Old October 8th, 2006, 05:30 PM
Johan K's Avatar

Johan K Johan K is offline
Brigadier General
 
Join Date: Aug 2003
Location: Mictlan
Posts: 1,767
Thanks: 12
Thanked 165 Times in 22 Posts
Johan K is on a distinguished road
Default Re: Emacs modes for mods and maps

This was harder than I thought. I get this cryptic error (I know nothing about emacs lisp files) after having added "require 'dommod-mode" to my .emacs.

File mode specification error: (void-function dommod-mode)

Trace:

Debugger entered--Lisp error: (void-function delete-duplicates)
(delete-duplicates (append dommod-mode-weapon-keywords dommod-mode-armor-keywords dommod-mode-monster-basic-keywords dommod-mode-monster-advanced-keywords dommod-mode-spell-keywords dommod-mode-item-keywords dommod-mode-name-keywords dommod-mode-nation-keywords))
(regexp-opt (delete-duplicates (append dommod-mode-weapon-keywords dommod-mode-armor-keywords dommod-mode-monster-basic-keywords dommod-mode-monster-advanced-keywords dommod-mode-spell-keywords dommod-mode-item-keywords dommod-mode-name-keywords dommod-mode-nation-keywords)) t)
(concat "^" (regexp-opt (delete-duplicates ...) t) "\\>")
(list (concat "^" (regexp-opt ... t) "\\>") (quote (1 font-lock-function-name-face)))
(list (list (concat "^" ... "\\>") (quote ...)) (list (concat "^" ... "\\>") (quote ...)) (list (concat "^" ... "\\>") (quote ...)) (list (concat "^" ... "\\>") (quote ...)) (list (concat "^" "\\(-- ==.*\\)" "\\>") (quote ...)) (list (concat "^" "\\(==.*\\)" "\\>") (quote ...)))
(progn (list (list ... ...) (list ... ...) (list ... ...) (list ... ...) (list ... ...) (list ... ...)))
(eval-when-compile (list (list ... ...) (list ... ...) (list ... ...) (list ... ...) (list ... ...) (list ... ...)))
(defvar dommod-mode-font-lock-keywords (eval-when-compile (list ... ... ... ... ... ...)))
eval-buffer(#<buffer *load*<2>> nil "dommod-mode" nil t)
load-with-code-conversion("/usr/share/emacs/21.4/lisp/progmodes/dommod-mode.el" "dommod-mode" nil t)
require(dommod-mode)
eval-buffer(#<buffer *load*> nil "~/.emacs" nil t)
load-with-code-conversion("/home/jk/.emacs" "~/.emacs" t t)
load("~/.emacs" t t)
#[nil "&#133;&#151;
__________________
http://www.illwinter.com
Reply With Quote
  #6  
Old October 8th, 2006, 05:43 PM

Leif_- Leif_- is offline
Sergeant
 
Join Date: Sep 2003
Location: Norway
Posts: 346
Thanks: 0
Thanked 0 Times in 0 Posts
Leif_- is on a distinguished road
Default Re: Emacs modes for mods and maps

Hmm. The error is that I've used a function, delete-duplicates, that's apparently not part of your Emacs environment. Sorry about that, I was under the impression that it was a standard function.

I'll look into removing that function call or finding out where the delete-duplicates function can be found.

Okay, found it. delete-duplicates is from a CommonList extension to Emacs. If you're lucky it's already installed, just not automatically loaded. Try adding the line "(require 'cl)" to your .emacs file, before the two require statements for dommod-mode and dommap-mode.

If that doesn't sort it, you'll have to find and download this package (it's hopefully a standard package for your distribution); and if that doesn't work, let me know and I'll try to rewrite the code to do away with those function calls. That might take some time before I get the opportunity to do, though.

__________________
"Freefall, my old nemesis! All I have to do is activate my compressed gas rocket boots and I will cheat you once again! Belt control ON!…On?" [i]Othar Trygvasson[i]
Reply With Quote
  #7  
Old October 8th, 2006, 06:09 PM
Johan K's Avatar

Johan K Johan K is offline
Brigadier General
 
Join Date: Aug 2003
Location: Mictlan
Posts: 1,767
Thanks: 12
Thanked 165 Times in 22 Posts
Johan K is on a distinguished road
Default Re: Emacs modes for mods and maps

It worked, thanks!
__________________
http://www.illwinter.com
Reply With Quote
  #8  
Old October 14th, 2006, 10:45 AM

Tortanick Tortanick is offline
Corporal
 
Join Date: Mar 2006
Posts: 93
Thanks: 0
Thanked 0 Times in 0 Posts
Tortanick is on a distinguished road
Default Re: Emacs modes for mods and maps

where would you find the loadpath or .emacs file on windows?
Reply With Quote
  #9  
Old October 14th, 2006, 10:54 AM

Leif_- Leif_- is offline
Sergeant
 
Join Date: Sep 2003
Location: Norway
Posts: 346
Thanks: 0
Thanked 0 Times in 0 Posts
Leif_- is on a distinguished road
Default Re: Emacs modes for mods and maps

I think it's easier if I just refer to what the Emacs Wiki has to say on loadpaths. (Read the bit at the bottom about debugging first.)
__________________
"Freefall, my old nemesis! All I have to do is activate my compressed gas rocket boots and I will cheat you once again! Belt control ON!…On?" [i]Othar Trygvasson[i]
Reply With Quote
  #10  
Old October 14th, 2006, 11:02 AM

Leif_- Leif_- is offline
Sergeant
 
Join Date: Sep 2003
Location: Norway
Posts: 346
Thanks: 0
Thanked 0 Times in 0 Posts
Leif_- is on a distinguished road
Default Re: Emacs modes for mods and maps

Note!

There's a new version of the emacs modes with support for the Dominions 3 specific keywords. They can be found attached to the first post of this thread.
__________________
"Freefall, my old nemesis! All I have to do is activate my compressed gas rocket boots and I will cheat you once again! Belt control ON!…On?" [i]Othar Trygvasson[i]
Reply With Quote
Reply

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 06:30 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2024, Shrapnel Games, Inc. - All Rights Reserved.