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 08-09-2002, 01:30 AM
zorakid2001 zorakid2001 is offline
Banned
Join Date: Jul 2002
Location: Oregon USA <-- this place sux0rs
Posts: 113
zorakid2001 is on a distinguished road
Send a message via ICQ to zorakid2001 Send a message via AIM to zorakid2001
why doesnt this work?

if (keypressed) {
setarray rockthrow,3;
rockthrow.[0]=3.14/2;
rockthrow.[1]=3.14;
rockthrow.[2]=3.14*3/2;
rockthrow.[3]=0;
if (this.on==1&&strequals(#p(1),y)) {shoot playerx,playery,playerz,rockthrow.[playerdir],1,0,shoot,wbrock.gif;}
}

i want my little man to throw a rock the direction that hes facing but i dont think i did it right
Reply With Quote
  #2  
Old 08-09-2002, 01:53 AM
Falcor Falcor is offline
Darth Cucumber
Falcor's Avatar
Join Date: Mar 2001
Location: At School
Posts: 2,874
Falcor is on a distinguished road
Send a message via ICQ to Falcor Send a message via AIM to Falcor Send a message via MSN to Falcor Send a message via Yahoo to Falcor
I see one mistake right off the bat, the array lenght does not indicate the last index, but the acual lenght of the array. 4 slots, arraylen = 4... so

setarray rockthrow,4;

also, there is no period before the [], its just rockthrow[#]

There are easier ways to do this, but i'll let you figure that out.
__________________

subliminal message: 1+1=3
Reply With Quote
  #3  
Old 08-09-2002, 03:51 AM
SingleChance SingleChance is offline
Kill Pirates
Join Date: Apr 2002
Location: Canada
Posts: 1,296
SingleChance is on a distinguished road
Thumbs up

Itll be a good script
Reply With Quote
  #4  
Old 08-09-2002, 12:45 PM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
arrayname = {index0,index1,index2,index3};
__________________
[signature]insert here[/signature]
Reply With Quote
  #5  
Old 08-10-2002, 12:40 AM
JrTerrorist JrTerrorist is offline
Freelance Web Designer
JrTerrorist's Avatar
Join Date: May 2002
Location: Canadia, eh?
Posts: 1,936
JrTerrorist is on a distinguished road
Send a message via AIM to JrTerrorist Send a message via MSN to JrTerrorist
Re: Re: why doesnt this work?

Quote:
Originally posted by Kaimetsu


Array positions are accessed like so: "rockthrow[index]", NOT like so: "rockthrow.[index]"
what he said
__________________

Yes, I'm really Arcadius Canavi.
Games I Play: CS, CS:CZ, CS:S, DoD, HL2, Halo2, World of Warcraft, NS
Games I used to Play: SWG, L2, EQ, FFXI, MoH:AA, BF1942
www.gamersmark.com > you.
Reply With Quote
  #6  
Old 08-10-2002, 01:52 AM
zorakid2001 zorakid2001 is offline
Banned
Join Date: Jul 2002
Location: Oregon USA <-- this place sux0rs
Posts: 113
zorakid2001 is on a distinguished road
Send a message via ICQ to zorakid2001 Send a message via AIM to zorakid2001
Thank you guys =D yet another addition to my Wonderful server
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 07:30 PM.


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