Shoot a firework rocket ~ Winners!Make a forum zoo! |
| Welcome to The Round Table. We hope you enjoy your visit. You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you're already a member please log in to your account to access all of our features: |
| Thom's projects | |
|---|---|
| Topic Started: May 17 2013, 01:05 PM (93,566 Views) | |
| Panrex | Jul 28 2017, 11:03 PM Post #646 |
![]()
|
Really looking forward for that functional gift shop, Thom! I didn't even know it was possible to function like that. |
![]() |
|
| Iben | Jul 29 2017, 01:32 AM Post #647 |
![]()
There'll be no foot-walking! Just air-flying!
![]()
|
The only thing that would bother me then is that if you would have to place all fences on the correct height manually. For bigger buildings this might be a very arduous job... Unless you can clone it at a certain filling value, because that's something I never got to work when I tried coding plant variants like that.
|
![]() |
|
| keenakeen1 | Jul 30 2017, 06:11 AM Post #648 |
![]()
|
Do you have any variants for dinosaurs and marine animals for you functional gift stuff? Because I would like to have a dinosaur theme zoo with a functional gift shop.
Edited by keenakeen1, Jul 30 2017, 06:12 AM.
|
![]() |
|
| Thom | Jul 30 2017, 11:14 AM Post #649 |
![]()
Master Of Quack Fu
![]()
|
@Keenakeen1: Not yet, but I' will definitely add them to the pack ![]() Iben sent me a bunch of new gift shop model yesterday, so I'll code some new variants this week ![]() A lot has happened with the height editable object coding since I showed it Most people won't understand what I'm gonna say now, but some coders might find it fun ![]() [codingtalk] In the version from the video I used the superstaff action to set an attribute called 'f_Signal' from default value 0 to value 1. f_Signal="1" then activated a .tsk task which added 1 to an attribute called f_Height and set f_Signal back to 0, so I could perform the superstaff action again. f_Height was bound to the BFAIFadeController and gives the change of height offset. Sounds pretty cool but it's far from ideal. While I was testing I noticed it worked, but it took the game about 8 seconds to set f_Signal back to 0, thus every time you had changed the height you had to wait 8 seconds before the next change. I created a workaround by adding multiple superstaff actions with different attributes that all activated the height change. So f_Signal1, f_Signal2 etc. This is the version you see in the video. Although it works okay it just doesn't feel right, e.g. not every time you press spacebar the height increases , and if you don't add enought attributes you still have to wait... So I came up with something else. Ideally the superstaff action would add one to the current height value directly, but that's not how these superstaff things work unfortunately. Then I came up with the new coding: scripts! I wrote a .lua script based on one of the few available uncompiled lua scripts and bound it to the superstaff action. This lua script evaluates the current value for f_Height and f_Test. It then adds one to f_Height and resets f_Test, so you can perform the staff action again. You guys will never know the difference with the old version but trust me, ingame it feels so much nicer than the old version. Each new object, foliage etc. that uses the height change coding will need its own little script. But I made it really easy, here's the template that can be used for all foliage:
So you only have to change 'Codename' two times, which takes about the same time as editing the .tsk from the old version. You can just edit lua's in Notepad so no worries. All the other code gets called from the script I wrote, and will be included in a template download, so it's not as simple as it looks BTW, in the process I also learned how to send (custom) booleans to objects/animals using lua scripts, which was not possible with the default SetAttribute superstaff action. It might come in handy in the future and I'll release the coding once I've cleaned it up ![]() [endcodingtalk] Soooo that was a lot of technical stuff. Next update I'll include some pictures ![]() BTW, in the process I also learned how to send (custom) booleans to objects/animals using lua scripts, which was not possible with the default SetAttribute superstaff action. It might come in handy in the future ![]() Edit: Just came to my mind I could try to add a create a new xml type, so all foliage coded under this type will automatically use the same script. Saves us a lot of scripts, gonna try it out ![]() [endcodingtalk] Soooo that was a lot of technical stuff. Next on my to-do list is see if I can add a proper lowering function without interfering with the raising function, and try to code independent seperate scale and height controlling in one object (now they're bound together). Oh and of course the gift shop is still being worked on ![]() |
![]() |
|
| HENDRIX | Jul 30 2017, 11:35 AM Post #650 |
![]()
-retired-
![]()
|
Cool stuff, but couldn't you pass the coding name from the task as a parameter to a generic script? Very much like it is done when particles are played:
So maybe
and then in the lua just use:
Edited by HENDRIX, Jul 30 2017, 11:41 AM.
|
![]() |
|
| Thom | Jul 30 2017, 11:51 AM Post #651 |
![]()
Master Of Quack Fu
![]()
|
I get your point, but I assume you add this code in a beh/tsk? I don't use a beh/tsk file, my only reference to the script is in the main xml <ZTUserStaffAction> <SetAttribute name="f_Test" value="10" locid="superstaff:animal_poop" postscript="behavior:scripts/HeightSet.lua:ReturnHeight" /> </ZTUserStaffAction> Edit: The xml type coding works btw. <types> <entity> <foliage> <plant> <bush> <HeightChanger> <Codename/> </HeightChanger> </bush> </plant> </foliage> </entity> </types> All foliage under the HeightChanger type can now use the same script. I can make a similar type for the objects, rocks etc. of course Edited by Thom, Jul 30 2017, 11:57 AM.
|
![]() |
|
| HENDRIX | Jul 30 2017, 11:57 AM Post #652 |
![]()
-retired-
![]()
|
Ah I see. In that case you could still try coding it like a gift lua, so it gets the subject from its context rather than an explicitly specified parameter. |
![]() |
|
| Thom | Jul 30 2017, 11:58 AM Post #653 |
![]()
Master Of Quack Fu
![]()
|
Hmm I'll try to find a gift lua that's not compiled to see what you mean ![]() |
![]() |
|
| HENDRIX | Jul 30 2017, 12:04 PM Post #654 |
![]()
-retired-
![]()
|
The AA ones are good to go ![]()
|
![]() |
|
| Thom | Jul 30 2017, 12:08 PM Post #655 |
![]()
Master Of Quack Fu
![]()
|
Hmm in my game files (x301_000.z2f) the Gerenuk gift and all other AA gifts are .bin files ![]() Thanks for this though! |
![]() |
|
| HENDRIX | Jul 30 2017, 12:20 PM Post #656 |
![]()
-retired-
![]()
|
How mean! With separate expansions, all AA scripts (scenarios + gifts) are uncompiled LUAs, but everything else is compiled. Do you have any non-AA LUAs in the UC? Wait there's more, challenges and awards have many uncompressed files too... Edited by HENDRIX, Jul 30 2017, 12:25 PM.
|
![]() |
|
| Thom | Jul 30 2017, 12:29 PM Post #657 |
![]()
Master Of Quack Fu
![]()
|
I have three .z2fs -x300_000 for the original ZT2. About 5 lua's in total, fortunately it included the very useful bfg_animal_needs.lua, which is the basis for my whole script ![]() -x301_000 for MM, ES and AA. Included award lua's for all three expansions. It also includes about 15 challenge lua's, some of them are definitely from MM. Not sure if there's also ES stuff there. -x302_000 for EA. Lots of award lua's, and 5 challenge lua's. So not much to work with if you have UC. Just that one script from the original ZT2 and a lot of guessing based on the .bins ![]() Edit: Tried recoding it with the gift code. Got it working by adding a tsk file with the script reference. However, like my first version it takes about 8 seconds after I've pressed spacebar before the height change occurs. I think this will happen with all coding involving tsks/.behs I'm gonna try some other things, but if I can't get it to work properly I'll just stick with the version that involves the specific scripts...
Edited by Thom, Jul 30 2017, 02:06 PM.
|
![]() |
|
| MonsterHunterGarth | Jul 31 2017, 02:51 AM Post #658 |
![]()
Switch Axe Gentleman
![]()
|
I somewhat know your pain, I have ZC, and EA/MM as separate discs, so I can't find some things when I'm looking for them. Like the textures for food objects are completely hidden, so I'm flying blind with my meat and berries remakes... >.> |
![]() |
|
| Okeanos | Jul 31 2017, 05:01 AM Post #659 |
![]() ![]()
|
Not to stray off topic, but I have this same set up. You can find those textures in x150_000.z2f, in entities/objects/shared. I am loving all of these new additions to the game Thom. Hopefully, your work may even inspire other designers to delve into coding! |
![]() |
|
| MonsterHunterGarth | Jul 31 2017, 09:52 PM Post #660 |
![]()
Switch Axe Gentleman
![]()
|
Thanks, OS. On topic: I too am loving this new code. Can't wait to implement it myself on food items, have different portion sizes for different animals to create the illusion some eat more than others. .3. |
![]() |
|
| 2 users reading this topic (2 Guests and 0 Anonymous) | |
| Go to Next Page | |
| « Previous Topic · Individual Projects · Next Topic » |

FAQ
Search
Members
Rules
Staff PM Box
Downloads
Pointies
Groups






I haven't tested it with fences yet but I guess it could work 











