Author |
Message |
Zeedin
Joined: Wed Mar 24, 2010 12:00 pm Posts: 3
|
Actors with Perks
Hello forums! I've done some digging in the mod making and helpful sections, and I can't really find in depth detail about a certain thing I would love to do:
I need to create a Lua script for an actor that modifies variables for all guns that the actor uses. Examples would be perhaps an actor that reloads twice as fast as the others, or an actor that has better aim with every gun by a percentage(less random spread). Is this possible?
I've created a game mode for Garry's Mod on the source engine using Lua before, but I am missing a lot of information in order to do this sort of thing in cortex command, because I haven't the slightest clue where to begin.
I ask the good people of the forums - What do I need to know? Can yeh whip up an example script real quick for me to learn from?
Thanks!! =)
|
Wed Mar 24, 2010 12:16 pm |
|
|
Grif
REAL AMERICAN HERO
Joined: Sat Jan 27, 2007 10:25 pm Posts: 5655
|
Re: Actors with Perks
Basically you can't.
Guns while held cannot be modified except in extremely basic ways with Lua, and the kind of 'hooks' Garry's Mod uses aren't the kind of thing that CC's lua uses.
|
Wed Mar 24, 2010 3:04 pm |
|
|
Zeedin
Joined: Wed Mar 24, 2010 12:00 pm Posts: 3
|
Re: Actors with Perks
Grif wrote: Basically you can't.
Guns while held cannot be modified except in extremely basic ways with Lua, and the kind of 'hooks' Garry's Mod uses aren't the kind of thing that CC's lua uses. Ah, I see. It's unfortunate that it can't be done. Thanks for the helpful info though, and for the reply.
|
Wed Mar 24, 2010 9:17 pm |
|
|
Commodore111
Joined: Sun Oct 11, 2009 7:47 pm Posts: 132
|
Re: Actors with Perks
If you want to have perks, it would probably be based on an ability already given to an actor with lua. Such as regeneration, or sprinting(Someone needs to make this lol).
|
Wed Mar 24, 2010 11:10 pm |
|
|
Grif
REAL AMERICAN HERO
Joined: Sat Jan 27, 2007 10:25 pm Posts: 5655
|
Re: Actors with Perks
Sprinting isn't even possible, really, for similar reasons. Basically, all limb/attachable related code is useless/unwieldy for lua modders to take advantage of. Plus there's a good number of functions that aren't available to anything but the internal game engine.
|
Wed Mar 24, 2010 11:47 pm |
|
|
Commodore111
Joined: Sun Oct 11, 2009 7:47 pm Posts: 132
|
Re: Actors with Perks
You could check if the actor is on the ground and multiply his x speed....
|
Thu Mar 25, 2010 12:44 am |
|
|
Grif
REAL AMERICAN HERO
Joined: Sat Jan 27, 2007 10:25 pm Posts: 5655
|
Re: Actors with Perks
and end up plowing him into the first sloped surface
|
Thu Mar 25, 2010 12:47 am |
|
|
Contrary
Joined: Mon Mar 16, 2009 10:50 pm Posts: 2175 Location: Neverwhere
|
Re: Actors with Perks
Can't you just make the weapon change depending on what actor is holding it? Like have one +SP weapon and one No SP weapon? I know that people have made weapons that can only work with certain actors, so is it possible just to have weapons that gib into different weapons when the right actor is near?
|
Thu Mar 25, 2010 12:50 am |
|
|
Zeedin
Joined: Wed Mar 24, 2010 12:00 pm Posts: 3
|
Re: Actors with Perks
Contrary wrote: Can't you just make the weapon change depending on what actor is holding it? Like have one +SP weapon and one No SP weapon? I know that people have made weapons that can only work with certain actors, so is it possible just to have weapons that gib into different weapons when the right actor is near? This is a brilliant idea! Tedious, but quite brilliant. Now I wonder if it were possible - (say if when an actor is ordered from the space catalog and exists into the playfield) - to maybe spawn the duplicate weapon(that has the perk) on the actor's current position, make the actor equip it and simultaneously destroy the other weapon all within a split second. Then to do this for each weapon said actor is carrying at any time the actor is spawned, or at any time the actor picks up a weapon. (and perhaps have the weapons switch back if dropped to avoid exploits) Thoughts? BTW thanks everyone who's posted so far and provided ideas or feedback, I really appreciate the help.
|
Thu Mar 25, 2010 7:43 am |
|
|
Duh102
happy carebear mom
Joined: Tue Mar 04, 2008 1:40 am Posts: 7096 Location: b8bbd5
|
Re: Actors with Perks
That's what was being suggested. The only problem is you'd have to make ini script copies of all weapons you'd like to replace and manually change their firing speed (Lua cannot change that variable in real time), which would be both tedious and limited to a certain set of weapons.
|
Thu Mar 25, 2010 1:12 pm |
|
|
411570N3
Joined: Wed Jan 07, 2009 10:26 am Posts: 4074 Location: That quaint little British colony down south
|
Re: Actors with Perks
Hmm... Can you define .ini code via Lua? If we can/could, this would be possible via one way at least, as well as making a bunch of other stuff also possible.
|
Thu Mar 25, 2010 2:02 pm |
|
|
Grif
REAL AMERICAN HERO
Joined: Sat Jan 27, 2007 10:25 pm Posts: 5655
|
Re: Actors with Perks
Not really, no, plus any changes you did make (through the ludicrously limited I/O library) would require a hard CC reset to take effect anyways.
|
Thu Mar 25, 2010 3:05 pm |
|
|
Contrary
Joined: Mon Mar 16, 2009 10:50 pm Posts: 2175 Location: Neverwhere
|
Re: Actors with Perks
I had that idea lying around for my big faction whenever I actually begin to work on it. I think this would be a great idea for a small mod. Maybe like, 2 ARs, 1 SMGs, 1 LMG, and 1 Sniper? If you really wanted a Call of Duty Mod. That's like 10 for Sp and 15 for SP or Double Tap. 30 if you want to include Deep Impact as well for like a sharpness increase. But 10 sounds pretty manageable. Plus two or three actors. That's fairly average for a pack.
|
Thu Mar 25, 2010 6:30 pm |
|
|
|