Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-07-2013, 02:37 PM
brokk brokk is offline
Registered User
Join Date: May 2012
Posts: 84
brokk is on a distinguished road
Disableing Sword

What is the function to disable the sword in the default movement?
__________________
No matter how much I hate graal, I'm always coming back.

smh
Reply With Quote
  #2  
Old 07-07-2013, 02:44 PM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
disableweapons();
Reply With Quote
  #3  
Old 07-07-2013, 03:48 PM
brokk brokk is offline
Registered User
Join Date: May 2012
Posts: 84
brokk is on a distinguished road
Thank you
__________________
No matter how much I hate graal, I'm always coming back.

smh
Reply With Quote
  #4  
Old 07-07-2013, 04:44 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
keep in mind that this will disable the use of onWeaponFired(). you will either need to trigger it your own or have your own functions name when triggering it on your own (same thing will be the result)
__________________
MEEP!
Reply With Quote
  #5  
Old 07-07-2013, 05:54 PM
brokk brokk is offline
Registered User
Join Date: May 2012
Posts: 84
brokk is on a distinguished road
Quote:
Originally Posted by callimuc View Post
keep in mind that this will disable the use of onWeaponFired(). you will either need to trigger it your own or have your own functions name when triggering it on your own (same thing will be the result)

When you mean it disables it, does that mean it just disables the "press 'D'" for the weaponFired? Because I have an inventory where if you double click it activates the weaponFired() function. Does that mean it won't work anymore?
__________________
No matter how much I hate graal, I'm always coming back.

smh
Reply With Quote
  #6  
Old 07-07-2013, 06:39 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
if you keep using disableWeapons() it wont. if you enable it again by using enableWeapons() then they will be triggered by default when you press D
__________________
MEEP!
Reply With Quote
  #7  
Old 07-07-2013, 07:15 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Even with disableweapons(), using a custom triggered onWeaponFired() will work absolutely fine. It just disables the default ASD functionality.
Reply With Quote
  #8  
Old 07-07-2013, 09:08 PM
brokk brokk is offline
Registered User
Join Date: May 2012
Posts: 84
brokk is on a distinguished road
Quote:
Originally Posted by DustyPorViva View Post
Even with disableweapons(), using a custom triggered onWeaponFired() will work absolutely fine. It just disables the default ASD functionality.
Thanks, that's what I was looking for.
__________________
No matter how much I hate graal, I'm always coming back.

smh
Reply With Quote
  #9  
Old 07-07-2013, 09:13 PM
brokk brokk is offline
Registered User
Join Date: May 2012
Posts: 84
brokk is on a distinguished road
I have another question when it comes to the default movement. As we know, the direction keys on the keyboard make the player move up, left, down, and right. Is there a command to make the player move using the default movement?

For example:
PHP Code:
function onKeyPressed(codekey){
 if (
key == "z"){
 
//player will move left using default movement
 
}

I realize I could just do player.x -= 0.5; But I want to use the default tile collision.

I know it's a complex question kinda, hopefully someone can help!


AND I would also like to add, disabledefmovement() will disable the whole movement system, is there a function to just disable the ability to move instead of disabling everything such as the sword, tile detection, etc?
__________________
No matter how much I hate graal, I'm always coming back.

smh

Last edited by brokk; 07-07-2013 at 10:22 PM..
Reply With Quote
  #10  
Old 07-07-2013, 11:44 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
You can't just replace the keys for the default movement, you would have to force change the keys a player has been setting in the f3 menu (I would't suggest that at all).

And no you can't disable the movement only. You need to create your own movement including your own sword setup etc. You can use default stuff like the players speed, hearts, damage the sword currently does (I believe) and such.
__________________
MEEP!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 03:23 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.