Data Realms Fan Forums
http://forums.datarealms.com/

Lotta Questions
http://forums.datarealms.com/viewtopic.php?f=1&t=46092
Page 1 of 1

Author:  fv22 [ Sat Sep 17, 2016 11:36 pm ]
Post subject:  Lotta Questions

I got (as the title says) a bunch of questions about modding so if anyone is willing to help me out I'd be grateful, so here goes:

1: Is it possible to make a random weapon spawn in the inventory of a actor after a said amount of time? For instance : after 5 min, one of the dummy weapon spawn in the inventory of the dummy soldier.
2: How can you make someone hit by a weapon transform into another unit? For instance: after being hit with a magic stick, the coalition goes through a short animation and is now a frog.
3: Can you make a actor transform in another one after a said amount of time?
4: Is it possible to have a limit of the same actor in play? For instance : You can only have 4 dummy soldier at a time in play. Until on of them die, the dummy soldier is now unbuyable.
That's it for now. I don't know if all of this is possible in CC but if it is and you know a short lua script that could do that, feel free to write and post it ;)

Author:  RandomCoderZ [ Sun Sep 18, 2016 1:48 am ]
Post subject:  Re: Lotta Questions

fv22 wrote:
I got (as the title says) a bunch of questions about modding so if anyone is willing to help me out I'd be grateful, so here goes:

1: Is it possible to make a random weapon spawn in the inventory of a actor after a said amount of time? For instance : after 5 min, one of the dummy weapon spawn in the inventory of the dummy soldier.
2: How can you make someone hit by a weapon transform into another unit? For instance: after being hit with a magic stick, the coalition goes through a short animation and is now a frog.
3: Can you make a actor transform in another one after a said amount of time?
4: Is it possible to have a limit of the same actor in play? For instance : You can only have 4 dummy soldier at a time in play. Until on of them die, the dummy soldier is now unbuyable.
That's it for now. I don't know if all of this is possible in CC but if it is and you know a short lua script that could do that, feel free to write and post it ;)


1. Yes, Lua.
2. Easy! Lua. But they won't be "transformed" they will be replaced by say a jumper. But it will look like they are. (Closest to frogs in cc)
3. Yes, With Lua. You will loose held items when new character spawns. You can copy inventory with Lua but that's too advanced for me.
4. I guess you need Lua there too, I guess you can make a script that kills an actor when met a certain amount. Like it kills the latest Dummy after 5 has been counted. That's also way too advanced for me.

It can be a very short script with a timer for the first one.
The second one can be done easily too. Much easier if you skip the "Animation", though you can make magic effects emit at the same time when replacing. It's possible with animation but it's extra work.
Can't help you with the last one.

Author:  fv22 [ Sun Sep 18, 2016 4:30 am ]
Post subject:  Re: Lotta Questions

Lot of lua needed, too bad I just started learning it :/ Welp, I'll see what I can do... Thank you for the fast answer though!

Author:  CaveCricket48 [ Sun Sep 18, 2016 8:00 am ]
Post subject:  Re: Lotta Questions

RandomCoderZ is pretty accurate, I'll just elaborate a bit.

2. "Transforming" isn't something that can be done in CC. The illusion of this is accomplished by deleting the original and spawning a new entity in its place.

4. As far as I know, you can't restrict or control the buy menu using Lua. Checking for the number of currently used actors of a specific type is easy, run through all the actors and count the ones that are on a particular team, and if their PresetName matches the name of the actor you're trying to limit.

Actually imposing the limit, it depends on how you want to do that. If you want to delete any new actor of the limited type if there are too many, you can do a LifeTime check (a variable that is the in-game Age of an entity) and delete the youngest one.

Author:  fv22 [ Sun Sep 18, 2016 3:00 pm ]
Post subject:  Re: Lotta Questions

Well, it sound much more complicated than I though it would so I think I just won't bother imposing a limit since it's mostly for fluff reasons and I better stick with what I can do.

Author:  Bad Boy [ Sun Sep 18, 2016 11:28 pm ]
Post subject:  Re: Lotta Questions

I recall there being a few functions that involve the buy menu and possibly its countdown but I don't remember what they may have been.

Still, the best thing would probably be to search for any crafts belonging to the team you're limiting, and look through all the actors in their inventory, then, if the craft contains too many of the actor you want to limit, remove them and refund their cost and, if the craft is then empty, remove and refund it or set its ai to return. If possible, just do that when the order arrives so you don't loop through all the actors unnecessarily, otherwise do it every few hundred milliseconds I guess.
There may be more you can do though, I'm not sure.

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/