Automation gunner

Discussion in 'Modding and Scripting Support' started by Tekkus McDwarf, Nov 16, 2007.

Remove all ads!
Support Terra-Arcanum:

GOG.com

PayPal - The safer, easier way to pay online!
  1. Tekkus McDwarf

    Tekkus McDwarf Member

    Messages:
    108
    Likes Received:
    0
    Joined:
    Oct 13, 2005
    It looks like there isn't much needed to get this guy up and running. Firstly, the regular automation script that transforms it from a thrown object to a follower (30008Automaton_hit.scr) could be edited to check for which prototype it is, the automation, or gunner... and then branch into which proto type it is for npc type. Same thing in reverse for collapsing it to throw again (30009Automaton_talk.scr). Lastly, by comparing the dwarf bounty hunter and automation npc proto's, it IS possible to get an automation to behave like a gunner, and even drop a gun when it dies, but keep it as type monster instead of critter, so loot box only appears on death. The branching idea for the scr is just to save on all the hexediting in new script numbers into the new proto. I suck at scripting, but am working on the new proto. 28475 is the description.mes listing I'm using for the Automation Gunner for the moment. Since I can't do the sripting for crap, all my automations will become Gunners for the sake of editing / testing the proto - which is a modified automation edited to behave like a gunner.


    EDIT: I can't get it to use the monster.txt table like the automation does, does that need to be DAT'd in? I've gotten rid of the problem of it looking like a naked dwarf, no problem, and gotten rid of its repair apprentice and 2 points it had in there, but still can't get its name to show up after its thrown. Haven't yet started on its behavior, still hunting thru hex for all sorts of stuff.
     
  2. Tekkus McDwarf

    Tekkus McDwarf Member

    Messages:
    108
    Likes Received:
    0
    Joined:
    Oct 13, 2005
    Update :thumbup:

    I have succesfully spliced an automation code with bounty hunter, but it needs massive tweaking. In the process, the data structure to protos is rapidly becoming more clear, and as such, so is the means to edit it an update the ancient proto docs. It seems the data blocks for information such as relates to specific object types such as weapons, armor, npc's, monsters, etc. all have floating blocks identified by FFFF FFFF blocks and intial bit flags. With the help of hexworkshops new structure definitions in the 5.0 beta, which JUST freaking expired, it's all beginning to make sense as to the exact make up of the structure format, regardless of the exact identification of the variables contained. Once the blocks can be nailed down, the specific variables within will yield themselves fast. Since 5.0 expired, I'm stuck back with the crappy 4.23 release version with the structure viewer that is buggy as hell and won't work correctly with enumerated data. So I'm dealing with it by using color mapping, even though its all tied to specific values that way, the structures are very clear, but its slow and painstaking by comparison. As soon as breakpoint software releases a new beta version or makes 5.0 a final version, I can go back to the much faster data structure viewer and publish some findings which any programmers will find extemely useful for creating a REAL proto creator/editor.
     
  3. jfkoski

    jfkoski New Member

    Messages:
    242
    Likes Received:
    0
    Joined:
    Aug 28, 2007
    My understanding of the Automaton Gunner was that the gun was supposed to be built in.

    Thinking about it I could see why they didn't finish. I mean, how would you give it bullets? You would have to have something like in CarArcanum where Virgil won't take unidentified equipment, except for everything that's not a bullet.

    I am curious as to whether there was a code for the automaton gunner so it would tranform into that instead of a normal automaton when unpacked.

    Likewise for the other schematics that won't unpack.
     
  4. Tekkus McDwarf

    Tekkus McDwarf Member

    Messages:
    108
    Likes Received:
    0
    Joined:
    Oct 13, 2005
    haven't gotten that far into it to be feeding it bullets. It still default melees. My biggest problem at the moment getting it to find its monster or npc.txt list. The unpack part was the absolute easiest. Since I can't code branching logic into scripts, I just modified the automaton_hit and _talk texts to point purely to the gunner numbers in the proto folder and in the description.mes file. The automaton BOX code ... i think its 1667 is shared by BOTH the automaton and gunner, so to work it needs to be changed to branching logic that detects the different names in oname, rather than going by the generic throwable automaton box.

    As for bullet feeding, I'm not 100% convinced of the need for it. There appear to be seperate weapons spots in NPC.pro later structure... so non party npc's can shoot all day long, and when you kill them... they always have 20 bullets... no matter what. Giving an NPC range, damage, damage type, and minimum combat range, sound file... looks like it will work. I still haven't totally convinced the game that the automation_gunner is now an npc, instead of a monster. Interaction by TALKING with the gunner is impossible, since the script collapses it when you try... I won't be changing that. What i'm currently testing is combat, 1v1 with it... so that it doesn't say ANYTHING.. ever.. like on crit hits and missses. Its been 100% quiet so far. If the need to actually trade with it to give it bullets arises... it can be circumvented in script by every time the PC enters combat, it checks its bullet level, if <100 bullets, add 100 bullets. simple... that or giving it only two dialog options... collapse to box or give bullets. Keeping the inventory flag off is easy. The problem is finding the one damn flag that prevents it from ever dropping its weapon... and keeps it from picking up anything. The difference in npc and monster code is about 12 lines but they are exactly the same file size the blocks are just arranged differently and monster code just has a bigger buffer of unused code slots. It is slowly coming along.
     
  5. Tekkus McDwarf

    Tekkus McDwarf Member

    Messages:
    108
    Likes Received:
    0
    Joined:
    Oct 13, 2005
    Need a bit of help with what I think is a scripting problem here. I've gotten alot done proto wise... I've isolated the skills and stats portions and reassigned those. All I really have left to do is isolate the inventory number. The scripting problem arises from when I edited the automaton_talk and hit scripts to refer to the automationgunner (folded up in inventory and as a standing NPC). So here is the problem, when I fold one up the first time, it dissappears from party list, as it should. After hurling it out again, then boxing it up, and picking it up, Its still showing up in party list with whatever damage it had to begin with. I can repair the one in inventory and throw it and I know its health is different than the "phantom" one that has a circle on the floor where it last was. After that point, all commands cease to work, since apparently, I'm trying to give commands to a folded box on the floor. If I get in combat near anything on my party list, the one that is not a phantom attacks. I believe this comes from the OTHER 2 automation scripts which I didn't modify so that the accounting is skewed. The general concept for the whole thing works... just the picky details are left. That and the damned inventory source is HARD to find in a NPC - proto... then trying to slap it into a monster proto isn't that hard. I have found some 15 seperate block flags unknown so far that relate skills, stats, resistances, spells, but not for that one little mundane thing that gives it the inventory source I modified for it. It'll have 1 elephant gun and 100 bullets. I plan on getting someone to script it so that it cannot be disarmed, and when it goes into combat it checks to see if bullets are < 20, if so, it adds 100.
     
  6. Tekkus McDwarf

    Tekkus McDwarf Member

    Messages:
    108
    Likes Received:
    0
    Joined:
    Oct 13, 2005
    Ok, I got one "semi" working. Thanks to info smuggled across the Russian border, I know exactly the format to add inventory, and scripts to Proto file NPC's. however, I STILL suck at writing scripts. Currently my automation gunner keeps spawning elephant guns as long as in combat spilling them on the ground since there is "no more room for that item" within. Same for bullets. What I'm trying to do with the script is:

    1 check for combat y/n1
    y1= check for elephant gun and bullets (y/n2)
    n1= destroy elephant gun and bullets
    y2 = do nothing
    n2 = create basic prototype inside attachee (bullets or gun, whichever)

    Currently what I have that is polluting Tarant with elephant guns is :

    description ""
    MAX_LINES_ALLOCATED 10

    0. IF Attachee has item named 6039
    THEN do nothing
    ELSE create item with basic prototype 6039 inside Attachee

    1. IF Attachee has item named 7039
    THEN do nothing
    ELSE create item with basic prototype 7039 inside Attachee

    2. IF Attachee is in combat
    THEN create item with basic prototype 7039 inside Attachee
    ELSE loop for Attachee

    3. destroy item named 6039 in inventory of Attachee

    4. destroy item named 7039 in inventory of Attachee

    5. return and RUN default


    Note: currently using the START_Combat attachment, can use ENTER_ or whatever, it doesn't matter, whatever works best. The script it is currently mapped to is 30601, whereas the dialog script is the same as automation_talk (30009 - can't remember off the top of my head-- its the last thing I'll do since it works for now with the automation gunner info rewritten over normal automation stuff.)
     
  7. Tekkus McDwarf

    Tekkus McDwarf Member

    Messages:
    108
    Likes Received:
    0
    Joined:
    Oct 13, 2005
    Frustrating discovery

    I've recently discovered that which keeps the automation from arming itself, its the art for automations. I've eliminated everything else and tested it. Putting the automation artwork on any NPC reduces them to pure melee. In order to get an automation gunner, we'll have to have a crack at its artwork/animation.

    After using one of the Russian artview tools by Blacky, I think the new art can be easily made by just removing the right arm of automations and just smacking on a glorified tube or 2handed gun art from any of the other races of just the gun barrel. All automations are left handed meleers and on attack their right shoulder swings back just like the recoil effect from 2handed gun users. Shouldn't be much trouble to either revise existing Automation animations but I don't know how to go about getting it all in as a brand new type of .ART for a monster/critter.
     
  8. Tekkus McDwarf

    Tekkus McDwarf Member

    Messages:
    108
    Likes Received:
    0
    Joined:
    Oct 13, 2005
    I GOT IT TO WORK! Instead of rebuilding the dat, etc, I went on a hunch. I renamed the automation attack file to AUTUWxku.ART(following both the AUTUW_ and the hmmcdx naming convention) and dumped it in /data/art/monster/aut... I now have an "automation gunner". I had to hex edit the header info to match all the CF00 references in its hmmcdxku.ART file.. it works.. but it adds gold to the automation if it dies, and a few other things like "I think we should run" when its health is low. But, I just need to sort out all the scripting differences between automations / autogunners and it will be 100% finished. When I'm done, I'll have a zip with install instructions... it will add 1 art file, 2 prototypes ( 1 object for folded up inventory verstion, 1 npc follower type ), 2 script files. It will I'm still messing with its AI so it will disengage melee range targets and back off to missle range and fight that way. I have the day off today and only one school assignment. I might could wrap this whole thing up today!
     
  9. rroyo

    rroyo Active Member

    Messages:
    3,319
    Likes Received:
    0
    Joined:
    Oct 13, 2006
  10. Tekkus McDwarf

    Tekkus McDwarf Member

    Messages:
    108
    Likes Received:
    0
    Joined:
    Oct 13, 2005
    Ok, this is still a WORK IN PROGRESS! I've uploaded what I've got thus far with install instructions. I built this thing to fit into Rroyo's current WIP 2.2 build. It needs some more polish, but its mostly in the scripting where that polish needs to go. That is why I'm going with what I have so that playing with it will encourage those who can script what it needs to do so. You don't need a schematic to even start playing with an Automation Gunner, just a regular automation. Just click on one of yours, pick it up, and throw it. It will forever be an automation gunner. That is the way it is for now until I put in the scripting attach points into the automation gunner inventory object and get that scripted as well. For those who have wanted an AG forever... smile.. this is for you.


    Automationgunner.zip
     
  11. rroyo

    rroyo Active Member

    Messages:
    3,319
    Likes Received:
    0
    Joined:
    Oct 13, 2006
    One thing though - In your install instructions you said the players needed to add lines to various mes files. The average player doesn't have access to those files, Tekkus.
    You'll need to include them in your zip.

    Edit: Change the InvenSource.mes line to this:
    {151}{Automation Gunner (Automation Gunner): 0,0 2000,6039 2000,7039 2000,7039}

    That gets rid of the gold.

    Now then, on the play-through with this, when the gunner ran out of bullets, it reverted to conventional melee rather than reset the inventory. Just like a normal gunfighter.

    I'll test this further when I get home tonight.
     
  12. Tekkus McDwarf

    Tekkus McDwarf Member

    Messages:
    108
    Likes Received:
    0
    Joined:
    Oct 13, 2005
    Yes, I know. I didn't post it for "most users", just the mod squad that could help me with details (thanks for the inventory fix to get rid of the gold coins btw!!) I have nearly put my head through a wall trying to learn how to script to keep them supplied with bullets and to guard against disarms and broken elephant guns. Was hoping you would have some insight to the enter combat script that I've attached to it for the purpose of keeping it armed and ammo'd. I discovered awhile back, that even though some NPC's have unlimited ammo until you kill them and loot to find exactly 20 bullets, as soon as they become a follower that changes. Once this is all hammered out, there could be as many flavors of automation gunners as there are guns, but with the animation we are stuck with... a manual grenade tossing automation seems more realistic... and probably not a bad choice either.
     
  13. rroyo

    rroyo Active Member

    Messages:
    3,319
    Likes Received:
    0
    Joined:
    Oct 13, 2006
    I'm not so sure keeping them supplied with bullets would be a good thing.

    From what I've seen this morning (1 hour), it behaves much the same as any other gunfighter follower. Therefore, having the gunner start off with the weapon and a few rounds seems reasonable, but to be fully resupplied each time the player picks it up and throws it? ehhhh....

    Given the vast amount of wealth in any version of the game, it wouldn't kill the player to spring for a few bullets.

    I do have a question. I noticed that just before it enters combat, it will disappear for an instant, then reappear and fire. Is this normal?

    And I like the grenade Automaton idea.
     
  14. Tekkus McDwarf

    Tekkus McDwarf Member

    Messages:
    108
    Likes Received:
    0
    Joined:
    Oct 13, 2005
    Near as I can tell on the dissappear thing.... left over problem from trying to splice two ART files together in a hex editor. Might be solved by simply taking a fresh copy of hmmcdxku.art, renaming it AUTUWxku.art(or whatever its named in the zip, I forget). As for the "bullet moral dilemma" mostly I don't care how it works, just that it does. Game has been without this little wonder for too long. The resuppy problem can be solved by setting inventory to 0 in the *.pro and manually adding the maintained gun/ammo by script. If you are not a believer in supply sided bullet economics... an automation could be modified to become a "personal ogre Friday" or some such. I could set its size larger (or smaller) and give it skills like repair, reduced melee, heal, etc....it would be an NPC, and be given dialogue options to repair, heal, resupply, etc.. or scripted to do it automatically. But the thing is, most players want ease of play without a ton of maintenance. Just think of what you want. Its all going to have to be done one way or another.... and leaving it to the player will mean we'll have to hear what a pain in the ass it is to simulate the reality of actual chores.
     
  15. rroyo

    rroyo Active Member

    Messages:
    3,319
    Likes Received:
    0
    Joined:
    Oct 13, 2006
    Now that you mention it.....

    Edit: Bug spotted.
    During encounters with the Malochean Hand, the gunner turns away and says, "Don't be attacking my friends!" or "Don't attack my old mates!"

    It hasn't lowered it's reaction to my maxed-out PC, but it won't fight the Hand. However - It will blast away at the summoned critters.

    The character sheet lists it as a Dangerous Looking Man, so perhaps it's accessing the Hand override dialogs.

    Also, in the wilderness, the disappearances take place after combat, not during like it did in the Tarant sewer. Odd...
     
  16. Tekkus McDwarf

    Tekkus McDwarf Member

    Messages:
    108
    Likes Received:
    0
    Joined:
    Oct 13, 2005
    I'll get on it. This *.pro is a hybrid of Monster/NPC.... there is none like it. It'll take some time to find the exact parts for that. Sounds like a simple thing that can be done in the scripts though (#automation_hit.scr) so when you throw it, it becomes a member of party faction. I can hunt for it in the proto, but whole round optional sections were hammered into square pegs for just a DWORD or two that did something I needed.
     
  17. rroyo

    rroyo Active Member

    Messages:
    3,319
    Likes Received:
    0
    Joined:
    Oct 13, 2006
    I'm coming up blank on this, so....
    For anyone with scripting skills:

    Tekkus is looking for a way to keep the Gunner constantly supplied with bullets.
    What's needed here is a way to check the quantity of bullets (it's 20 to start and # 7039) and automatically generate another ten (.pro stock amount) whenever the amount in the inventory <=10, then deactivate until the <=10 level is reached again. (Heartbeat script?)

    Tekkus: I stumbled across a way to bypass the Hand affiliation problem.
    Add this line to the 30008Automaton_hit.scr:

    2. faction of npc Attachee: set to 0

    Unless, of course, you want to hex-edit the faction from 7 to 0....
     
  18. Tekkus McDwarf

    Tekkus McDwarf Member

    Messages:
    108
    Likes Received:
    0
    Joined:
    Oct 13, 2005
    ah! thanks! knowing the value will help find it. code can be so pesky that way. As for the scripting the ammo... I've seen the condition "(obj) has item named (num)" and the action "create item with basic prototype (num) inside (obj)" but I have had no luck getting it to work... or even know if those are the ones I should be using. As you can probably tell from my previous attempts at scripting... the immediate combat zone of an automation gunner is filled with excess elephant guns.. lol
     
  19. rroyo

    rroyo Active Member

    Messages:
    3,319
    Likes Received:
    0
    Joined:
    Oct 13, 2006
    In spite of what you said earlier, no.

    I've been working under the assumption you'd solved that little problem as there's been no duplication of the gun or ammo.

    As far as this scripting goes, it's working good. You get the gun and bullets upon activation, and a reset on pick-up and redeploy.

    One amusing note - don't add anything to it's inventory as it will be lost upon pick-up.
     
  20. Tekkus McDwarf

    Tekkus McDwarf Member

    Messages:
    108
    Likes Received:
    0
    Joined:
    Oct 13, 2005
    hhmmm.... there must be something screwy with the saved game I'm testing with. This damn thing spews elephant guns all over. I can't check inventory on any automation until its dead either. Thanks for providing a comparison, I know now I'll need to try it on another saved game. I should probably be testing it on a plain vanilla Arcanum, but I've been testing it with the WIP in mind and on that version. I believe we've discussed the possibility of my having a glitch before.
     
Our Host!