View unanswered posts | View active topics It is currently Thu Dec 26, 2024 5:36 am



Reply to topic  [ 6 posts ] 
 Lotta Questions 
Author Message
User avatar

Joined: Sat Apr 18, 2015 6:17 pm
Posts: 38
Location: Behind you
Reply with quote
Post 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 ;)


Sat Sep 17, 2016 11:36 pm
Profile
User avatar

Joined: Fri Sep 13, 2013 1:39 am
Posts: 157
Location: ᴱᵛᵉʳʸʷʰᵉʳᵉ
Reply with quote
Post 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.


Sun Sep 18, 2016 1:48 am
Profile
User avatar

Joined: Sat Apr 18, 2015 6:17 pm
Posts: 38
Location: Behind you
Reply with quote
Post 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!


Sun Sep 18, 2016 4:30 am
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post 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.


Sun Sep 18, 2016 8:00 am
Profile
User avatar

Joined: Sat Apr 18, 2015 6:17 pm
Posts: 38
Location: Behind you
Reply with quote
Post 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.


Sun Sep 18, 2016 3:00 pm
Profile

Joined: Fri Sep 10, 2010 1:48 am
Posts: 666
Location: Halifax, Canada
Reply with quote
Post 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.


Sun Sep 18, 2016 11:28 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.074s | 14 Queries | GZIP : Off ]