Data Realms Fan Forums http://45.55.195.193/ |
|
VIP Actor http://45.55.195.193/viewtopic.php?f=1&t=18589 |
Page 1 of 2 |
Author: | matty406 [ Sat Apr 24, 2010 11:56 pm ] |
Post subject: | VIP Actor |
I have an idea that came to me, and made me think if it could possibly be implemented into a mod. The idea is for an actor, a VIP (For example, for a faction that is like a corporation or a PMC.), that when deployed on the map provides discounts on things purchased from said Faction. As long as he/she stays alive. I believe this could spice up game play by making the player protect this VIP. So could this be possible? Discuss. |
Author: | CCnewplayer [ Sun Apr 25, 2010 12:03 am ] |
Post subject: | Re: VIP Actor |
Yes it's possible , just make one lua file that says that when one VIP is purchased ,the prices of certain actors fall down, and in the file you specify the prices. |
Author: | CaveCricket48 [ Sun Apr 25, 2010 12:17 am ] |
Post subject: | Re: VIP Actor |
You can't change GoldCost with Lua. Edit: But you could possibly make the Lua add Gold to your team when something is purchased, giving the appearance of a discount. |
Author: | Petethegoat [ Sun Apr 25, 2010 12:22 am ] |
Post subject: | Re: VIP Actor |
That wouldn't allow you to make an (Ronin, say) actor who gave you discounts on Ronin weapons. |
Author: | Contrary [ Sun Apr 25, 2010 12:28 am ] |
Post subject: | Re: VIP Actor |
And what would the point be? Any actor or building that can be placed anywhere and generates a passive advantage would be best put by your brain. |
Author: | Petethegoat [ Sun Apr 25, 2010 12:31 am ] |
Post subject: | Re: VIP Actor |
Code: function Create(self) for actor in MovableMan.Actors do if actor.PresetName ~= "Ronin VIP" then self.Health = 0 break end end end All you need is a discounted actor to have this script, with 'Ronin VIP' replaced with whatever your VIP is called. Have fun times. |
Author: | CaveCricket48 [ Sun Apr 25, 2010 12:36 am ] |
Post subject: | Re: VIP Actor |
That will kill the discounted actor when created if the "VIP" unit is alive. |
Author: | Petethegoat [ Sun Apr 25, 2010 12:38 am ] |
Post subject: | Re: VIP Actor |
You would think that. Testing would demonstrate otherwise. I'm not entirely sure why, though. Edit: Further testing with a newer version would show that that is, infact, entirely the case. Edit2: Alright, I have my improved but still broken script here: function Create(self) for actor in MovableMan.Actors do if actor.PresetName ~= "Ronin VIP" then --The issue is obviously the above line. How would one go about checking for any actor with that PresetName? self.ToDelete = true self.currfunds = ActivityMan:GetActivity():GetTeamFunds(self.Team) ActivityMan:GetActivity():SetTeamFunds(self.currfunds+self.GoldValue, self.Team) break end end end |
Author: | CaveCricket48 [ Sun Apr 25, 2010 3:03 pm ] |
Post subject: | Re: VIP Actor |
if actor.PresetName == "Ronin VIP" then ~= means "is not" == means "is" |
Author: | Petethegoat [ Sun Apr 25, 2010 3:12 pm ] |
Post subject: | Re: VIP Actor |
But then it would only delete them when the VIP is present, unless you mean in conjunction with an else? I've tried that and it fails miserably, doing odd things like adding ~2000 oz when they are deleted (they are always deleted, or never deleted). |
Author: | CaveCricket48 [ Sun Apr 25, 2010 3:17 pm ] |
Post subject: | Re: VIP Actor |
Okay, what exactly what are you trying to do? |
Author: | Petethegoat [ Sun Apr 25, 2010 3:22 pm ] |
Post subject: | Re: VIP Actor |
Current script: Code: function Create(self) for actor in MovableMan.Actors do if actor.PresetName ~= "Ronin VIP" then else self.ToDelete = true self.currfunds = ActivityMan:GetActivity():GetTeamFunds(self.Team) ActivityMan:GetActivity():SetTeamFunds(self.currfunds+self.GoldValue, self.Team) end break end end Basically, it checks through all actors to see if their PresetName = "Ronin VIP". If not, then nothing happens, otherwise they delete themselves and refund their gold cost. I'm pretty sure (not at all sure) that the problem is either the location of the break, or how Lua handles my then...else. |
Author: | matty406 [ Sun Apr 25, 2010 3:27 pm ] |
Post subject: | Re: VIP Actor |
Thanks for taking interest and tinkering with code. If this works then i might have a go at using it to make a mod. |
Author: | CaveCricket48 [ Sun Apr 25, 2010 3:32 pm ] |
Post subject: | Re: VIP Actor |
Stick the "break" before the "end" above it. Edit: I don't see how deleting the thing would make a discount, however. |
Author: | Petethegoat [ Sun Apr 25, 2010 3:49 pm ] |
Post subject: | Re: VIP Actor |
I have it set up so when you but a discounted Gordon, he has this script. So if you you inadvertently buy a load of discounted Gordon's without the VIP, you only lose the cost of the craft. Your script works almost perfectly, except it is inverted. I have tried a couple of things and none of them work. Is it just that i'm missing something really obvious? |
Page 1 of 2 | All times are UTC [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |