View Full Version : Dungeon Adventure MOD MOD
Lutefisk Mafia Mar 18, 2008, 01:51 PM I am posting this to share some progress I've made with a FfH2 MOD MOD I've been working on.
Basically, I am trying to convert the game to make it more of a dungeon adventure. As I get into this more, I realize what an insane amount of work it is and just how finicky the Civ4 engine can be (often spits out new NIFs).
Pre-Alpha release here: http://forums.civfanatics.com/showpost.php?p=6820283&postcount=400
patch "a" (unzip into "Adventure" subfolder of Mods directory) = http://www.atomicgamer.com/file.php?id=69364
A replacement shortcut is posted below. It may resolve some Vista issues. On the other hand, it may not. Vista is like that.
http://www.atomicgamer.com/file.php?id=69467
Here is a link to the Intro Movie, posted on YouTube:
http://www.youtube.com/watch?v=VhFzrzvS5nk
Here are some in-game videos that show certain features:
Claim function = http://www.youtube.com/watch?v=0OI1BAPtwDA
Snack Rats and Weirdeer = http://www.youtube.com/watch?v=DJK5T6Z8ETw
The Green Death = http://www.youtube.com/watch?v=R42BAWVEHZY
Bats = http://www.youtube.com/watch?v=Nmx_ygFFpl4
Altars = http://www.youtube.com/watch?v=dsWZ5WWco6Q
Glyph and Trap = http://www.youtube.com/watch?v=uMYvv7yN0M4
Lantern and Unknown Potion = http://www.youtube.com/watch?v=Cv5mdl04dkc
Here are some screenies:
Starting Malakim Base Camp in Dungeon
http://img515.imageshack.us/img515/8051/adventure10000tk8.jpg
WorldBuilder look at larger area
http://img177.imageshack.us/img177/6702/adventure20000zd1.jpg
OooH! A Dragon's Lair!
http://img177.imageshack.us/img177/2513/adventure30000cp8.jpg
Across the lava, kill the Azer, and get the Hammer. But how?
http://img357.imageshack.us/img357/4572/adventure40000ld9.jpg
Explorer comes to a door
http://img357.imageshack.us/img357/2306/adventure50000gt0.jpg
And, yes, these doors open!
http://img357.imageshack.us/img357/4923/adventure60000yr9.jpg
Hmmn. A void in the central area, but no door?
http://img357.imageshack.us/img357/4236/adventure70000we4.jpg
Let's go up here and use the Thief's "Search" ability (one of the potion icons)
http://img515.imageshack.us/img515/3960/adventure80000fm4.jpg
Hey! I found a secret door!
http://img177.imageshack.us/img177/2537/adventure90000wg0.jpg
Anyway, I've added some neat things -- new textures and features, secret doors, regular doors, a few new potions and equipment, monster spawning sites.
I even figured out a way to make certain resources (like horses) moveable. The idea is that you can find horses in the dungeon and "pick them up." Either use them as a "mounted promotion" or drop them near your camp site to be used by your henchmen who hang out there. Leaving horses at the campsite can make it possible to upgrade along certain paths later in the game.
I envision a classic dungeon crawl along the lines of a very simplified D&D adventure. This mod would be more like a version of Rogue actually. (Bonus points if you are old enough to even know what Rogue is!)
Anyhow, I think I have a good start, but could use help and suggestions. I would be thrilled to collaborate with Kael and the FfH2 team, but don't know if they would be interested in working on yet another project.
But I'm happy to share my work, and would really appreciate any feedback. (Disclaimer: This is the first time I've done any work in XML or Python, so my approach to programming is: Bang on it until it works. The results are functional, but by no means elegant!)
Thanks!
woodelf Mar 18, 2008, 01:59 PM I think this looks super. :thumbsup: And I do remember playing Rogue and Dungeon Hack and Nethack. :)
I don't have much to add right now, but if you need anything graphically let me know and I'll try to help you out.
xienwolf Mar 18, 2008, 02:05 PM Wow... kinda harsh you did all this work and .31 has a feature built into it to incorporate many things which you did, but it looks awesome, and I am sure that you can mix what you did with the new stuff to get some incredible results.
kenken244 Mar 18, 2008, 02:08 PM The Dragon horde screenshot makes me wonder if you could steal his horde since he is not on it. You could stack them and give the horde the always visible tag so it will still appear even when arceron is stacked with it.
Vehem Mar 18, 2008, 02:08 PM This really does look excellent - nice work :goodjob:
Lutefisk Mafia Mar 18, 2008, 02:32 PM The Dragon horde screenshot makes me wonder if you could steal his horde since he is not on it. You could stack them and give the horde the always visible tag so it will still appear even when arceron is stacked with it.
This Archeron can move and chase people. The mod right now is coded so that only the human player can open doors. So Archeron has free run of only his room.... until you open the door that is.
It is possible for a fast character or a Thief (sneaking) to get the gold before Archeron can react. Adds to gameplay!
Lutefisk Mafia Mar 18, 2008, 02:34 PM Wow... kinda harsh you did all this work and .31 has a feature built into it to incorporate many things which you did, but it looks awesome, and I am sure that you can mix what you did with the new stuff to get some incredible results.
Oh. Well, crap.
I guess I will look forward to .31 then. Still, I might be able to salvage something worthwhile.
woodelf Mar 18, 2008, 02:49 PM Definitely don't despair! This is a great concept.
thomas.berubeg Mar 18, 2008, 02:51 PM Amazing Work!
xienwolf Mar 18, 2008, 02:57 PM Aye, it is great work. The walls, doors, abilities and all of that is still quite useful. I guess you had missed the post about "Adventure Mode" so here is a link to it (http://forums.civfanatics.com/showpost.php?p=6609069&postcount=374).
Kael Mar 18, 2008, 03:08 PM This is amazing work and it doesn't conflict at all with what we are doing. "Adventure Mode" is a game option that makes things like this easier. It drops all units to single unit meshes (so there is never more than 1 unit in a group) and it doubles the scale of all objects.
The real work that you are doing around design of objects, unit abilities, etc is the real work and isnt done at all in the main mod. So Im hoping we will just make your job easier.
Lutefisk Mafia Mar 18, 2008, 03:25 PM This is amazing work and it doesn't conflict at all with what we are doing. "Adventure Mode" is a game option that makes things like this easier. It drops all units to single unit meshes (so there is never more than 1 unit in a group) and it doubles the scale of all objects.
The real work that you are doing around design of objects, unit abilities, etc is the real work and isnt done at all in the main mod. So Im hoping we will just make your job easier.
Thank you, Kael! That definitely cheers me up. And it seems like there is sufficient interest in something like this to justify further work on it. So, I'll keep plugging away at it and try to post updates on my progress in this thread from time to time.
BTW, to all of you folk on the FfH2 development team: What is it about adding new NIFs that the Civ4 engine hates so much? I swear, adding those doors was a royal pain. Is there a methodical way to do this that avoids conflicts? Quite frequently when I add new NIFs, the mod won't even load.
Anyway, thanks for the input so far and keep it coming. The more ideas and feedback the better!
Lutefisk Mafia Mar 18, 2008, 03:36 PM I think this looks super. :thumbsup: And I do remember playing Rogue and Dungeon Hack and Nethack. :)
I don't have much to add right now, but if you need anything graphically let me know and I'll try to help you out.
Thank you kindly, woodelf! I count myself as one of the many who have much respect for your virtual paint-slinging skills.
And it is nice to know that I'm not the only one who wasted countless hours playing an ASCII dungeon game. Heh, good times.
kenken244 Mar 18, 2008, 03:38 PM It might be cool to merge this with some things in afterworld.
JDexter Mar 18, 2008, 05:15 PM VERY nice concept! I'd definitely love it and I hope you manage to release a playable version at some point (no stress, but don't loose motivation :D ).
thomas.berubeg Mar 18, 2008, 06:15 PM Lutefisk mafia.
You might not be at that point yet, but an interesting idea for one of your scenarios could be the bannor journey through hell...
Lutefisk Mafia Mar 18, 2008, 08:08 PM It might be cool to merge this with some things in afterworld.
Heh. Already done to a certain point. If you take a very close look at the doors, you will see that they are a NIF stretched, partly re-skinned version of the "simple door" feature asset from Afterworld. You can still see the stringy things on top that are supposed to bit of rebar -- I colored them to look like stone so that they blend in better.
But aside from that, the intent is to give it more of an RPG feel than 4X, so definitely more like Afterworld.
Kael Mar 18, 2008, 09:08 PM Here is a treasure chest for you. Have fun!
Lutefisk Mafia Mar 18, 2008, 09:58 PM Here is a treasure chest for you. Have fun!
Ooh, I love it. Absolutely love it!
Thank you!
I can use this as a theme-matching "goody hut," which is awesome. You just saved me a massive amount of time, because I was trying to figure out how to coax a good container out of my only NIF program, SceneViewer. (Easier said than done.)
Mod Pimp and mind reader!
Lutefisk Mafia Mar 18, 2008, 10:27 PM Okay. So I have Kael's lovely Treasure Chest, which I have looked at and admired in SceneViewer, but I cant seem to introduce it into my mod correctly.
The approach I took was to first unzip the files, which produced the "treasure chest" folder with the chest NIF and DDS file, plus the boundshape.nif.
I copied the whole folder into the asets/art/structures/improvements folder. Having made only that change, I tried to load the mod. No go. It looks like it starts to access XML, but crashed to the Vista "this program has stopped working" pop-up.
I tried removing the boundshapes.nif and tried to restart. No luck.
I then changed the XML code in the Civ4artdefines_improvement.xml file under the "goody hut" entry to change the path of the nif file to the one in my new "treasure chest" folder. The kfm line was changed to a blank entry. Still no load.
Why will the program crash if you simply add a folder and a few files into a sub-folder of "assets," even if nothing in the XML is trying to access that file yet?
This is the issue that I have been running into again and again. I sometimes eventually get my stuff to work, but honestly have not been able to figure out exactly what I did that actually fixed it.
Any suggestions?
xienwolf Mar 18, 2008, 10:48 PM Well, I just popped those 3 files into a folder called Chest and loaded it into my Assets/Art folder, worked fine.
I am guessing you already have some items added to your Art folder, as I do not have any Structures folder in there, let alone another inside of that. So at least that eliminates some possibilities.
My best guess: There is a limit to how deeply you can Nest a folder. Thus if you moved it back 1 or 2 folders total you should possibly be fine.
Best workaround I can think of: Quit putting things where the computer has any possible pre-conceptions ;) If you toss things into Assets/Modules then there is guaranteed no limit to your nesting allowance, and the computer doesn't expect any specific structure. Once you have it working, then you can shuffle it into a more "normal" location and at least know that it isn't the files themselves which are the problem, but something in the core program and structure.
EDIT: Just tried it with the exact file structure which you defined yourself as using, and it worked fine. So I got no clue.
mtagge Mar 19, 2008, 02:40 AM Anyhow, I think I have a good start, but could use help and suggestions. I would be thrilled to collaborate with Kael and the FfH2 team, but don't know if they would be interested in working on yet another project.
But I'm happy to share my work, and would really appreciate any feedback. (Disclaimer: This is the first time I've done any work in XML or Python, so my approach to programming is: Bang on it until it works. The results are functional, but by no means elegant!)
Thanks!
That sounds a bit much like my style of programming. :lol: I am starting to feel comfortable around python and wouldn't mind pitching in with trying to get some functions up and running. I won't be able to download anything from the Internet until I change duty stations to Germany this summer, but I don't mind passing around code, reviewing your work, or helping codesmith a little. Feel free to include the mod comp I am working on now http://forums.civfanatics.com/showthread.php?p=6613194 as in your mod I don't think the added CPU time will be a factor with an adventure style of play. And if you want me to modify it in any way, just let me know. It is always easier to modify your own code then someone elses.
Cheers
woodelf Mar 19, 2008, 04:10 AM I blame Vista. Sometimes I can mod in it and other times it simply won't let me mod my own computer/files. :hmm:
Marksman77 Mar 19, 2008, 04:14 AM Kinda funny that the sophisticated CivIV engine is plugged to recreate the old ASCII game :)
Keep the good job, I can't wait for the result :goodjob: I loved rogue, dungeon crawl etc.!
Psychic_Llamas Mar 19, 2008, 06:01 AM great work here! i was wondering how long it would take before somone decided to do this :p. just a couple of question: how do cities work? do you build buildings and stuff as usual or do they act differently? can you get lots of adventurers or only a limited number? can you build other units? are there different kinds of adventurere (ie sorcerer, wizard, rogue, paladin etc) or must you upgrade them to FfH flavoured units like normal grigory adventurers?
again, great job with this, i will definately be keeping an eye on it :p
Kael Mar 19, 2008, 06:53 AM Okay. So I have Kael's lovely Treasure Chest, which I have looked at and admired in SceneViewer, but I cant seem to introduce it into my mod correctly.
The approach I took was to first unzip the files, which produced the "treasure chest" folder with the chest NIF and DDS file, plus the boundshape.nif.
I copied the whole folder into the asets/art/structures/improvements folder. Having made only that change, I tried to load the mod. No go. It looks like it starts to access XML, but crashed to the Vista "this program has stopped working" pop-up.
I tried removing the boundshapes.nif and tried to restart. No luck.
I then changed the XML code in the Civ4artdefines_improvement.xml file under the "goody hut" entry to change the path of the nif file to the one in my new "treasure chest" folder. The kfm line was changed to a blank entry. Still no load.
Why will the program crash if you simply add a folder and a few files into a sub-folder of "assets," even if nothing in the XML is trying to access that file yet?
This is the issue that I have been running into again and again. I sometimes eventually get my stuff to work, but honestly have not been able to figure out exactly what I did that actually fixed it.
Any suggestions?
Very odd. You should be able to put anything in that directory without an issue if it isnt referenced. All that Civ4 does is copy it into cache when it loads. If it is crashing during load I would have to guess one of the following:
1. The crash isnt related to the addition of the chest graphics. Removing them will still get the crash.
or
2. Your hard drive is dangerously low on space. When it goes to cache all the art files it is running out of room and crashing Civ4.
or
3. You don't have the vista permissions you require to make these changes. I noticed this on Woodelfs computer where I wasnt able to modify some files even though he seemed to be an admin on the machine. You'd have to talk to someone with more vista expereince to figure it out.
Lutefisk Mafia Mar 19, 2008, 09:32 AM After playing around with different things, I have isolated the problem.
It's Vista.
Gee, what a surprise.
To make a long story short, after struggling with this freakishly uncooperative OS, I finally solved the problem by by disabling UAC. Now I have no issues whatsoever when I add new folders and files. :)
Thanks for the suggestions, everyone, I should be able to pick up the pace now that I don't have to continually fight with an OS that behaves like a petulant 3-year-old.
I'm also going to look in the general mods forum and post a thread about this issue (if there isn't one already). I can't be the only one who faced this frustration.
woodelf Mar 19, 2008, 09:34 AM Congrats. Care to PM me and tell me what you mean by disabling the UAC? I'd love to as well.
Lutefisk Mafia Mar 19, 2008, 09:48 AM great work here! i was wondering how long it would take before somone decided to do this :p. just a couple of question: how do cities work? do you build buildings and stuff as usual or do they act differently? can you get lots of adventurers or only a limited number? can you build other units? are there different kinds of adventurere (ie sorcerer, wizard, rogue, paladin etc) or must you upgrade them to FfH flavoured units like normal grigory adventurers?
again, great job with this, i will definately be keeping an eye on it :p
The concepts are still fluid, but here are some of my current guiding ideas:
You start with a party of three Adventurers. The Adventurers can upgrade along a warrior, thief, or spell user path. Depending on your Civics, specialized options are available at hogher levels. For example, you can eventually upgrade a fighter type to a Paladin, but must have the civics "Lawful" and "Good" enabled. So at present, it is more like the Grigori Adventurer upgrades. But you can choose to have a party of all magic users, or one of each type, or whatever mix you choose.
I'm thinking that the civics will be alignment choices(Lawful-Neutral-Chaotic and Good-Neutral-Evil), quest focus (Wealth-Knowledge-Power), and maybe a party specialty (Militarism-Intellectualism-Spiritualism). As noted, certain unit upgrades will be available to only certain civics.
You have only one "city," which is your campsite. This is a place to park stuff, and upgrade your units. The options build will be limited to "buildings that enable new upgrades and a very select few units. The "population" units will represent one henchman who hangs out at your camp. Depending on what goodies you find in the dungeon and drop within the fat cross of the camp, your henchmen can "work" these assets to increase money knowledge or production of the campsite. Increasing the food available at the campsite will allow a greater number of henchmen to inhabit the campsite.
You start with the three Adventurers. Depending on your campsite features, you will summon additional Adventurers to your campsite at a certain rate (these are your Great People). It may also be possible to occasionally attract a Learned Sage or other Great Person to your side.
Presently, and for the forseeable future, each adventure map would be a one-off scenario. These woul dbe super easy to make in WB, however, so I can envision people in the fan community making dungeons and swapping them around. It would be really neat if someone could code a good map generating script to provide random adventures, but that is probably a ways off.
Lutefisk Mafia Mar 19, 2008, 09:53 AM Congrats. Care to PM me and tell me what you mean by disabling the UAC? I'd love to as well.
I'll post it here so everyone can see, too.
Follow this link, which has easy to follow instructions:
http://blogs.msdn.com/tims/archive/2006/09/20/763275.aspx
Alternatively, just Google "disable UAC Vista" and you will find many other links with information on various ways to do this.
UAC is User Account Control, which is how Vista determines who is allowed to access or alter certain files. Thing is, though, unless you are logged in as an Admin, Vista assumes that you do not have common permissions to do stuff like this. It is sort of like forcing your self-contained PC to be treated like a large corporate network in which the default is that you can't mess around with files. Kinda dumb if you are the only person who uses your computer.
Let me know if this works for you, too.
Kael Mar 19, 2008, 09:56 AM I'll post it here so everyone can see, too.
Follow this link, which has easy to follow instructions:
http://blogs.msdn.com/tims/archive/2006/09/20/763275.aspx
Alternatively, just Google "disable UAC Vista" and you will find many other links with information on various ways to do this.
UAC is User Account Control, which is how Vista determines who is allowed to access or alter certain files. Thing is, though, unless you are logged in as an Admin, Vista assumes that you do not have common permissions to do stuff like this. It is sort of like forcing your self-contained PC to be treated like a large corporate network in which the default is that you can't mess around with files. Kinda dumb if you are the only person who uses your computer.
Let me know if this works for you, too.
Great find, Im gald you posted about it. I often get weird permission issues reported by Vista issues and I think this will help with a ton of them.
Vehem Mar 19, 2008, 10:01 AM UAC is User Account Control, which is how Vista determines who is allowed to access or alter certain files. Thing is, though, unless you are logged in as an Admin, Vista assumes that you do not have common permissions to do stuff like this. It is sort of like forcing your self-contained PC to be treated like a large corporate network in which the default is that you can't mess around with files. Kinda dumb if you are the only person who uses your computer.
Let me know if this works for you, too.
I'd love to show this to my flatmate - he's a Linux fan-boy and a big exponent of Account Control and permissions. We quite often debate whether or not they serve the user in any way on a single user system, but we've never quite managed to convince each other one way or the other.
The one thing we can agree on though is that Vista does it extremely badly and given that you've posted an option to disable it has made me dread the day I have to abandon XP a little less (mind you, I still estimate that to be several years away). Thanks.
woodelf Mar 19, 2008, 10:19 AM Thanks Lutefisk. Sorry for the hijacking. :)
Lutefisk Mafia Mar 19, 2008, 12:14 PM I'd love to show this to my flatmate - he's a Linux fan-boy and a big exponent of Account Control and permissions. We quite often debate whether or not they serve the user in any way on a single user system, but we've never quite managed to convince each other one way or the other.
Well, it is a good idea to get a warning if a program is trying to perform admin level functions that you may not have intended to be initiated. The way I look at it though, is that I have a single user PC. So if something is happening, it is because I started the program or it is an automated function of a program that I have vetted and installed myself.
I have good anti-virus, anti-spyware, and anti-rootkit programs installed. They take care of the nasties. I don't need UAC, and it just gets in the way of activities like modding.
@woodelf: No worries! The way I see it, this is definitely related to my mod, because I couldn't mod until it got fixed! Besides, if anyone hijacked the thread it was me! ;)
Kael Mar 19, 2008, 12:18 PM I'd love to show this to my flatmate - he's a Linux fan-boy and a big exponent of Account Control and permissions. We quite often debate whether or not they serve the user in any way on a single user system, but we've never quite managed to convince each other one way or the other.
Well, it is a good idea to get a warning if a program is trying to perform admin level functions that you may not have intended to be initiated. The way I look at it though, is that I have a single user PC. So if something is happening, it is because I started the program or it is an automated function of a program that I have vetted and installed myself.
I have good anti-virus, anti-spyware, and anti-rootkit programs installed. They take care of the nasties. I don't need UAC, and it just gets in the way of activities like modding.
@woodelf: No worries! The way I see it, this is definitely related to my mod, because I couldn't mod until it got fixed! Besides, if anyone hijacked the thread it was me! ;)
I agree. Id also recommend AppArmor for Linux which does exactly what you suggest, locking down the rights of applications to keep them under control, not the users. That way aplications can be set to only be able to write to specific directories, etc.
Lutefisk Mafia Mar 19, 2008, 12:29 PM And here it is. After fixing Vista, it took me all of 30 seconds to plop the files in a new directory, repath the artdefines file, set the scale -- and here we go:
http://img136.imageshack.us/img136/1569/treasure0000bv5.jpg
This is currently functioning as the default goody hut. Later, I will tweak the functions of the goody hut so that treasure chests yield a random amount of gold, equipment, or even a trap.
Thanks, everyone!
Rex rgis of Ter Mar 19, 2008, 12:31 PM :eek:It's amazing! I can't wait until it's released!
What are you planning on the Victory Conditions being? Great Job!
Broken Hawk Mar 19, 2008, 12:52 PM Wow! A new of achievement.
xienwolf Mar 19, 2008, 12:58 PM I've got to find some of the button files which I had downloaded and hook you up. But in case I forget to do so, check the Graphic Modpack area, I am reasonably certain most of them came through there. Tons of really nice, ready to use, buttons out there :)
For this mod-mod more than any other, changing how the Goody Huts work is vital, can't wait to see how you re-write it :)
zxcvbnm Mar 19, 2008, 01:19 PM I had some ideas about a mod much like this, I just don't remember where I put them...
Anyway, looks great and I really like Roguelikes.
woodelf Mar 19, 2008, 01:30 PM Keep the progress coming!
jimi12 Mar 19, 2008, 02:21 PM this looks amazing! i cant wait to see how you develop this! great job
xienwolf Mar 19, 2008, 02:49 PM Ok, I finally found the link :) I was looking for the wrong keywords (as always), but here are White Rabbit's awesome Icons (http://forums.civfanatics.com/showthread.php?t=170785) (many used in FfH already). So now you can quit using the silly Healing potion for things like finding hidden passageways ;)
Also, Ploerpengel has some pretty nifty ones (http://forums.civfanatics.com/showthread.php?t=162814) which might be good for your adventurer classes and some other uses.
Lutefisk Mafia Mar 19, 2008, 03:43 PM For this mod-mod more than any other, changing how the Goody Huts work is vital, can't wait to see how you re-write it :)
Incidentally, I was trying to locate the Python section that does the random generation for popping goody huts. I know I've seen it, but can't find it again. Anyone remember in which file it is?
Thanks!
xienwolf Mar 19, 2008, 03:52 PM It's actually completely exposed to XML, just found it for someone in the main forums last night... I'll dredge it up real quick (FfH doesn't modify it so far, so you have to go all the way back to basic Civ IV files).
Ok, you want Civ 4\Assets\XML\GameInfo\CIV4GoodyInfo.xml. But if you already knew about that and REALLY wanted to poke around in the Python aspects of it I can give you that as well later. It's somewhat scattered about, and I doubt there is much you need it for, the XML is pretty nicely set overall (Can have it grant Equipment & Allies through the <UnitClass>, which is likely the main thing you'd want to hand out. Besides, can't add any tags to the XML through Python, just make it do nifty things when they pop a hut, like changing to an open chest graphic instead of clearing the tile, or spawn a Monster in a non-adjascent Tile possibly...)
woodelf Mar 19, 2008, 03:59 PM XML and difficulty level based. Make sure you edit that handicap file as well.
seZereth Mar 20, 2008, 06:22 AM Awesome!!!
finally the detail work I put into the unitgraphics pay off ;)
keep up the great work!!!
Lutefisk Mafia Mar 20, 2008, 08:22 AM Last night I figured out a way to code for "unidentified" items.
The sample code I put together creates a unit called an "unidentified potion."
Picking up the potion using the standard "take equipment" function gives the character the "unknown potion" promotion. At this point the character can take actions to either "drink" the unknown potion or, if they have the right mage spell or thief ability, identify the potion.
Drinking an unknown potion results in a random potion effect being generated and applied to the character. An attempt to identify, if it fails, will simply do nothing or may even ruin the potion on a critical failure. Success results in a new "identified" potion unit being created in the same tile as the character. Identifying a potion removes the "potion" promotion from the caster.
This was a bit of a work-around and isn't perfect. I tried some more direct approaches but they resulted in laggy Python code. The apparent effect in-game is that it looks like the character drops the potion on the floor after a identification attempt, whether successful or not. I can live with that. The other option was to apply potion promotions as if the character kept it in inventory, but that resulted in an effective loss of a potion if the character already had that particular promotion.
The existing "take equipment" functions appear to prevent a unit from trying to pick up more than one instance of the same piece of equipment. I like that, and this new function dovetails nicely with that effect.
This "unknown" equipment model can now be applied to other things, like weapons and scrolls.
woodelf Mar 20, 2008, 09:15 AM That's one of the great things in dungeon crawls...having unidentified stuff that you're dying to find out what it is. Will you have identify scrolls that can be purchased that you can use to quickly id items?
xienwolf Mar 20, 2008, 10:13 AM Just make sure that the Identify function doesn't count as "Already Cast" or that the Pick Up Potion function can be cast even if you "Already Cast This Turn." Otherwise it is 3 turns just to pick up an ID a potion!
zxcvbnm Mar 20, 2008, 10:16 AM That's one of the great things in dungeon crawls...having unidentified stuff that you're dying to find out what it is. Will you have identify scrolls that can be purchased that you can use to quickly id items?
That reminds me of some awesome luck I had in a roguelike, I picked up a random broadsword in dire need of a weapon and it appeared to be a broadsword of devastation (makes about 5 times the damage of a normal one) :D
ID scrolls, definitely!
Will this mod include outdoors too someday? It would be great fun to play FfH as an RPG but with the civs and stuff...
seZereth Mar 20, 2008, 10:21 AM That reminds me of some awesome luck I had in a roguelike, I picked up a random broadsword in dire need of a weapon and it appeared to be a broadsword of devastation (makes about 5 times the damage of a normal one) :D
ID scrolls, definitely!
Will this mod include outdoors too someday? It would be great fun to play FfH as an RPG but with the civs and stuff...
as soon as his base works, i think it is no problem to create some outdoor grahics ;)
Lutefisk Mafia Mar 20, 2008, 10:55 AM Just make sure that the Identify function doesn't count as "Already Cast" or that the Pick Up Potion function can be cast even if you "Already Cast This Turn." Otherwise it is 3 turns just to pick up an ID a potion!
Excellent point. I hadn't thought of that, but it makes good sense. I'll try to figure out a way to take care of that. I guess my preference would be to make picking up a free action, but identifying an item with a mage spell, scroll, or thief ability should require the player to take a turn or at least count as "Already Cast." Otherwise, a character could shuffle through a pile of unidentified items, identify them all, pick the right one and use it -- all in one turn.
While I'm at it, I may as well generate a "drop item" function, too. I already did that for the horses, the only difference would be that it is for an item, not a bonus.
Incidentally, does anyone remember where the code is that checks units upon death to see if they have equipment promotions? I want to make certain that if a unit carrying equipment is killed that the stuff gets "dropped" and doesn't disappear with the unit.
Lutefisk Mafia Mar 20, 2008, 11:00 AM That's one of the great things in dungeon crawls...having unidentified stuff that you're dying to find out what it is. Will you have identify scrolls that can be purchased that you can use to quickly id items?
Magic users will be able to choose an "identify" spell as part of their repertoire. These spells have a high rate of success. There are also scrolls that can be found (but not purchased -- but maybe a buildable item at the campsite). The scrolls are a one-time use, but are 100% successful.
Thieves can choose an "identify" skill as a class-specific promotion. The chance to successfully identify an item is scaled using the unit level as a mulitplier.
Fighter types are pretty much screwed. This is why the party has three Adventurers in it. Players choose the upgrade path for each Adventurer and will probably be prudent to have at least one Magic user or Thief.
woodelf Mar 20, 2008, 11:15 AM Magic users will be able to choose an "identify" spell as part of their repertoire. These spells have a high rate of success. There are also scrolls that can be found (but not purchased -- but maybe a buildable item at the campsite). The scrolls are a one-time use, but are 100% successful.
Thieves can choose an "identify" skill as a class-specific promotion. The chance to successfully identify an item is scaled using the unit level as a mulitplier.
Fighter types are pretty much screwed. This is why the party has three Adventurers in it. Players choose the upgrade path for each Adventurer and will probably be prudent to have at least one Magic user or Thief.
Sounds beautiful. :)
BeefontheBone Mar 20, 2008, 12:59 PM Anyway, looks great and I really like Roguelikes.
Knew I recognised that username from somewhere. Bloomin' Crawl sucking my life away :)
Totally unrelated, but I've been unable to SSH to akrasiac with PuTTY on Windows (telnet is fine) - any thoughts what I might be doing wrong?
Very excited about this - it'll be like IVaN, only, you know, fun.
Lutefisk Mafia Mar 20, 2008, 08:46 PM So I played around with the CvEventManager file to try to make a function to check for equipment promotions and have these item "drop" as new units upon the holder's death.
I soon realized that something is already making this happen. Where is the function that appears to already be looking for equipment promotions and making them drop?
Also, it would be nice if barbarian attackers didn't destroy the newly created equipment units -- so that the player could hope to regain them at some point. This happens for all of the potions I made, if the dying unit is the only one in the plot after being killed by a barbarian. The sequence happens awfully fast, but appears to go like:
1. Barbarian kills player unit.
2. Dropped equipment spawned at site of player's death.
3. Barbarian moves onto site of player's death.
4. Barbarian automatically destroys all new (defenseless) equipment units.
xienwolf Mar 20, 2008, 09:37 PM Hrm, make sure you have the unit (item) flagged as equipment. The game ought to automatically have them Capture instead of Destroy. (It'll still say they destroyed it, but then have them create one under their team instead of yours) If they are HN that could interfere with the automatic Capture though.
Lutefisk Mafia Mar 21, 2008, 07:37 AM Hrm, make sure you have the unit (item) flagged as equipment. The game ought to automatically have them Capture instead of Destroy. (It'll still say they destroyed it, but then have them create one under their team instead of yours) If they are HN that could interfere with the automatic Capture though.
Which flag is used for that? Are we using the "mechanized" flag to indicate equipment?
Anyway -- this happens for Healing salves, too, which I haven't messed with.
The mechanism works perfectly if the player kills a barb unit with equipment promotions, but the barbs appear to kill off equipment untis after they spawn. As a test, I plopped a player owned healing salve down next to a barb orc warrior. On the next turn, the warrior moved onto the healing salve, attacking it, and instead of capturing it, killed it without spawning a "replacement" salve of its own nationality. I also checked the warrior's promotions and, no, it did not pick up the salve.
If I can't get this to work, I may have to switch over to a "gift unit" mechanism. I'd still need to find the current "on death drop equipment" code, though, so I could disable it.
xienwolf Mar 21, 2008, 07:48 AM It could be a problem tied directly to the Barbarians rather than how the equipment is handled currently. Try placing some Barbarian versions of your new items and then attack them to see if it auto-captures for you. If that is the case you could make the Gift mechanism ONLY work for the Barbarians (I'd just point you at the other code, but haven't found it yet, so this would be a work-around which ought to get the proper end result, in a messy way).
Lutefisk Mafia Mar 21, 2008, 08:33 AM I suppose the other possibility would be to introduce the Horde as an AI player on the map who is always at war with the human. Then at least some equipment would get captured.
Seems messy though. I'll look into what you suggested. Thanks, xienwolf.
Lutefisk Mafia Mar 21, 2008, 05:03 PM "Take" functions for potions have been fixed. It turned out to be an easy fix. Picking up a potion no longer counts as having cast, and you may pick up potions even if you have already cast a spell or used a special ability.
woodelf Mar 21, 2008, 06:52 PM So have you started modding to v0.31?
Lutefisk Mafia Mar 23, 2008, 03:08 PM So have you started modding to v0.31?
Well, this is looking more like it will end up as a stand-alone mod. I'm calling it a "mod mod" because it will be a very heavily tweaked version of FfH2, but an offshoot nonetheless. I hope to borrow ideas liberally from both v0.30 and v0.31. In the playable version of Dungeon Adventure, however, much of the stuff that makes 031 different from 030 will be stripped out.
Civilizations? Well at least in the first version, players play as the "Guild of Adventurers." A few other civs may be in the mod to provide adversaries or allies in-game, but I don't see more than 5 civs total, plus barbs.
Civics? Totally reworked, along the lines of alignment and goals.
Spells? The magic system is different. Many of the spell are recognizeable, but lots of new stuff, too. For example, I am playing around with the idea of material components for the more powerful spells.
Cities? This is a "one city challenge" for the player.
Units? Many of the units from FfH2 are used, but you will see new ones, too.
Terrains? Pretty much all different, since the game takes place in a dungeon instead of on a world map.
So, woodelf, I'm really sure how to answer your question -- part yes and part no, I suppose?
Nonobots Mar 23, 2008, 04:49 PM Nethack and FFH meshed together! A dream come true!
When can we play? :D I'm dying of curiosity here. I wouldn't mind an incomplete version just to get a feel of it and provide feedback. I'm very curious about this mod (mod).
Rex rgis of Ter Mar 23, 2008, 05:09 PM What will you do for religions and guilds?
Lutefisk Mafia Mar 23, 2008, 06:31 PM What will you do for religions and guilds?
I must admit that I do not know. The dynamics of the game are quite different as a dungeon crawl than a world conquest game. Spreading one's religion in a dungeon just doesn't have the same feel. ;)
I may retain religions by having a few available at the start of the game. The player may adopt one, which gives his divine casters certain options, while closing off others. I see some sort of interplay between the civics and religion.
Guilds is a bit of a tougher call. Since the player only has one campsite throughout the game, and all AI players are either "always war" or "always peace,' guilds seem less special. I may retain them if they prove to be an easier way of introducing special units or upgrades. I may also retain them in some way just for flavor.
Any ideas? I'm certainly open to suggestions!
Psychic_Llamas Mar 23, 2008, 06:58 PM you should check out the Erebus online dnd campaign HERE (http://forums.civfanatics.com/showthread.php?t=251712) for ideas regarding religion etc. i think if the only difference in religion will be the divine casters spells, then i would have 1 for each angle... ie 21
Rex rgis of Ter Mar 23, 2008, 07:08 PM Try seven dieties, and give them all civic restrictions, but lots of abilities. i.e.
Kilmorph-
Only good, nonchaotic
Spellcasters can terraform the dungeon, and can make archways or seal them. Useful for sneak attacks and thievery of Dragon hordes.
Esus-
Nongood, nonlawful
Units can become invisible at will, and can 'assasinate'. When an invisible unit attacks a hero unit (AI's adventurers), they get a high attack and withdrawl bonus.
Amathaon-
Good
Your camp spawns nymphs, which have access to high level creation spells, allowing them to create beasts to aid in battle, multiply beasts, and create forest roadblocks.
More could be come up with for more gods.
thomas.berubeg Mar 24, 2008, 01:34 PM Agares
evil
gives access to the summon of powerful demons
jimi12 Mar 24, 2008, 01:50 PM Nantosuelta - Not evil. access to the best equipment in the game. possible access to golems
succellus - not evil. could gain one time immortality promotion on heroes. bonus vs undead
Lutefisk Mafia Mar 24, 2008, 09:00 PM When can we play? :D I'm dying of curiosity here. I wouldn't mind an incomplete version just to get a feel of it and provide feedback. I'm very curious about this mod (mod).
At this point it would be very incomplete.
I am still working on basic mechanics -- and now have FfH2 031 to look at, too.
But I am hoping that a very stripped down, primitive version can be made available for feedback in a few weeks. (I only have an hour or so each day to spend on modding :sad:)
When I have a playable demo, I will most likely post it in the Modpack forum.
In the meantime, please keep checking back to this thread -- I will post updates on progress.
Lutefisk Mafia Mar 24, 2008, 09:05 PM I spend my modding time today introducing some better buttons for the unique features in the WorlBuilder. I got sick of re-using the "oasis" icon for everything. All of the N-S-E-W door variations and the altar feature have unique buttons now.
http://img186.imageshack.us/img186/3839/buttonswh1.jpg
The "take horse," "drop horse," and "search" actions now have unique buttons, too. (Shown pasted together -- you would not normally see the "take" and "drop" button at the same time)
http://img527.imageshack.us/img527/5489/buttons2ug5.jpg
For the next day or so I will be backfilling on TXT entries and expand the "take" and "drop" functions to cover more things.
zxcvbnm Mar 25, 2008, 08:05 AM Knew I recognised that username from somewhere. Bloomin' Crawl sucking my life away :)
Totally unrelated, but I've been unable to SSH to akrasiac with PuTTY on Windows (telnet is fine) - any thoughts what I might be doing wrong?
Very excited about this - it'll be like IVaN, only, you know, fun.
?????????????????????????????????????????????????? ???
:confused::confused::confused::confused::confused: :confused:
:confused::confused::confused::confused::confused: :confused:
:confused::confused::confused::confused::confused: :confused:
Psychic_Llamas Mar 25, 2008, 09:10 AM im itching to try this out, ah looks so cool :p
Lutefisk Mafia Mar 26, 2008, 08:06 AM Cleaned up a few more action buttons. The potion of command and unknown potion now have unique buttons in the interface.
I also settled on how to implement altars. Occassionally in the game, you may stumble across a stone altar. The altar may or may not have an aura about it, either good or evil. Praying at these altars can have different effects depending on the aura of the altar and the alignment of the player.
Also, the aura disappears after a player has prayed at the altar. It is possible to "recharge" an altar with an aura, but more on that later.
Altar with evil aura on the left, good on the right. Sickly stink rays means evil! Shiny sparkly blue stuff means good!
http://img397.imageshack.us/img397/4369/altarspm2.jpg
woodelf Mar 26, 2008, 08:19 AM Nice. Looks very cool.
xienwolf Mar 26, 2008, 08:53 AM Looks way awesome. Even though your scout doesn't have the Single-Unit graphics :p
When you do get a release Version you really do need to make a thread in the main Mod section, since this will be a complete mod that is just based on FfH code/artwork. I imagine MANY people will want to play this, and it may even recruit some new people to FfH as a side result :)
Lutefisk Mafia Mar 26, 2008, 09:40 AM When you do get a release Version you really do need to make a thread in the main Mod section, since this will be a complete mod that is just based on FfH code/artwork. I imagine MANY people will want to play this, and it may even recruit some new people to FfH as a side result :)
Yes, that's the plan. I originally started this thread here because of the huge debt owed to the FfH2 team. (Especially since I am shamelessly borrowing so much FfH2 graphics and code!) I could not possibly have started this project without having had the benefit of looking at the FfH2 XML and Python files to see how it is done. Once I have a playable pre-Alpha version, I intend to release it and migrate to a new thread in the Modpacks sub-forum.
And if I can attract more people to the goodness that is FfH2, so much the better!
seZereth Mar 26, 2008, 09:57 AM we have a great FfH community with a huge treasury of Ideas, so its probably not a bad idea to start out here :)
keep up the great work!
zxcvbnm Mar 26, 2008, 11:47 AM Will you use Afterworld mechanisms how much? The ranged attack would be ideal for archery, and as melee combat counts also as one swing only it would be perfect for a roguelike, so you can run away if you are fast enough.
Lutefisk Mafia Mar 26, 2008, 09:09 PM Will you use Afterworld mechanisms how much? The ranged attack would be ideal for archery, and as melee combat counts also as one swing only it would be perfect for a roguelike, so you can run away if you are fast enough.
I've already reused the Afterworld doors.
I'd like to use the ranged combat eventually, but I do not think it will be in the first version. I have alot of xml and python to untangle before I can implement it. I am also trying to figure out targeted spells -- didn't FfH2 used to have these?
Anyway - I agree that ranged combat would be great for the Thiefy types, but it need to wait.
Lutefisk Mafia Mar 26, 2008, 09:19 PM For tonight, I sunk my teeth into the civics. Wow, are these things linked into everything, or what? I finally implemented my first two new civic categories: Ethic and Moral:
http://img264.imageshack.us/img264/5628/civicsmt9.jpg
They don't do anything yet, but will eventually allow/restrict units and other choices, much like regular civics do. The time I was going to spend fleshing these out was instead spent chasing down and eliminating XML references to the civics I replaced!
I will also replace the civic button art -- at least some of them. I am not fond of the all black "never" tech placeholder for my "neutral" civic.
Anyway, I plan to add a civic called "Goal" which gives choices like "Wealth," "Power," and "Knowledge." This civic will affect how the player is awarded victory points, if I can figure out how to implement it. For example, a player who chooses "Wealth" would earn more points for amassing lots of gold (Khazad, anyone?), while a "Power" player would get extra points for eliminating enemy units. Or something like that.
I am looking for other ideas for civic classes and how different civic choices under that class would affect gameplay. So if you have any ideas, please trot them out!
xienwolf Mar 26, 2008, 10:12 PM I think that Water could work decently well for Neutral, or you could snag a Taoism icon from Vanilla.
You could have Weapon Proficiency be one civic, which affects your Melee types, Spell Spheres as another to affect your Arcane, and Personal Inclination as a third to affect your Thief types. Basically they would allow you to have a "Sub-class" emphasis (so Assassin, Thief or Ranger type of Thieves, Healer, Summoner or Spellslinger for Mage, and 2 hander, 1 hander or ranged for the Melee). Something along those lines.
Could also go with an "Attention" category, so state what you are "keeping an eye out" for. So if you are Attentive to Danger, you get better bonuses against monsters, if you are attentive to Secrets you can more easily find hidden caches of goods...
zxcvbnm Mar 27, 2008, 06:30 AM Good ideas xienwolf, like usual
Lutefisk Mafia Mar 27, 2008, 12:19 PM Took a break from button pics and civics to add a new piece of equipment: The boarding hook. (actually a scaled down version of the elven halberd made by White Rabbit -- thanks Rabbit!)
The boarding hook gives the holding unit the "boarding" promotion, allowing it to attack and capture naval units. In a dungeon, this may come in handy for crossing subterranean lakes. You never know!
Deon Mar 27, 2008, 12:26 PM It's really awesome =).
I began to dream about "additional maps" in the laaate main FFH where your units will spawn (like on "local" map) and make wondrous deeds due to some event (i.e. dungeon event where your hero spawns is a random-generated maze =)).
Lutefisk Mafia Mar 27, 2008, 07:25 PM Arggghh!
I am issuing a call for help to the FfH2 team or anyone else with coding experience.
I am trying to create a "trap" unit for placement in the dungeons. I think that this idea really needs to implemented as a unit, and not a feature or improvement, because it need to be totally hidden from the player. Features and improvements show a tell tale in the interface even if you try to blank out all the information.
All right -- so I'm trying to make these traps hidden or invisible, and to explode with fire or other damage if a player moves onto the tile containing the unit.
First I thought, "I'll just make a hidden pyre zombie that can't move. That should work, right?" Well.... no.
If the unit is marked as invisible or hidden, the player's unit will not interact with it when it moves onto the same tile. The unit works just fine if it is visible, but then the player gets the red combat odds circle etc. etc. This defeats the purpose of having a hidden hazard.
I want these things to be discoverable by Thief types using an ability that will behave like the Revelation spell. If the Thief finds the trap, it becomes visible and can be more easily avoided. Or maybe even removed.
I have tried flipping various tags on the unit_info entry, but have not gotten the result I want.
I even played around with giving the trap unit a special spell that it would cast if an enemy unit was in "zero" range. It didn't work. Just to check, I gave the trap the divine and fire3 promotions to see if it would flame strike a player's units that were within range. It would not use this ability. Stupid trap!
Grrr.
Any suggestions on how to make this unit work as intended? (It's supposed to be a trap, right? You don't see it, you step on it, and something bad happens. That's the goal, anyway.)
xienwolf Mar 27, 2008, 07:44 PM Invisible unit with a Direct Damage spell that only works against units in the tile and costs the life of the caster was my idea, but then I read that you tried it... did you increase the AI weight function of the spell dramatically?
Why have it completely hidden? You can go with the "Mimic" idea and have it appear to be something else, but in truth be the trap (then you can use the Goody Hut mechanism to force them to automatically trigger it when they walk onto the tile. Not sure how to have a thief detect that though, unless you could give him a range 2 spell which will change them into a readily identifiable trap improvement instead (which can then be moved onto and pillaged)
Lutefisk Mafia Mar 27, 2008, 08:02 PM The mimic unit is my backup plan. I already have treasure chests using the goody hut mechanism, and some of the options give damage and a "you sprung a trap" message. This would be doable, but not as desireable. It kind of limits placement of the traps to places where the other features would plausably be. Treasure chests in the middle of a corridor look fishy!
Ideally, I want the player to have no indication that anything is amiss. Thus the desire for a hidden unit.
I will retry the spell idea, setting the weight up high. What is the upper limit on weight? I'd like the trap to trigger almost always.
Tyrs Mar 27, 2008, 08:05 PM I *think* you could use an event, didn't sometime ago Kael say that events could trigger inside a turn? Anyway, have the event trigger when a unit is on a tile with this invisible trap unit, with a -1 weighting to the event so it would always happen when it was possible. Then just have the effect be "<unit> has set off a trap!" and give it however much damage. Awesome Job with your mod by the way, looking forward to playing it.
MagisterCultuum Mar 27, 2008, 08:06 PM You may need to use python, or hardcode something into the SDK if you want it to be faster.
The most direct way would be to trigger the damage/spell/whatever, when a unit moves into the tile with the trap unit present. That would be in def onUnitMove(self, argsList). Every time any unit moves you would have to cycle through every unit on the tile it is entering (well, you can stop once you find the trap, using "break"), cycle through all the units on a tile, and then trigger the effect if the unit is a trap. Of course, this could probably slow the game down considerably, at least if there are a lot of large stacks.
You could also give the traps a promotion that has a pyPerTurn effect. You could basically copy the Crown of Brilliance promotion/effect/spell for this. I'm not quite sure when in the turn this would trigger though, so it might, for instance, only trigger if the victim is on the same tile as (or close enough to) the trap at the start of stop of the turn, and have no effect if it passes through the trap without stopping there. So as to not give away the traps, you might need to check to make sure there is a valid target before the effect triggers the spell.
The effect could easily be caused by the same promotion that makes the unit invisible, thus one revelation-based spell to easily make traps visible and disable them at the same time by removing said promotion.
Lutefisk Mafia Mar 27, 2008, 08:13 PM Good ideas you guys! That's one of the things I love about the Civ4 community!
xienwolf, I think you nailed it with the spell weight suggestion. I gave my trap unit the divine and fire3 promotions, and temporarily set the aI weight on the flamestrike spell to 1000. Sure enough, when my player unit got in range, after one skipped turn, the trap zapped me!
From here it should be easy to make a new spell that operates within range zero (same tile), or even a further range. I'll probably make the trap self destruct after casting the spell, but perhaps some more robust traps will stick around.
Wow, this is cool. Opens up a whole new range of possibilities!
Thanks everyone!
UPDATED:
The traps are working now -- they trigger when an enemy (player) unit moves within one tile, but will not trigger if the enemy is right on top of the trap. This is a wrinkle of the flamestrike code, which prevents a unit from flamestriking friendly units. The trap sees itself as a friendly unit, and so will not strike its own tile. Fair enough. This def req is needed to keep traps from springing on other barb units, so I guess I can live with it. We want to save the traps for the players!
It would be nice if I could figure out a way to get the spell to trigger if an enemy is in range, EVEN IF a friendly is there, too. Then the spell could be perfected.
xienwolf Mar 27, 2008, 10:00 PM Actually I hadn't gone into detail on my Mimic idea because I had posted before I got the idea and didn't know if you had already read it by the time I first edited in the Mimic (I hate that there is no notification of edited posts...), and I didn't want 2 posts in a row just to elaborate on it :)
What you would do for the Mimic idea is create an improvement which is just a torchstand, or a decorative table, or a rug... Then you use the same graphics for your Mimic as well. For the non-trap ones it will just be decoration (Mouseover shows the name "Just an ordinary rug..." or something), and moving onto them doesn't do anything. For fun you could make them flammable so that when your mage is tossing fireballs all over the place you might set the hallway on fire! That'd actually be cool...
Anyway, for the actual traps, they look the same, have the same mouseovers, but have a Goody List which they will automatically trigger when you step onto the tile with them that gives you the results of your trap (some REALLY bad that are flagged as <bBad> and some not completely horrible, but still bad, that are not. That way a Thief who fails to search for them still gets off a bit easier than the others. Or of course you could grant the Mages the NoBadGoodies flag instead to show that they have defensive spells to ward themselves against trap damage). But also make it so that the Thief's "Detect Traps" spell will convert any trap within 2 tiles to a new improvement which can then be interacted with differently (probably with a function similar to the Rob Grave, just renamed to Disarm Trap, and on a new goody table to indicate chances of success).
But yeah, all the other ideas here should work quite well. The event idea from Tyrs could possibly be done with nothing but XML in fact. Reasonably certain I recall seeing triggers in there for specific units on a tile with each other.
Psychic_Llamas Mar 28, 2008, 12:39 AM i was really curious with how you would get traps to work, great job :)
i think it would be good if some traps didn't die after they are used, so if you get through once safely without disarming it, you would still have to get back out...
MagisterCultuum Mar 28, 2008, 12:48 AM Hyborem's Whisper acts be having the spell call a python function that forces the event to occur. I'm not sure you can have the events happen in the middle of a turn without forcing somehow, probably requiring python. Of course, I'm no expert on events by any means.
mtagge Mar 28, 2008, 04:10 AM Lutefisk, why don't you start setting up some python onUnitMove functions? Since I think in the future you are going to want several abilities based on character movements wouldn't it be more efficient to start a custom def that will work when a players units move? Since we are talking about a single player scenario the first if statement would include:
if pUnit.getOwner() == 0:
Then run a whole series of checks. Due to the scale of the game the CPU time would not be noticible (since the CPU runs faster than a human can think).
This would have the advantage of not relying on a different unit and tricking it every time you want it to do something. Instead you can have a trap unit and use a different set of promotions depending on what type of trap you want (poison gas promotion, spike trap promotion, false pit promotion) that is looked at in the python.
If you want I can try to whip something up, just let me know the details of what effect you want.
Lutefisk Mafia Mar 28, 2008, 07:56 AM @mtagge: You are hired!
The work around I have now is a unique unit called a "trap," that has the hidden promotion (so it is disciverable by Thief types). I also gave it a special promotion called "trap." The trap promotion lets a unit cast a spell similar to flame strike, but with a 1000 AI weight.
So, it sort of works, but I like your idea better. Either that or an event script that always triggers when a trap unit and a player unit are on the same tile.
I like the idea of different promotions for different traps -- lots easier than a different unit for each trap type. You could also make the trap immune to its own type of damage, for example a fire trap is immune to fire, so it can be a persistent trap.
I noticed that Afterworld seems to use an "OnUnitMove" function for landmines, but I couldn't make sense out of it.
mtagge, if you can provide a sample of what this OnUnitMove python would look like, I'd be thankful!
Essentially, the script should look to see if a unit not belonging to the trap owner has moved onto the trap. Then the script should find the promotions of the trap (like PROMOTION_FIRE_TRAP or PROMOTION_POISON_TRAP) and deal out damage accordingly to ALL units in the stack. All of this would take place on the xy plot of the trap itself.
If someone else want to fiddle with an event script idea that would be appreciated, too. I think many people in the mod community would be interested in getting this concept to work.
Lutefisk Mafia Mar 28, 2008, 11:57 AM In the meantime, I will flesh out traps to work with my current mechanism. Right now, there is a single "trap" unit that starts with hidden and trap promotions. The trap promotion allows it to cast the "activate trap" spell if the player gets too close. This works well, so far. In playtesting I saw a trap nail an AI Belseraph Scout, so it will attack other non-human players, too. (but not the barbs ;))
The spell python code does the real heavy lifting. It is essentially a heavily modded version of the flamestrike spell.
It sets default parameters for the trap and then looks for other promotions on the trap unit. So -- it assumes the trap is a mechanical trap, unless it finds promotions that change the trap type. Right now, I just have it look for FIRE1 for a fire trap, DEATH1 for an unholy trap, etc.
The python then adjusts the damage type, visual effect and sound effect accordingly.
Viola! Lots of different traps!
A picture of a revealed trap is below:
http://img223.imageshack.us/img223/2073/trapgg5.jpg
Kol.7 Mar 28, 2008, 12:18 PM Could you not just make it cast pillar of flame instead of ring of flames to get it to strike its own tile? Then it should work.
Grey Fox Mar 28, 2008, 12:51 PM Nice work. Once I finish my Advance Wars mod I will continue work on my civrpg mod and I might use some of your work in that once I start working on it again.
My game will be mostly outdoors, but I plan to add a map switching feature to my mod so I could add dungeons which you can enter etc. Not promising anything about that, but I need that feature in my campaign mode for AdvWars so I'll know before I start working on civrpg again if I can include dungeons.
My mod have no civilization or city management, just character development with all that usually comes with digital RPGs. Inventory screen, equipment, attributes, quests, monsters and heroes.
I just wished I had a connection at home so I could put together a team once I get to content development. I will need writers (for storymode), artists (3D and 2d) and designers (idea-comer-up'ers), and possibly programmers (but I'll do most of that myself, as well as the above jobs).
Atm I have Jono and Chandrasekhar on the team, but the project has been dormant for a while mostly cause I have no internet connection.
Anyways, I'll be following this project.
Lutefisk Mafia Mar 28, 2008, 06:32 PM Could you not just make it cast pillar of flame instead of ring of flames to get it to strike its own tile? Then it should work.
The pillar of fire spell has Python code that prevents the casting unit from hitting itself or other friendlies. I haven't figured out a way to short-circuit this without causing other problems, such as:
1. Very laggy python code.
2. Traps deciding to blow themselves up for no reason.
3. Traps blowing up other barb units.
Here is the Pillar of Fire def req python below, which I have repurposed for traps:
def reqActivateTrap(caster):
iX = caster.getX()
iY = caster.getY()
pPlayer = gc.getPlayer(caster.getOwner())
iTeam = pPlayer.getTeam()
eTeam = gc.getTeam(iTeam)
for iiX in range(iX-1, iX+2, 1):
for iiY in range(iY-1, iY+2, 1):
pPlot = CyMap().plot(iiX,iiY)
bEnemy = false
bNeutral = false
for i in range(pPlot.getNumUnits()):
pUnit = pPlot.getUnit(i)
if eTeam.isAtWar(pUnit.getTeam()):
bEnemy = true
else:
bNeutral = true
if (bEnemy and bNeutral == false):
return true
return false
I cannot for the life of me understand how this is working. It does prevent the spell from being castable until there is an enemy unit within range that does not share a tile with friendlies. So, it DOES work, but the code contains too many double negatives for me to keep track of the logic. I tried to parse it again last night, but that last condition with the bEnemy and bNeutral throws me off.
If someone could explain to me exactly what this is doing and HOW, I could probably figure out a way to change traps to activate on their own tile only.
Here was my attempt for a new def req (it is commented out in the example below):
#def reqActivateNewTrap(caster):
# pPlayer = gc.getPlayer(caster.getOwner())
# iTeam = pPlayer.getTeam()
# eTeam = gc.getTeam(iTeam)
# pPlot = caster.plot()
# for i in range(pPlot.getNumUnits()):
# pUnit = pPlot.getUnit(i)
# if pUnit.getTeam() != eTeam:
# return true
# return false
All this accomplished was to make the game very laggy and make traps not work at all. I thought it would simply detect if an enemy unit was on the same plot as the trap unit, and not care if friendlies or neutrals were also present. Apparently not!
Again, commentary and observations on the code examples above are welcomed!
Grey Fox Mar 28, 2008, 06:41 PM if bEnemy is practically short for "if bEnemy == true", it's not "if bEnemy AND bEnemy both False"
The statement could have been written like this as well:
if ((bEnemy) and (not bNeutral)):
Lutefisk Mafia Mar 28, 2008, 07:01 PM And a few minutes after I made that last post, i looked at the code again and though... "Huh. I wonder if THIS would work."
IT DID! :D
I now have traps that will trigger if an enemy steps on the tile, regardless of whether friendlies are also present. And the traps do not trigger prematurely, or if friendlies only enter the tile. And they only apply the damage effect to units on their own single tile.
By using this code and the code I was using before, I now have two flavors of traps: single tile trigger and effect traps -- and area trigger and effect traps.
Dungeon Adventure just got a little more interesting!
xienwolf Mar 28, 2008, 07:20 PM Number 1 Reccomendation: use [ code ] [ /code ] when you post code :P It is hard to read quickly without the indentations ;)
My take on the code, could easily be wrong/missing something.
def reqActivateTrap(caster):
iX = caster.getX()
iY = caster.getY()
This part stores the tile that the caster is located on
pPlayer = gc.getPlayer(caster.getOwner())
iTeam = pPlayer.getTeam()
This establishes which player cast the spell and who is on his team.
eTeam = gc.getTeam(iTeam)
This establishes who all the other players are in the game.
for iiX in range(iX-1, iX+2, 1):
for iiY in range(iY-1, iY+2, 1):
This says that it is going to look at all the tiles in the 3x3 grid centered on the caster.
pPlot = CyMap().plot(iiX,iiY)
bEnemy = false
bNeutral = false
This initializes the variables to state that, should nothing further be done with the code, the computer should assume there are no enemies and no neutral units on the tile it is currently checking.
for i in range(pPlot.getNumUnits()):
This sets up to check each unit on the plot, 1 by 1.
pUnit = pPlot.getUnit(i)
if eTeam.isAtWar(pUnit.getTeam()):
bEnemy = true
else:
bNeutral = true
This says that if one of those units belongs to a player who is at war with you, then it is an enemy. But if it belongs to a player who is NOT at war with you, then it is Neutral.
if (bEnemy and bNeutral == false):
return true
This will return a true value if none of the units on the tile were friends or enemies. Which is impossible, thus it returns the value of true if the tile was empty, or only contained your own teams units.
return false
And if the last check didn't work (ie - there is any unit not belonging to your team in that 3x3 grid), this one returns a false.
As for the code you have #'d out, the problem I see with it is the line:
# if pUnit.getTeam() != eTeam:
You are checking only the tile that the caster himself is on, and you are checking for EVERY unit, to include the caster. Thus the caster himself will always trigger this one to return a True.
kenken244 Mar 28, 2008, 08:02 PM I'd like to use the ranged combat eventually, but I do not think it will be in the first version. I have alot of xml and python to untangle before I can implement it. I am also trying to figure out targeted spells -- didn't FfH2 used to have these?
Anyway - I agree that ranged combat would be great for the Thiefy types, but it need to wait.
Ranged attacks are actually very simple to implement, You just need to give a non-air unit air combat and air range values. the damage is dependant on the air combat and collateral damage based on it's regular collateral damage numbers. it's basically the same as bombing missions but it uses a different button, can't be intercepted, and is blocked by some terrains.
Lutefisk Mafia Mar 28, 2008, 09:51 PM Number 1 Reccomendation: use [ code ] [ /code ] when you post code :P It is hard to read quickly without the indentations ;)
Noted! Do the indents make any difference in how the game engine interprets the code? I thought they were just for ease of human reading, but if I'm wrong on that, that could explain a lot of my errors.
pUnit = pPlot.getUnit(i)
if eTeam.isAtWar(pUnit.getTeam()):
bEnemy = true
else:
bNeutral = true
This says that if one of those units belongs to a player who is at war with you, then it is an enemy. But if it belongs to a player who is NOT at war with you, then it is Neutral.
So it doesn't try to process the caster's own units?
if (bEnemy and bNeutral == false):
return true
This will return a true value if none of the units on the tile were friends or enemies. Which is impossible, thus it returns the value of true if the tile was empty, or only contained your own teams units.
Wait, doesn't return true mean that the spell can be cast? Under this interpretation, the spell could only be cast if a nearby tile is either totally empty or full of only your own team's units. This is where I'm getting tripped up. Because in-game, the spell can only be cast if there is a tile in range that contains only enemy units.
Lutefisk Mafia Mar 28, 2008, 09:59 PM In any event, I now have single tile traps working fine, except that the "trap sprung" interface message never appears. The unit damaged message does appear, though. I think it is because the python is trying to put two messages in the same space, so it just does the first message.
Area traps work perfectly -- both the damage message and the "trap sprung" message appear. The damage message appears on the activating unit, the "trap sprung" message appears on the trap tile.
I am also implement a special type of trap called a "glyph." These traps cast spells upon activation. Great for summons, and blinding light, etc. For some reason, the "trap sprung" message never appears for these either, despite the fact that they, too, are a form of area trap. The message associated with the spell cast does show up, though.
Very puzzly!
Grey Fox Mar 28, 2008, 10:28 PM Read my post again Lutefisk ;)
if bEnemy is practically short for "if bEnemy == true", it's not "if bEnemy AND bEnemy both False"
The statement could have been written like this as well:
if ((bEnemy) and (not bNeutral)):
xienwolf Mar 28, 2008, 11:24 PM Ah I see, the == only applies on the second one, so there was an implied == True on the bEnemy tag. Thus it returns the True value if there is an enemy, but no Neutrals :) Cute :p
I had realized that a True seemed just flat out wrong for my case, but assumed it may have been a "Cannot cast" entry, since you find those sometimes in the python as well.
Not sure if the Python relies upon the tabs to be honest.
MagisterCultuum Mar 29, 2008, 12:47 AM Python relies very heavily on tabs. In python, everything in a function, conditional, loop, etc., must be indented once more than the opening statement. For example,
def reqActivateTrap(caster):
iX = caster.getX()
iY = caster.getY()
pPlayer = gc.getPlayer(caster.getOwner())
iTeam = pPlayer.getTeam()
eTeam = gc.getTeam(iTeam)
for iiX in range(iX-1, iX+2, 1):
for iiY in range(iY-1, iY+2, 1):
pPlot = CyMap().plot(iiX,iiY)
bEnemy = false
bNeutral = false
for i in range(pPlot.getNumUnits()):
pUnit = pPlot.getUnit(i)
if eTeam.isAtWar(pUnit.getTeam()):
bEnemy = true
else:
bNeutral = true
if (bEnemy and bNeutral == false):
return true
return false is quite wrong. First, the define itself must be indented once for it to be a part of class (whatever file it is in). (Edit: I just noticed that in the spells file defines are not indented, unlike in the custom functions, event manager, ect. So you probably should unindent the "right" code once.) Then, everything in it must be indented to be part of the define. Likewise things in the for loops must be indented if they are to be included in the portion of the code to be iterated. "If" statements do the portion of the code below that is indented, and then do unindented lines anyway. The same goes for "else," which I'm pretty sure is meaningless unless it comes immediately after an if (or elif) statement ends. Almost everything in this code would cause a serious error if not properly indented.
The right way is:
def reqActivateTrap(caster):
iX = caster.getX()
iY = caster.getY()
pPlayer = gc.getPlayer(caster.getOwner())
iTeam = pPlayer.getTeam()
eTeam = gc.getTeam(iTeam)
for iiX in range(iX-1, iX+2, 1):
for iiY in range(iY-1, iY+2, 1):
pPlot = CyMap().plot(iiX,iiY)
bEnemy = false
bNeutral = false
for i in range(pPlot.getNumUnits()):
pUnit = pPlot.getUnit(i)
if eTeam.isAtWar(pUnit.getTeam()):
bEnemy = true
else:
bNeutral = true
if (bEnemy and bNeutral == false):
return true
return false
(No, spaces won't work, and telling them apart can get really annoying sometimes. Also, having a space before a tab can sometimes throw things off. What is worse is that IDLE's proposed solution to this is to change every tab into spaces and make you go through every line yourself. You should really edit it in notepad, notepad2, notepad++, etc, which allow you to show the spaces and tabs.)
If this was C++ then the tabs would be irrelevant (only there to make it easier for us to read), because it relies on {} instead. I believe that line endings are also pretty meaningless here.
The Same is true of XML (except for the {} would be more like </>, and it isn't really a programming language)
Lutefisk Mafia Mar 29, 2008, 10:40 AM :Read my post again Lutefisk ;)
The light finally went on. I think I get it now.
The implicit logic to that line of code is:
if (bEnemy == true) and if (bNeutral == false):
Right?
I was thinking it was:
if (bEnemy == false) and if (bNeutral == false):
which was why I was so confused. I realize that the code is nice and consise, but in this instance it could have been written more explicitly. I am a big fan of verbose code for mods -- it makes it easier for noobs like me to figure out what the code is doing!
Thanks to you for squaring me away!
BeefontheBone Mar 29, 2008, 10:48 AM The implicit logic to that line of code is:
if (bEnemy == true) and if (bNeutral == false):
Right?
Yup. If you're used to conflating 1 with true and 0 with false it's a little clearer - those binary flags are tricksome beasties! :D
Lutefisk Mafia Mar 29, 2008, 10:52 AM Python relies very heavily on tabs. In python, everything in a function, conditional, loop, etc., must be indented once more than the opening statement.
Oh!!!
This is a VERY good thing to know! The only other significant programming I have done was in a type of JavaScript, in which indents are cosmetic only. I also programmed in Basic and APL, but that was back in the day of GOTO and GOSUB.
Thank you for straightening me out, MagisterCultuum. This should reduce my coding frustration significantly.
FWIW, the code I posted got left-justified because I forgot to use the CODE tags. It had tabbed indents, but now I need to go back and examine them to see if they made sense.
Lutefisk Mafia Mar 29, 2008, 10:59 AM So here is the def reqcode I am currently using for single tile traps:
def reqActivateTrap(caster):
iX = caster.getX()
iY = caster.getY()
pPlayer = gc.getPlayer(caster.getOwner())
iTeam = pPlayer.getTeam()
eTeam = gc.getTeam(iTeam)
for iiX in range(iX-0, iX+1, 1):
for iiY in range(iY-0, iY+1, 1):
pPlot = CyMap().plot(iiX,iiY)
bEnemy = false
bNeutral = false
for i in range(pPlot.getNumUnits()):
pUnit = pPlot.getUnit(i)
if eTeam.isAtWar(pUnit.getTeam()):
bEnemy = true
# else:
# bNeutral = true
# if (bEnemy and bNeutral == false):
if (bEnemy == true):
return true
return false
If I understand the previous discussion correctly, this version should work, too:
def reqActivateTrap(caster):
pPlot = caster.plot()
pPlayer = gc.getPlayer(caster.getOwner())
iTeam = pPlayer.getTeam()
eTeam = gc.getTeam(iTeam)
bEnemy = false
for i in range(pPlot.getNumUnits()):
pUnit = pPlot.getUnit(i)
if eTeam.isAtWar(pUnit.getTeam()):
bEnemy = true
if (bEnemy == true):
return true
return false
The purpose of the above code is to make the spell castable only if an enemy is on the same tile as the caster, regardless of the presence of friendly or neutral units.
Comments?
Grey Fox Mar 29, 2008, 11:06 AM :
I am a big fan of verbose code for mods -- it makes it easier for noobs like me to figure out what the code is doing!
Yeah I am a fan of verbose code as well and python seems to have been designed to basically work as a pseudo-code (http://en.wikipedia.org/wiki/Pseudocode) like programming language.
Instead of && it has and , instead of ! it has not,etc
Even the For loop has been made to be more understandable. Instead of C's for(i=0,i < x,i++) it has the for x in range(range), which even makes a sentence when read. If the programmer is aware of this and put some effort down you can write very easy read code.
An example:
#Example check function
def isNotAI(iPlayer):
'Returns true if iPlayer is human'
pPlayer = gc.getPlayer(iPlayer)
if pPlayer.isHuman():
return true
return false
#Then our actual code
bDone = false
while not bDone:
for iPlayer in gc.getNumPlayers():
if isNotAI(iPlayer):
#Do Something
bDone = True
MagisterCultuum Mar 29, 2008, 11:10 AM In the first version the second to last if statement won't do anything regardless.
If you don't care about friendly or neutral units, why not just get rid o the bEnemy variable and just put the return true statement in "if eTeam.isAtWar(pUnit.getTeam()):" instead? The code would be faster that way, as it would stop checking the units on the tile once it finds a single enemy.
Lutefisk Mafia Mar 29, 2008, 12:26 PM In the first version the second to last if statement won't do anything regardless.
You mean the lines that are commented out? Yeah, I know... I leave bread crumbs for myself like that when I'm fiddling with code. It helps me revert to earlier versions when I screw things up.
If you don't care about friendly or neutral units, why not just get rid o the bEnemy variable and just put the return true statement in "if eTeam.isAtWar(pUnit.getTeam()):" instead? The code would be faster that way, as it would stop checking the units on the tile once it finds a single enemy.
So, like this:
def reqActivateTrap(caster):
pPlot = caster.plot()
pPlayer = gc.getPlayer(caster.getOwner())
iTeam = pPlayer.getTeam()
eTeam = gc.getTeam(iTeam)
for i in range(pPlot.getNumUnits()):
pUnit = pPlot.getUnit(i)
if eTeam.isAtWar(pUnit.getTeam()):
return true
return false
I like it, nice and crisp.
MagisterCultuum Mar 29, 2008, 12:40 PM The For loop (starting with the for statement and including everything in it) is indented once too much.
Psychic_Llamas Mar 29, 2008, 09:18 PM ive got a question:
I need help with a certain spell that i want to make for the Warhammer mod, which uses ffh code for spells. after reading about these traps that lutefisk is making, i had a sudden brain wave. is it at all possible to d othe following for a spell:
Comet of Cassandora:
this spell shoud summon a permanent, invisible, single tile trap unit which is allied to the caster.
the single tile trap, should have a % chance of being 'set off' each turn, regardless of if there is an enemy on it, and if an enemy steps on it, it should be set off immediately regardless. it damages all units, friend and foe.
then it is set off, either by the % chance or being stepped on, it should cast a direct damage spell that does a small ammount of damage.
however, every turn that the comet trap exists, the Damage level should increase, and every 2 turns the area of effect should increase by one square, until after 6 turns the trap is automatically set off (ie chance of setting off change to 100%).
numerically i would like it to be like this:
turn 1: 15% fire damage to any unit directly on top of the comet trap. 10% chance of setting off.
turn 2: 30% fire damage to any unit directly on top of, or adjacent to the comet trap. 20% chance of setting off.
turn 3: 45% fire damage to any unit directly on top of, or adjacent to the comet trap. 40% chance of setting off.
turn 4: 60% fire damage to any unit directly on top of, or within 2 squares of the comet trap. 60% chance of setting off.
turn 5: 75% fire damage to any unit directly on top of, or within 2 squares of the comet trap. 80% chance of setting off.
turn 6: 90% fire damage to any unit directly on top of, or within 2 squares of the comet trap. 100% chance of setting off.
my question then is, how would i make the comet trap change the % chance, ammount of damage, and spell area each turn? is it even possible?
if yes, could someone please provide me with the code that should make it work? and where should i put the code? im almost entirely python illiterate:p
sorry for hijacking this thread Lutefisk :p
EDIT: i realise im asking a lot here, but one can always hope ay? ;)
EDIT 2: lutefisk, how does your trap promotion work?
MagisterCultuum Mar 29, 2008, 09:48 PM I'm pretty sure it is possible.
The % chance seems like it should use use an pyPerTurn effect, which would actually be promotion dependent rather than unit specific.
It would probably make sense to check in CvEventManager and call the same effect if a unit tries to enter a tile with such a unit (checking similar to how treants work)
Hmmm...for added range/damage, how about making the unit gain free xp, and basing the range and damage amounts depend on its xp? This would require python of course, with the exact range/damage amounts hardcoded. You could also have the pyPerTurn effect look at its amount of xp for the chance of going off, combined with a random number generator.
You could also make these units gain free promotions (one promotion could randomly give another, py effect could add them, or you could just make this line of promotions the only ones available to a new unitcombat_trap) which might be able to let you make the damage spell itself not rely on python at all. Promotions can change the amount of spell damage a caster can do, but not range (I really think Kael needs to make extension boost range, which would make your request easier)
Lutefisk Mafia Mar 29, 2008, 09:56 PM @Psychic_Llamas:
No worries on hijacking! I like to hear about interesting ideas!
As far as your spell goes, it would be complex, but doable, I think.
The first part is just a summon of a special unit. Easy enough.
For the rest of it, you would need to have a python script that the unit checked each turn, and that could keep track of how many turns had passed since creation.
The other option, more complex, is to have a series of promotions that change the characteristics of the unit.
For example, the unit starts with the "Comet" promotion. This allows the unit to cast a unique spell called "Imacomet." It also starts with Combat1
The python for the "Imacomet" spell would have a series of "if" statements that check for certain promotions and take different actions accordingly.
So the first "if" statement could look for the "combat1" promotion, and if it does exist, the unit would take action against eligible units within a set radius for a given result of a "random roll."
The next "ifs" would check for combat2, combat3, etc. with their scaled resulting actions.
After checking for the appropriate action, depending on the Combatx promotion, the code would check for "growth." The code would check for promotions again, but in descending order, first combat5, down to combat 1. If it finds a given level of promotion, it takes action to remove that promotion, and award the next higher one instead. This could be 100% likely to happen or have a % chance to happen.
And then the loop ends.
You would not need a req def, since the spell is cast every turn. One of the checks in the spell itself could check to see if there is an enemy unit on top of the comet. If so, the chance to "blow up" would be set at 100%. In fact once of the initial variables could be defined as
iBlowup = 0
And iBlowup would change to 100 if an enemy unit is on top of the comet. It would change to a given number for each level of growth of the cmet, too.
Well, that's just my two cents. Complex idea, indeed, but I think it can be done!
MagisterCultuum Mar 29, 2008, 11:15 PM Well, your way it would blow up if there happen to be other units on the same tile whenever the pyPerTurn function ran. I believe that means that units could still move through the tile safely if they don't stop there, or if you get lucky. If you want t to happen as soon as a unit moves into the tile, you would need a check in def onUnitMove(self, argsList):
Psychic_Llamas Mar 30, 2008, 12:14 AM hmmm
so, let me see if i understand this:
the comet unit would start with "imacomet" (or whatever) promotion, and when the python sees this promotion it ausomatically grants that unit a combat promotion each turn untill it is upto combat 5.
as this happens, python would check to see if a unit has 'imacomet' and combat 1, if it does it causes a 10% chance for the unit to blow up causing damage to units on top of it only. it would then check for imacomet +Combat 2, and if it finds any then it would cause a 20% chance that it blows up damaging units on top of it a bit more. continues on until it checks for imacomet+combat 5, when it causes 100% detonation and damages all units within 2 squares of it significantly.
is that about right?
would an easyer way be to make the spell create an improvement called 'Comet I' which automatically upgrades to 'comet II' on the next turn, and then comet II upgrades to comet III etc. like the tower/castle/fortress mechanism but much faster.
python would then run the checks for % chance detonation and then cause the damage and area of effect for each improvement level? the problem here would be that it wouldnt be invisble, but i dont really mind if it is invisible or not, im pretty sure a horde of orcs would see a massive comet hurtling towards them, dont you? :p
and heres a thought, if i get this to work Lutefisk could use it for timed traps which rogue heros could build :p
Lutefisk Mafia Mar 30, 2008, 06:51 PM Yes, I am still obsessing with my traps.
I changed them over to a onUnitMove function in the CvEventManager file, and I am much happier with the way they work. Traps now trigger as soon as you step on them -- right in mid-turn.
I will do this for Glyphs, too.
I am next going to polish off some interface graphics and sound for these items.
Anybody know a good WAV file editor? I am trying to add some dead air to the beginning of a certain WAV file, so that I can repurpose it to a new use.
EDIT: I downloaded Audacity. Works like a charm! Now my "permanent" traps and Glyphs have a tell-tale "reset" sound to let the player know something is up.
civ_king Mar 30, 2008, 06:55 PM Heads up FYI D&D V4 is coming out this summer :)
me and my friends play (we are only 12-16 hehe)
Lutefisk Mafia Mar 30, 2008, 08:09 PM Heads up FYI D&D V4 is coming out this summer :)
me and my friends play (we are only 12-16 hehe)
I still have my old V1 AD&D books, copyright 1979. In fact I use the old Dungeon Masters Guide and Players Handbook for ideas. Gotta love the old DMG with the picture of the Efreet on front.
Lutefisk Mafia Mar 30, 2008, 10:09 PM It is nice to have this done and working the way I want. A screen shot is below:
http://img296.imageshack.us/img296/2092/finaltraps0000yw9.jpg
This image is from WorldBuilder view, so the hidden units are visible. The first room holds a trap, and the room further in holds a glyph.
Traps can be:
1. single tile traps that trigger on their own tile only or
2. area traps that trigger on their own tile and within a radius of one tile.
Trap units come with free "trap" and "hidden" promotions. If you want a trap to be an area trap, you go into Worldbuilder, remove the "trap" promotion, and give the trap the "area trap" promotion instead.
Traps have different effects, depending on whether they are given additional promotions. The default, if there is no additional promotion, is that the trap is a purely mechanical trap that does physical damage. I used certain mana promotions, like death1, to flag for other damage types. Accordingly, a trap can deal out any of the 8 damage types, but it can only inflict that one type, not multiple types.
Traps can also be given the "defensive" or "rusted" promotions. (Currently, these are stand-ins for trap-specific promotions that will have the below listed effects.)
The "defensive" promotion makes the trap "rehide" itself after each triggering. I'll probably make a new promotion called "concealed" to cover this function at some point. Traps without this promotion reveal themselves after the first triggering. A revealed trap can be rushed by a unit -- traps have low strength, but cause extra physical damage and explode on combat. This is the crudest way to remove a trap, but only works on traps that have been revealed.
The "rusted" promotion causes a trap to destruct after being triggered. This is to designate a "one-use" trap. I'll probably make a new promotion for this function called "disposable" or something like that. (Right now, it is technically possible for spell casters to junk traps by casting rust on them! Hmnn. Maybe I'll keep it that way.)
Glyphs are always "area trigger" units. They cast spells instead of inflicting a damage type directly. In a sense, they are like magical traps. Glyphs can have the "defensive" and "rusted" promotions just like traps, and they have the same effects.
Took me a while to get the interface messages to display correctly but that is done. I also rigged up some sound effects that get added on to the traps that re-conceal themselves -- sort of a "reset" sound that happens a bit after the main activity. I added this as an auditory clue to the player to let them know that they are dealing with a persistent trap instead of a disposable one.
Well, that's all for this update. I think my next focus will be to extend the "grab" and "drop" functions to more bonuses than just horses. I plan to make these bonuses important for enabling upgrades. Since this is a "one city" type of game, the player will have to find these resources and then carry them back to the cultural radius of the campfire (city). Some bonuses may also be needed as material components for the more powerful spells!
'Til next time!
Lutefisk Mafia Mar 31, 2008, 01:29 AM I goofed around with some art today -- and made the main and loading screens. Here is a screenshot of the loading screen:
http://img113.imageshack.us/img113/4179/loading0000pg6.jpg
I'm trying to give the mod an old Pencil and Paper D&D feel.
Hope you like it!
mtagge Mar 31, 2008, 03:30 AM @mtagge: You are hired!
Sorry for leaving you hanging over the weekend, I don't have access to the Internet at home, and we have half day Fridays. :(
Let me know if you still need help with the trap code by PM, but it sounds like you already have it taken care of. If it helps, feel free to take a look at my code posted in the conditional promotion thread, and I might also recommend the code in Final Frontier for damage based on tile hazards.
Psychic_Llamas Mar 31, 2008, 03:44 AM Excelent stuff! i really am dying for a play test version of this :D
blackCat Mar 31, 2008, 03:53 AM Excelent stuff! i really am dying for a play test version of this :D
:goodjob::goodjob::goodjob::goodjob::goodjob:
I think the same !!
When shall we can play test ??
:goodjob::goodjob::goodjob::goodjob::goodjob:
woodelf Mar 31, 2008, 04:03 AM I'll 3rd that. I want to play!
The best part of games like these were the HoF and seeing how far your different games progressed until your Hero died. :D
Lutefisk Mafia Mar 31, 2008, 08:53 AM I'll 3rd that. I want to play!
The best part of games like these were the HoF and seeing how far your different games progressed until your Hero died. :D
I am going to try to make this an escalating game, like rogue. It won't have multiple levels, of course, but stuff will re-spawn on the map from time to time. I am hoping to hijack and repurpose the Armageddon Counter to make it act as a sort of "let's gradually increase the difficulty" ticker. Depending on the AC, different monsters, goodies, and traps will spawn. The more baddies you kill and good stuff you find, the higher the AC gets.
Eventually, it will get so difficult that the Heroes will almost certainly die. The fun is to see how far you can get. Like rogue, this will most often be a 15-30 minute game from start to finish, maybe a bit longer.
xienwolf Mar 31, 2008, 08:56 AM Sweet work all around Lute :) But could you use [ spoiler ] [ /spoiler ] tags around your images, or reduce the size a bit, for people who have their browsers on slightly lower resolutions? (Though I always thought I had mine fairly large. Must be the small screen :))
Psychic_Llamas Mar 31, 2008, 09:16 AM the armageddon replacment sounds like fun! i might actually play with it enabled! :wow:
woodelf Mar 31, 2008, 09:18 AM I am going to try to make this an escalating game, like rogue. It won't have multiple levels, of course, but stuff will re-spawn on the map from time to time. I am hoping to hijack and repurpose the Armageddon Counter to make it act as a sort of "let's gradually increase the difficulty" ticker. Depending on the AC, different monsters, goodies, and traps will spawn. The more baddies you kill and good stuff you find, the higher the AC gets.
Eventually, it will get so difficult that the Heroes will almost certainly die. The fun is to see how far you can get. Like rogue, this will most often be a 15-30 minute game from start to finish, maybe a bit longer.
So each random map will be played until the Hero dies? Gotcha. I was wondering if it was like that or if each map was finite and once finished the Hero could then be exported into a new map (game) somehow. I just can't wait to see the HoF! How many categories can you have? Most kills? Highest Lvl Hero? Most items recovered?
mtagge Mar 31, 2008, 10:52 AM Are you going to be keeping with the CIV IV combat method throughout this entire mod (i.e. all combats are fatal to one of the two parties) or do you plan on implementing some way so that each attempt at combat will be interrupted and replaced with some sort of a strike that does a certain amount of damage and may or may not actually land?
If you keep with the original way of doing damage I imagine that it could end up being a short game indeed more frequently than desired. Shouldn't be too hard to do in python. The other workaround I would suggest for some of the mobbing tactics would be to implement a stacking limit. Interrupt the canMove function to prevent movement to a space with a friendly model (or whatever the limit is).
Just throwing out ideas, feel free to call me crazy. I might mess around with some code of that sort as I get free time during the week. Maybe make the unit's level determine the chance to connect, the combat strength determine the damage and setup some promotions to affect each of the numbers.
Lutefisk Mafia Mar 31, 2008, 12:20 PM @woodelf: I'd love to figure out how to export information from a "finished" level to a new map. There has been talk about that elsewhere in these fora but to my knowledge, no one has pulled it off yet. So -- Dungeon Adventure will ikely be a single map thing at first. But it could be a single player on a huge map. That provides plenty of real estate to explore.
As far as maps being random -- I am totally at the mercy of the benevolence of a map scripter to accomplish that. It would be great to come up with a map script that spat out dungeons, but I have no clue how to do that. At least in the beginning, maps will be hand made in WorldBuilder. But people can make map/scenarios and trade them around, so it won't be too terrible. I am trying to make a solid, easy to use schema for WorldBuilder so that it will be painless to make these dungeons.
@xienwolf: Oops. Yes, I will use spoiler tags for my big images. Those are screen shots off of a widescreen LCD, so the aspect is a bit, well, huge. I suppose I could rescale them, too.... but that sounds like work! :p
@mtagge: I'll probably keep the Civ4 combat model. The player starts with 3 adventurers, and as the campsite accumulates Great Person points, more adventurers will join the party. The player can also sometimes capture and convert "monster" units, and will have the ability to build or recruit "cannon fodder" units to help the main party. Don't forget that wizards have summonables, too. In all, the player will need to be a bit more strategic about what monsters to attack and when.
woodelf Mar 31, 2008, 12:24 PM Maybe cephalo can help with a mapscript?
Lutefisk Mafia Mar 31, 2008, 12:30 PM Just a quick note to other modders out there:
If you are designing a mod, one of the essential components is the artwork, since this is what the player sees the whole time. Modders like me can kludge our way through coding, but artwork is not my strong suit.
Never fear! There are two great sources for art that is okay to use.
1. The Civfanatics forum. The modding fora are full of unit models, interface buttons, and other goodies. Courteous practice is to ask the creator if it is okay to use it in your mod. I've |