Data Realms Fan Forums
http://45.55.195.193/

Actors with Perks
http://45.55.195.193/viewtopic.php?f=1&t=18229
Page 1 of 1

Author:  Zeedin [ Wed Mar 24, 2010 12:16 pm ]
Post subject:  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!! =)

Author:  Grif [ Wed Mar 24, 2010 3:04 pm ]
Post subject:  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.

Author:  Zeedin [ Wed Mar 24, 2010 9:17 pm ]
Post subject:  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. :)

Author:  Commodore111 [ Wed Mar 24, 2010 11:10 pm ]
Post subject:  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).

Author:  Grif [ Wed Mar 24, 2010 11:47 pm ]
Post subject:  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.

Author:  Commodore111 [ Thu Mar 25, 2010 12:44 am ]
Post subject:  Re: Actors with Perks

You could check if the actor is on the ground and multiply his x speed....

Author:  Grif [ Thu Mar 25, 2010 12:47 am ]
Post subject:  Re: Actors with Perks

and end up plowing him into the first sloped surface

Author:  Contrary [ Thu Mar 25, 2010 12:50 am ]
Post subject:  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?

Author:  Zeedin [ Thu Mar 25, 2010 7:43 am ]
Post subject:  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.

Author:  Duh102 [ Thu Mar 25, 2010 1:12 pm ]
Post subject:  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.

Author:  411570N3 [ Thu Mar 25, 2010 2:02 pm ]
Post subject:  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.

Author:  Grif [ Thu Mar 25, 2010 3:05 pm ]
Post subject:  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.

Author:  Contrary [ Thu Mar 25, 2010 6:30 pm ]
Post subject:  Re: Actors with Perks

I had that idea lying around for my big faction whenever I actually begin to work on it. :P 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.

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/