Graal Forums  

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

Closed Thread
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-21-2002, 02:33 AM
davidpsy davidpsy is offline
Over Nine THOUSAND!!!!!!!
davidpsy's Avatar
Join Date: Mar 2002
Location: Bandiria
Posts: 5,514
davidpsy is on a distinguished road
Send a message via AIM to davidpsy
gani help

how do i make it so if the weapon is fired that the player gos in to a gani that i want and how do i make it so if another player thouchs the player that he gets hurt if he touchs the player while he is doing the gani please help
__________________
-Donald Shimoda
Level oo.

Forces greater than your self, can be over come.
  #2  
Old 06-21-2002, 03:05 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
use setani to set the gani and run a sin+cos formula using hitplayer to hit the players around you
  #3  
Old 06-21-2002, 03:31 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
Why use a whole sin-cos forumla? Distance formula would work too, and require far less effort.

just check all the players around you to see if they are in your area, and hit them if they are there. Rather then sending unneccessary actions to the server

NPC Code:

for(i=0;i<playerscount;i++) {
dist = ((players[i].x+1-playerx+1)^2+(players[i].y+1-playery+1)^2)^.5;
if(dist < 5) {
hitobjects power,players[i].x+1,players[i].y+1;
}
}


as long as there arent 100 players on the same level, you should have a problem with lag, and it would be far less error ridden than using something in a circle.

If you would like to only hit players in a certain area away from you, you could also try

if(dist in |3,5|) or so. People close to you wouldnt get hit, however people farther away would.

the blue text you must edit
__________________

subliminal message: 1+1=3
  #4  
Old 06-21-2002, 04:02 AM
haunter haunter is offline
Registered User
haunter's Avatar
Join Date: Mar 2001
Posts: 7,989
haunter is on a distinguished road
Quote:
Originally posted by Falcor
Why use a whole sin-cos forumla? Distance formula would work too, and require far less effort.

just check all the players around you to see if they are in your area, and hit them if they are there. Rather then sending unneccessary actions to the server

NPC Code:

for(i=0;i<playerscount;i++) {
dist = ((players[i].x+1-playerx+1)^2+(players[i].y+1-playery+1)^2)^.5;
if(dist < 5) {
hitobjects power,players[i].x+1,players[i].y+1;
}
}


as long as there arent 100 players on the same level, you should have a problem with lag, and it would be far less error ridden than using something in a circle.

If you would like to only hit players in a certain area away from you, you could also try

if(dist in |3,5|) or so. People close to you wouldnt get hit, however people farther away would.

the blue text you must edit
What is "dist" mesured in?
  #5  
Old 06-21-2002, 04:47 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
tiles
__________________

subliminal message: 1+1=3
  #6  
Old 06-21-2002, 08:42 AM
davidpsy davidpsy is offline
Over Nine THOUSAND!!!!!!!
davidpsy's Avatar
Join Date: Mar 2002
Location: Bandiria
Posts: 5,514
davidpsy is on a distinguished road
Send a message via AIM to davidpsy
im not a great scripter i just need some help i dont understand this can you explain how like on the bamboo stick on graal 2001 how did they make it so when you swing the bamboo stick at someone with a gani it hurts the other player?
__________________
-Donald Shimoda
Level oo.

Forces greater than your self, can be over come.
  #7  
Old 06-21-2002, 08:52 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
triggeraction
  #8  
Old 06-21-2002, 09:14 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
trigger action AND a reciever in the weapon itself for the action. triggeraction alone does nothing.

you need if(actionNAME) {dostuff} or so
__________________

subliminal message: 1+1=3
  #9  
Old 06-21-2002, 09:20 AM
davidpsy davidpsy is offline
Over Nine THOUSAND!!!!!!!
davidpsy's Avatar
Join Date: Mar 2002
Location: Bandiria
Posts: 5,514
davidpsy is on a distinguished road
Send a message via AIM to davidpsy
can you explain what each part of the code does?? like a label
__________________
-Donald Shimoda
Level oo.

Forces greater than your self, can be over come.
  #10  
Old 06-21-2002, 09:23 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
Stop right here, This is beyond your level, as much as I'd like to help, im afraid I cannot. Please learn more about the commands we are discussing first, or atleast concepts behind them.

Hitobjects is for default hitting players.
triggeraction is for triggereing an event (flag) on the person whom it hits.

Read into these two further, but mainly triggeraction.
__________________

subliminal message: 1+1=3
  #11  
Old 06-21-2002, 09:35 AM
davidpsy davidpsy is offline
Over Nine THOUSAND!!!!!!!
davidpsy's Avatar
Join Date: Mar 2002
Location: Bandiria
Posts: 5,514
davidpsy is on a distinguished road
Send a message via AIM to davidpsy
oh lol i know what a triger action is like if (weaponfired)
or if(keydown==1) and i know how to loop like if(playerenters)set moo;
while(moo){
__________________
-Donald Shimoda
Level oo.

Forces greater than your self, can be over come.
  #12  
Old 06-21-2002, 09:48 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
I'm closing this, please study more on how to effectively use these commands that have been posted and you will/should be able to do it
Closed Thread


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:29 PM.


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