Author |
Message |
Awesomeness
Joined: Sat Jun 19, 2010 5:02 pm Posts: 331 Location: Mekkan
|
Forcing an actor to only use a certain weapon
This weapon already cannot be destroyed, so making new ones isn't a problem, by the way. I've tried messing with inventory-changing methods from LuaDocs/Actor on the temporary wiki to no avail... But I'm sure this has been done before. How do you do it?
|
Fri Aug 20, 2010 5:04 pm |
|
|
411570N3
Joined: Wed Jan 07, 2009 10:26 am Posts: 4074 Location: That quaint little British colony down south
|
Re: Forcing an actor to only use a certain weapon
Why don't you just set Charheight to 0 or below and just have him unable to pick up weapons? There's probably a Lua way to do the same thing (pickup disabling) if that's not possible.
|
Fri Aug 20, 2010 5:13 pm |
|
|
Awesomeness
Joined: Sat Jun 19, 2010 5:02 pm Posts: 331 Location: Mekkan
|
Re: Forcing an actor to only use a certain weapon
I'd actually like it to say a message (something like "I can't use that!") each time he tries to pick up a different weapon or drop his weapon. This is tough...
Last edited by Awesomeness on Fri Aug 20, 2010 10:46 pm, edited 1 time in total.
|
Fri Aug 20, 2010 5:20 pm |
|
|
Mad Alex
Joined: Sat Oct 17, 2009 2:07 pm Posts: 127
|
Re: Forcing an actor to only use a certain weapon
self:GetController():SetState(Controller.WEAPON_PICKUP, false);
Add this line in update function.
|
Fri Aug 20, 2010 5:57 pm |
|
|
Awesomeness
Joined: Sat Jun 19, 2010 5:02 pm Posts: 331 Location: Mekkan
|
Re: Forcing an actor to only use a certain weapon
Mad Alex wrote: self:GetController():SetState(Controller.WEAPON_PICKUP, false);
Add this line in update function. See my other post; that won't work for what I want.
|
Fri Aug 20, 2010 10:47 pm |
|
|
Mad Alex
Joined: Sat Oct 17, 2009 2:07 pm Posts: 127
|
Re: Forcing an actor to only use a certain weapon
Code: if self:GetController():IsState(Controller.WEAPON_PICKUP) self:GetController():SetState(Controller.WEAPON_PICKUP, false); *your message* end What is "message"? Screen text? Or sound? (Something like "beep" error signal?)
|
Fri Aug 20, 2010 11:21 pm |
|
|
Awesomeness
Joined: Sat Jun 19, 2010 5:02 pm Posts: 331 Location: Mekkan
|
Re: Forcing an actor to only use a certain weapon
I'm making a campaign. It's the yellow screen text.
|
Fri Aug 20, 2010 11:34 pm |
|
|
Mad Alex
Joined: Sat Oct 17, 2009 2:07 pm Posts: 127
|
Re: Forcing an actor to only use a certain weapon
Code: if self:GetController():IsState(Controller.WEAPON_PICKUP) self:GetController():SetState(Controller.WEAPON_PICKUP, false); FrameMan:SetScreenText("Your message", Activity.PLAYER_1, 0, 2000, true); end Then it looks like that. I'm not sure about parameters. Look here: http://drlwiki.thebunny.info/wiki/index ... ScreenText (temp wiki limk) Quote: SetScreenText Sets the message to be displayed on top of each player's screen Arguments: * An std::string that specifies what should be displayed. * Which screen you want to set text to. * The interval with which the screen will be blinking, in ms. 0 means no blinking. * The duration, in MS to force this message to display. No other message can be displayed before this expires. ClearScreenText overrides it though. * Vertically centered on the screen Return value:None.
|
Sat Aug 21, 2010 12:27 am |
|
|
|