Author |
Message |
matty406
Joined: Tue Oct 13, 2009 4:23 pm Posts: 915 Location: Blighty
|
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.
|
Sat Apr 24, 2010 11:56 pm |
|
|
CCnewplayer
Joined: Wed Feb 24, 2010 11:00 pm Posts: 255 Location: Unknow
|
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.
|
Sun Apr 25, 2010 12:03 am |
|
|
CaveCricket48
Joined: Tue Jun 12, 2007 11:52 pm Posts: 13144 Location: Here
|
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.
|
Sun Apr 25, 2010 12:17 am |
|
|
Petethegoat
Joined: Mon Jun 15, 2009 4:02 pm Posts: 905
|
Re: VIP Actor
That wouldn't allow you to make an (Ronin, say) actor who gave you discounts on Ronin weapons.
|
Sun Apr 25, 2010 12:22 am |
|
|
Contrary
Joined: Mon Mar 16, 2009 10:50 pm Posts: 2175 Location: Neverwhere
|
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.
|
Sun Apr 25, 2010 12:28 am |
|
|
Petethegoat
Joined: Mon Jun 15, 2009 4:02 pm Posts: 905
|
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.
|
Sun Apr 25, 2010 12:31 am |
|
|
CaveCricket48
Joined: Tue Jun 12, 2007 11:52 pm Posts: 13144 Location: Here
|
Re: VIP Actor
That will kill the discounted actor when created if the "VIP" unit is alive.
Last edited by CaveCricket48 on Sun Apr 25, 2010 12:40 am, edited 1 time in total.
|
Sun Apr 25, 2010 12:36 am |
|
|
Petethegoat
Joined: Mon Jun 15, 2009 4:02 pm Posts: 905
|
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
|
Sun Apr 25, 2010 12:38 am |
|
|
CaveCricket48
Joined: Tue Jun 12, 2007 11:52 pm Posts: 13144 Location: Here
|
Re: VIP Actor
if actor.PresetName == "Ronin VIP" then
~= means "is not" == means "is"
|
Sun Apr 25, 2010 3:03 pm |
|
|
Petethegoat
Joined: Mon Jun 15, 2009 4:02 pm Posts: 905
|
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).
|
Sun Apr 25, 2010 3:12 pm |
|
|
CaveCricket48
Joined: Tue Jun 12, 2007 11:52 pm Posts: 13144 Location: Here
|
Re: VIP Actor
Okay, what exactly what are you trying to do?
|
Sun Apr 25, 2010 3:17 pm |
|
|
Petethegoat
Joined: Mon Jun 15, 2009 4:02 pm Posts: 905
|
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.
|
Sun Apr 25, 2010 3:22 pm |
|
|
matty406
Joined: Tue Oct 13, 2009 4:23 pm Posts: 915 Location: Blighty
|
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.
|
Sun Apr 25, 2010 3:27 pm |
|
|
CaveCricket48
Joined: Tue Jun 12, 2007 11:52 pm Posts: 13144 Location: Here
|
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.
|
Sun Apr 25, 2010 3:32 pm |
|
|
Petethegoat
Joined: Mon Jun 15, 2009 4:02 pm Posts: 905
|
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?
|
Sun Apr 25, 2010 3:49 pm |
|
|
|