How to melee ?

Scripting questions, discussions, etc
3 posts Page 1 of 1
theoffspring18
Posts: 4
Joined: Wed Mar 23, 2016 4:24 pm
  by theoffspring18 » Wed Mar 23, 2016 4:34 pm
Hi, i'm new to this community, so hello everyone! :D

I try to implements melee attacks in the game, but nothing seems to work
I followed this tutorials:
http://www.garagegames.com/community/re ... 2#comments

a) create a new file under /art/datablocks/weapons/cricketbat.cs

b) paste in the Datablock and Image info from above

c) add a line to art/datablocks/datablockExec.cs ... to exec the new cricketbat.cs file

d) open scripts/server/weapon.cs and add the onFire and Melee_Attack functions

e) put the $melee_check2hit definition at the top of the ::Melee_Attack() function

I have got also added in player.cs :
mainWeapon = Sword;
maxInv[Sword] = 1;

Nothing seems to work, when i left click nothing appears on the console, i tried to put some echo in the functiun to check if they are lauched but nothing happened.

I precise i have no animation for my weapons for the moment, just a DAE file i've downloaded from a site for the 3d model. And when the game start the player has no weapons.


Thanks for reading,
Bye! ;)
irei1as
Posts: 68
Joined: Fri Feb 27, 2015 5:13 pm
by irei1as » Wed Mar 23, 2016 4:56 pm
Maybe a mistype in the script made it to fail to load?
I've had the issue of missing a ";" on a line making all the rest of the functions to not work.

Try to look from the start of the console log when you launch the game to see if there are any red lines showing errors.
Last edited by irei1as on Wed Mar 23, 2016 5:59 pm, edited 1 time in total.
theoffspring18
Posts: 4
Joined: Wed Mar 23, 2016 4:24 pm
by theoffspring18 » Wed Mar 23, 2016 5:12 pm
You were right, my datablock file can't load:
" preload failed for SwordImage : Bad Datablock from server"

I'm gonna check my Sword.cs file

Thanks!
3 posts Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest