|
Page 1 of 1
|
[ 11 posts ] |
|
Flares: Throwing some ideas (and maybe mini mod contest)
Author |
Message |
carriontrooper
Joined: Mon Apr 13, 2009 12:27 pm Posts: 813 Location: Yogyakarta, Indonesia. A slice o' paradise.
|
Flares: Throwing some ideas (and maybe mini mod contest)
Allright, this morning I woke up with an idea of creating a flare system, which could be put on gun/dropships or in the form of a flaregun. Basically what it does is 'attract' missiles to it, and then 'dearm' it. So, the reason I made this thread is to see how other people would think of it, and maybe create a kind of mini-mod contest. I already thought up of a way, so I'm looking for bored modders to create their version of this flare system!
Coincidentally, it's my birthday, and the French revolution's. /offtopic
Go have a fun time!
|
Wed Jul 14, 2010 4:06 am |
|
|
CaveCricket48
Joined: Tue Jun 12, 2007 11:52 pm Posts: 13144 Location: Here
|
Re: Flares: Throwing some ideas (and maybe mini mod contest)
Gives me an idea:
A TDExplosive that crafts can be filled with. The TDExplosive automaticly gibs into an actor when releases that looks like a flare, which attracts the missiles. The dropship can be filled with them, so it can just release flares where ever it goes.
Problem is, though, that most missile scripts lock on to a target and don't update the target information unless the target is dead, meaning that the flares will only work if the missile hasn't locked on to anything.
|
Wed Jul 14, 2010 4:10 am |
|
|
PhantomAGN
Joined: Mon Jun 29, 2009 2:40 am Posts: 610 Location: Deep below The Map of Mars
|
Re: Flares: Throwing some ideas (and maybe mini mod contest)
If you go offensive with the flare development you could make the flare seek out missiles and then edit the missile's target. You would need to know of each mod that has a guided missile, and how that mod's missile saves the target, but it ought to work. CC48, you'd know better than me on this, you think a flare could hijack your recently released guided missile?
|
Wed Jul 14, 2010 4:53 am |
|
|
mail2345
Joined: Tue Nov 06, 2007 6:58 am Posts: 2054
|
Re: Flares: Throwing some ideas (and maybe mini mod contest)
This should do the trick. I've changed some missile hijacking code to act as a flare. Code: for k,v in pairs(AEmitters) do if type(v) == "userdata" then if (v.target ~= nil and v.target.Team == self.Team) then v.target = self end end end for k,v in pairs(MOPixels) do if type(v) == "userdata" then if (v.target ~= nil and v.target.Team == self.Team) then v.target = self end end end
|
Wed Jul 14, 2010 5:02 am |
|
|
CaveCricket48
Joined: Tue Jun 12, 2007 11:52 pm Posts: 13144 Location: Here
|
Re: Flares: Throwing some ideas (and maybe mini mod contest)
The way the my missiles work is that they look for the closest enemy actors, so the flares would only work if they are closer to the missile than the dropship, before the missile locks on to anything. Once the missile locks on, it doesn't change targets unless if the target dies.
Editing an object's local Lua variables with a script that didn't create those variables wouldn't work, to the extent of my knowledge.
Edit: Oh look that wierdo "for" loop. I'm not sure how those work, I've never used them before. From the looks of that loop, I have no idea what it's doing or how it would hijack a missile.
|
Wed Jul 14, 2010 5:06 am |
|
|
mail2345
Joined: Tue Nov 06, 2007 6:58 am Posts: 2054
|
Re: Flares: Throwing some ideas (and maybe mini mod contest)
There are tables named after ObjectTypes, like AEmitters. They contain all the Lua enabled objects of their type, and the references in there can be used to edit the variables that are usually local to that object. Of course it's been a while since I've been modding, but that's what my memory says the for loops are for.
|
Wed Jul 14, 2010 5:13 am |
|
|
CaveCricket48
Joined: Tue Jun 12, 2007 11:52 pm Posts: 13144 Location: Here
|
Re: Flares: Throwing some ideas (and maybe mini mod contest)
Another problem, though, is how do you know what variable stores the team information? Or what if team information isn't stored to a variable, but tied to an existing actor?
|
Wed Jul 14, 2010 5:19 am |
|
|
Grif
REAL AMERICAN HERO
Joined: Sat Jan 27, 2007 10:25 pm Posts: 5655
|
Re: Flares: Throwing some ideas (and maybe mini mod contest)
Yup, the pairs (I think ipairs might work, also, but pairs is probably safer) just iterates through the listed of scripted particles of X type. At least, that's what I recall from your initial discovery, mail.
the i,v is just cell number, cell contents
nothing fancy, really
Those scripts work by looking for lua defined values on any scripted AEmitters/MOPixels currently in the scene. If that lua defined value is 'self.target' and it's already valid, it changes the target.
|
Wed Jul 14, 2010 5:21 am |
|
|
CaveCricket48
Joined: Tue Jun 12, 2007 11:52 pm Posts: 13144 Location: Here
|
Re: Flares: Throwing some ideas (and maybe mini mod contest)
Oh, I get it. Heh, I should change my "self.target" variable name to something obscure, like "self.cible" or "self.askjfhjkvn". Try to hack that.
|
Wed Jul 14, 2010 5:26 am |
|
|
Grif
REAL AMERICAN HERO
Joined: Sat Jan 27, 2007 10:25 pm Posts: 5655
|
Re: Flares: Throwing some ideas (and maybe mini mod contest)
I wonder if you could search through the userdata values for anything that's a pointer.
|
Wed Jul 14, 2010 5:30 am |
|
|
carriontrooper
Joined: Mon Apr 13, 2009 12:27 pm Posts: 813 Location: Yogyakarta, Indonesia. A slice o' paradise.
|
Re: Flares: Throwing some ideas (and maybe mini mod contest)
Hmm! Interesting! Different than my idea. I plan for the flares to redirect any AEmitters with Lua with 'missile' or 'mssl' in its PresetName/InstanceName to the flare, then gib it if flare.curdist = 0. Maybe we can mix both?
|
Wed Jul 14, 2010 8:08 am |
|
|
|
|
Page 1 of 1
|
[ 11 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
|
|