Edible food. - by New Horizon
New Horizon on 8/4/2005 at 03:46
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?
Krypt on 8/4/2005 at 05:17
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.
New Horizon on 9/4/2005 at 13:42
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.
Krypt on 10/4/2005 at 01:38
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.
New Horizon on 10/4/2005 at 04:58
Quote 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.
New Horizon on 16/4/2005 at 22:49
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?
New Horizon on 16/4/2005 at 23:04
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.
SneaksieDave on 16/4/2005 at 23:25
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. :confused:
New Horizon on 16/4/2005 at 23:50
Quote 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. :confused:
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. :)
New Horizon on 17/4/2005 at 03:19
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.