Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Disableing Sword (https://forums.graalonline.com/forums/showthread.php?t=134268430)

brokk 07-07-2013 02:37 PM

Disableing Sword
 
What is the function to disable the sword in the default movement?

Cubical 07-07-2013 02:44 PM

disableweapons();

brokk 07-07-2013 03:48 PM

Thank you

callimuc 07-07-2013 04:44 PM

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)

brokk 07-07-2013 05:54 PM

Quote:

Originally Posted by callimuc (Post 1720321)
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?

callimuc 07-07-2013 06:39 PM

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

DustyPorViva 07-07-2013 07:15 PM

Even with disableweapons(), using a custom triggered onWeaponFired() will work absolutely fine. It just disables the default ASD functionality.

brokk 07-07-2013 09:08 PM

Quote:

Originally Posted by DustyPorViva (Post 1720332)
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.

brokk 07-07-2013 09:13 PM

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?

callimuc 07-07-2013 11:44 PM

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.


All times are GMT +2. The time now is 10:07 PM.

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