TTLG|Jukebox|Thief|Bioshock|System Shock|Deus Ex|Mobile
Page 1 of 2 12 LastLast
Results 1 to 25 of 31

Thread: Edible food.

  1. #1
    Member
    Registered: Jan 2004
    Location: Prince Edward Island, Canada

    Edible food.

    Anyone tried to achieve this yet? I'm thinking if it's treated like a health potion, perhaps this could be achieved with a trigger script? Any thoughts?

  2. #2
    Member
    Registered: Feb 2005
    This would be pretty easy to do, I think. Make a subclass of HealthPotion in gamesys and change its ObjectMesh to whatever food mesh you want to use. Then copy the HealthPotion script and change the parameters to appropriate values, like a lower healing value and a different sound. Put the new script in place of the HealthPotion script on your new gamesys archetype. Then edit the Inventory section in the properties to whatever you want, at least the InvName property so it doesn't say it's a health potion in your inventory. I think it would work after that.

    If you want go a more simple route with only scripting changes then just change the script condition to "When I am frobbed by player" and add an action at the end "Delete linked objects [MYSELF]" This will automatically eat the food when it is frobbed in the map.

  3. #3
    Member
    Registered: Jan 2004
    Location: Prince Edward Island, Canada
    Ahhh, that's cool.

    I'm curious though Krypt, is there any way that this could be made to work with the existing missions without rebuilding them? If I were to comment out the trigger script in the map, in the same way we comment out textures, schemas and sound and place them in the dynamically loaded folder, will the game search for it in another folder?

    I was hoping to get integrate this into the original missions for fun.

  4. #4
    Member
    Registered: Feb 2005
    If you added these changes to the decorative food physics objects in gamesys, the change should propagate to all of the instances in the game without the need to edit any maps.

  5. #5
    Member
    Registered: Jan 2004
    Location: Prince Edward Island, Canada
    Quote Originally Posted by Krypt
    If you added these changes to the decorative food physics objects in gamesys, the change should propagate to all of the instances in the game without the need to edit any maps.
    Not exactly sure how to go about that. I'm taking it neither of the previous suggestions would work that way would they? I'm assuming a new trigger script has to be created. You'll have to excuse me, I'm really new to all this.

  6. #6
    Member
    Registered: Jan 2004
    Location: Prince Edward Island, Canada
    I am able to get food to appear in the items menu when frobbed, just like the old games. When I attached the health potion trigger script, a loaf of bread acts like a health potion, it's removed from my inventory and restores my health but if I copy the health potion script and name it HealthFood and then assign it to the bread in the gamesys like the HealthPotion trigger script was, the bread disappears but does not restore health. If I understand what you explained above, I should be able to save the trigger script to the gamesys without altering the other levels and it should propagate.

    Just wondering if there is something I'm missing.

    What I do is, go into the triggerscripts manager and create my HealthFood trigger script, which should behave exactly like a health potion script (for testing purposes). Then I click ok. I go to the actor browser and hit "use" next to the trigger script section for the bread. HealthFood appears. I ok out of the trigger scripts manager and it goes through the process of saving my changes.

    Then I select my packages to save in the actors browser and exit the editor.

    I copy the altered files to my original installation folder and start a level fresh.

    Is it possible to have a new trigger script function without rebuilding the levels?

  7. #7
    Member
    Registered: Jan 2004
    Location: Prince Edward Island, Canada
    Doesn't make sense. I can see the script in the gamesys when I search it with a hex editor...so it's in there but for some reason the script isn't being executed. Yet, the only thing i've changed in the fuction of it all, is the name.

  8. #8
    You see the script in the gamesys? I didn't think they were stored there. I can't find any script I look for in the gamesys.

  9. #9
    Member
    Registered: Jan 2004
    Location: Prince Edward Island, Canada
    Quote Originally Posted by SneaksieDave
    You see the script in the gamesys? I didn't think they were stored there. I can't find any script I look for in the gamesys.
    That's where I'm confused...I don't know if it's a reference to the script..or the actual script itself. I can see the original healthpotion triggerscript ts_1434 and my own ts_4254, but my script won't do anything. It's a direct copy of the health potion script, so it should do the exact same thing. Hmmm. Just don't know if it's only a reference to it but Krypt said that it should be possible to do it with a trigger script without rebuilding the original levels, so I'm assuming I"m just missing something.

  10. #10
    Member
    Registered: Jan 2004
    Location: Prince Edward Island, Canada
    Has anyone had any luck creating custom scripts for the missions that shipped with the game? It's driving me nuts that I'm so close to having this but can't get it.

    Everything works except this silly trigger script to add the health and play the eating food noise. Damn.

  11. #11
    Member
    Registered: Mar 2005
    Location: Corvallis, Oregon

    Archetypes

    I think you need to create a new edible food item under PowerUp:Potion and attach the script to that instead of SetDressing:Food or the edible food will inherit the Food properties. Just a stab in the dark.

  12. #12
    Ohhh, I didn't think to look for the file name, I was searching on the script name. Interesting. Okay so then the gamesys does have to be recompiled with info for any new scripts. And yeah, I'd bet it's just a reference.

    I assume then you copied the actual script file over in the triggerscripts/defs folder? Hmm I wonder if you also need to update tsid.txt in the triggerscripts folder, to include the highest number of the scripts. Just a thought.

  13. #13
    Member
    Registered: Jan 2004
    Location: Prince Edward Island, Canada
    Quote Originally Posted by SneaksieDave
    Ohhh, I didn't think to look for the file name, I was searching on the script name. Interesting. Okay so then the gamesys does have to be recompiled with info for any new scripts. And yeah, I'd bet it's just a reference.

    I assume then you copied the actual script file over in the triggerscripts/defs folder? Hmm I wonder if you also need to update tsid.txt in the triggerscripts folder, to include the highest number of the scripts. Just a thought.
    Will that work with the original missions if I copy the trigger scripts folder over to my thief3 folder? I run a dual installation setup.

  14. #14
    Member
    Registered: Jan 2004
    Location: Prince Edward Island, Canada
    Quote Originally Posted by ascottk
    I think you need to create a new edible food item under PowerUp:Potion and attach the script to that instead of SetDressing:Food or the edible food will inherit the Food properties. Just a stab in the dark.
    For simplicity, I just moved the "Food" directory from set dressing to "Inventory". It is now treated like an inventory item, like in the previous games. The only problem is getting it to use the Trigger Script that I created from the copy of the health potion script.

    So far, I can frob and pickup any food item and have it appear with the rest of my items. I can then cycle through the items and use the food. It gets removed from my inventory, as it should.

    Now, where I'm confused.

    If I setup the food with the existing "healthpotion" triggerscript, I hear the standard health potion sound and health is restored by the same amount as a health potion. No problem, that's normal....but not ideal, as food should only restore a small amount.

    So, I switch to the copy of the health potion trigger script, "healthfood" and when I try to use the food, it is removed from inventory but there is no sound and no health restored.

    The new trigger script I created, ts_4254, is clearly visible in the content/t3/triggerscript/def folder in the editor, so I recreated this directory in my standard Thief 3 folder. When I search through my altered t3gamesys.t3u, the new trigger script is referenced there as well.

    I just don't know where the trigger script needs to be in order for the game to see it, or if there is something I'm doing wrong when I compile my new gamesys.

    If I understood what Krypt said, the trigger script should be saved to the gamesys.

    Very close to success but also very confused. Not going to spend too much more time on it as it was just something I was messing around with when I was bored. If anyone can get a new triggerscript to work with the existing missions, please let me know. I would appreciate the knowledge.
    Last edited by New Horizon; 17th Apr 2005 at 10:18.

  15. #15
    Member
    Registered: Jan 2004
    Location: Prince Edward Island, Canada
    Thought it might inspire some of you to see what I've actually done. I do all my work on a fresh install of T3, so it's not in a Minimalist Project setting.

    Pic 1: Edible Food - almost



    Pic 2: Usable Keys - Almost



    I've gotten it this far folks. Any assistance would be appreciated and fully documented in the next update of Minimalist.

  16. #16
    Ha! Awesome, NH.

    The answer to this question is vitally important (in case anyone doesn't realize it) because it will also tell us how to distribute custom scripts. This is one that needs answering.

  17. #17
    Holy crap, NH. If you&the rest of you guys keep this up I'm going to end up liking TDS.

    It's starting to make me feel bad that I've essentially ditched T3Ed to be honest...

  18. #18
    Member
    Registered: Jan 2004
    Location: Prince Edward Island, Canada
    Quote Originally Posted by SneaksieDave
    Ha! Awesome, NH.

    The answer to this question is vitally important (in case anyone doesn't realize it) because it will also tell us how to distribute custom scripts. This is one that needs answering.
    Exactly. I'm pretty much at a dead end for my part. I've done all my feeble abilities will allow.

    As for keys, when I try to "use" them on the door by pressing "i", all I get is the sound of pulling a flashbomb. If I frob the door, I go into picking mode. This is after I have the correct key in my inventory.

    The key is now set to an inventory type of "item" instead of "key". Is it possible to create new "item types"? If so, perhaps we could create a new manual key type.

  19. #19
    Irrational Games
    Registered: Feb 2005
    Is it possible that the original game executable loads scripts from the block file for the mission? You may need the editor executable to run new scripts, just a guess. Did you try the edible food by running the editor executable to see if it works?

  20. #20
    Member
    Registered: Jan 2004
    Location: Prince Edward Island, Canada
    Quote Originally Posted by rujuro
    Is it possible that the original game executable loads scripts from the block file for the mission? You may need the editor executable to run new scripts, just a guess. Did you try the edible food by running the editor executable to see if it works?
    You mean the T3MainRelease.exe that came with the editor? If so, that is the one I've been using.

  21. #21
    Irrational Games
    Registered: Feb 2005
    yeah, that's the one. Strange, my scripts have always worked. Wonder what is different about the original missions.

  22. #22
    Member
    Registered: Jan 2004
    Location: Prince Edward Island, Canada
    Quote Originally Posted by rujuro
    yeah, that's the one. Strange, my scripts have always worked. Wonder what is different about the original missions.
    Hmmm, I could be missing something.

    Could you briefly explain how you go about creating your own custom scripts and getting them to work ingame? From what Krypt said, it should easily work with the original missions. I just don't get it.

    What directory do you store them in?

    I can't find the health scripts hard coded into the levels themselves...so they must be stored in the gamesys and from what I can tell, mine is in the gamesys with no issues.

  23. #23
    Irrational Games
    Registered: Feb 2005
    Well, I never did anything specific to make them work. I define the script in the script editor, save all scripts, assign it to the object in the world, and it seems to work fine. The saving is always handled by the editor, so I haven't seen where it goes.

    Have you tried running from within the edtor, to see if that works?

  24. #24
    Member
    Registered: Jan 2004
    Location: Prince Edward Island, Canada
    Quote Originally Posted by rujuro
    Have you tried running from within the edtor, to see if that works?
    I haven't tried that yet. I'm running the editor in a separate folder to keep things clean. Might just have to wait and see if Krypt has any ideas, or if another ex dev pipes in.

  25. #25
    Member
    Registered: Jan 2004
    Location: Prince Edward Island, Canada
    Well, I can stop scratching my head as to whether or not I did something wrong. It works perfectly with the original levels when I run it through the editor. I'm not sure what could be different though, as I'm using the t3mainrelease version from the editor with my game insall folder and all the same t3u files as well.

    Must be just some little thing.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •