View unanswered posts | View active topics It is currently Thu Dec 26, 2024 5:57 pm



Reply to topic  [ 8 posts ] 
 Forcing an actor to only use a certain weapon 
Author Message
User avatar

Joined: Sat Jun 19, 2010 5:02 pm
Posts: 331
Location: Mekkan
Reply with quote
Post 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
Profile
User avatar

Joined: Wed Jan 07, 2009 10:26 am
Posts: 4074
Location: That quaint little British colony down south
Reply with quote
Post 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
Profile WWW
User avatar

Joined: Sat Jun 19, 2010 5:02 pm
Posts: 331
Location: Mekkan
Reply with quote
Post 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
Profile
User avatar

Joined: Sat Oct 17, 2009 2:07 pm
Posts: 127
Reply with quote
Post 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
Profile ICQ
User avatar

Joined: Sat Jun 19, 2010 5:02 pm
Posts: 331
Location: Mekkan
Reply with quote
Post 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
Profile
User avatar

Joined: Sat Oct 17, 2009 2:07 pm
Posts: 127
Reply with quote
Post 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
Profile ICQ
User avatar

Joined: Sat Jun 19, 2010 5:02 pm
Posts: 331
Location: Mekkan
Reply with quote
Post 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
Profile
User avatar

Joined: Sat Oct 17, 2009 2:07 pm
Posts: 127
Reply with quote
Post 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
Profile ICQ
Display posts from previous:  Sort by  
Reply to topic   [ 8 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

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.062s | 13 Queries | GZIP : Off ]