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-06-2001, 05:11 AM
fuzie fuzie is offline
Registered User
Join Date: Jul 2001
Location: +900
Posts: 303
fuzie is on a distinguished road
Send a message via AIM to fuzie Send a message via Yahoo to fuzie
Question Scripting Questions

whats the script for making the player talk and making him move??? And whats the script if you want a weapon to lay down a pic where the player is and was da script if u want it to do something if the player touches that pic in that x,y???PLZ HELP!!!!
Thanx,
EvileDemon













http://eternaldestiny.8m.com/
Reply With Quote
  #2  
Old 08-06-2001, 05:12 AM
General General is offline
Banned
Join Date: Apr 2001
Location: Station Square
Posts: 984
General is on a distinguished road
Send a message via ICQ to General Send a message via AIM to General Send a message via Yahoo to General
Okay, you'll ge tthe results of your drug test back in 24 hours
Reply With Quote
  #3  
Old 08-06-2001, 06:05 AM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
POST UPDATE
engine ..
NPC Code:

//the engine part
function move() {
disabledefmovement; //disable movement
for (this.i=0;this.i<this.SpacesToMove;this.i=this.i+t his.PlayerSpeed) { //loop
playerdir=this.PlayerDirection; //set direction of player
setplayerprop #c,#s(playermsg); //display message
playery+=vecy(this.PlayerDirection)*this.PlayerSpe ed; //move y
playerx+=vecx(this.PlayerDirection)*this.PlayerSpe ed; //move x
setani walk,; //set animation to walk
sleep .05; // sleep
}
enabledefmovement; //re-enable movement
setani idle,; //idle player animation
}


thats the engine.. to use it u just call it .. ill show u an example

NPC Code:

if (playerenters) {
this.SpacesToMove=5; //how many steps?
this.PlayerSpeed=.5; //Speed
this.PlayerDirection=2; //Direction 0=up, 1=left, 2=down, 3=right
setstring playermsg,Message; //Message for player to say
move(); //call function
}



but if you want the player to go a direction then go another direction and so on you just do
NPC Code:

if (playerenters) {
this.PlayerSpeed=.5;
//first walking part
this.SpacesToMove=5;
this.PlayerDirection=2;
setstring playermsg,First Part;
move();
//second walking part
this.SpacesToMove=10;
this.PlayerDirection=0;
setstring playermsg,Second Part;
move();
//third walking part
this.PlayerSpeed=1;
this.SpacesToMove=10;
this.PlayerDirection=3;
setstring playermsg,Third Part;
move();
}


If you notice you dont always need to change the playerspeed..
but I changed in the last part to make him walk faster.
there you go
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)

Last edited by LiquidIce00; 08-06-2001 at 06:20 AM..
Reply With Quote
  #4  
Old 08-07-2001, 04:59 AM
fuzie fuzie is offline
Registered User
Join Date: Jul 2001
Location: +900
Posts: 303
fuzie is on a distinguished road
Send a message via AIM to fuzie Send a message via Yahoo to fuzie
Cool

Thanx Man
L8
Reply With Quote
  #5  
Old 08-07-2001, 09:15 AM
LilNiglet LilNiglet is offline
Registered User
Join Date: Jun 2001
Posts: 3,178
LilNiglet is on a distinguished road
Quote:
Originally posted by LiquidIce00
POST UPDATE
engine ..
NPC Code:

//the engine part
function move() {
disabledefmovement; //disable movement
for (this.i=0;this.i<this.SpacesToMove;this.i=this.i+t his.PlayerSpeed) { //loop
playerdir=this.PlayerDirection; //set direction of player
setplayerprop #c,#s(playermsg); //display message
playery+=vecy(this.PlayerDirection)*this.PlayerSpe ed; //move y
playerx+=vecx(this.PlayerDirection)*this.PlayerSpe ed; //move x
setani walk,; //set animation to walk
sleep .05; // sleep
}
enabledefmovement; //re-enable movement
setani idle,; //idle player animation
}


thats the engine.. to use it u just call it .. ill show u an example

NPC Code:

if (playerenters) {
this.SpacesToMove=5; //how many steps?
this.PlayerSpeed=.5; //Speed
this.PlayerDirection=2; //Direction 0=up, 1=left, 2=down, 3=right
setstring playermsg,Message; //Message for player to say
move(); //call function
}



but if you want the player to go a direction then go another direction and so on you just do
NPC Code:

if (playerenters) {
this.PlayerSpeed=.5;
//first walking part
this.SpacesToMove=5;
this.PlayerDirection=2;
setstring playermsg,First Part;
move();
//second walking part
this.SpacesToMove=10;
this.PlayerDirection=0;
setstring playermsg,Second Part;
move();
//third walking part
this.PlayerSpeed=1;
this.SpacesToMove=10;
this.PlayerDirection=3;
setstring playermsg,Third Part;
move();
}


If you notice you dont always need to change the playerspeed..
but I changed in the last part to make him walk faster.
there you go
heheh
Reply With Quote
  #6  
Old 08-07-2001, 12:43 PM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
woops I found a problem..
if you change playerx or playery it re-enables def movement.
so put this for the engine
NPC Code:

//the engine part
function move() {
for (this.i=0;this.i<this.SpacesToMove;this.i=this.i+t his.PlayerSpeed) { //loop
playerdir=this.PlayerDirection; //set direction of player
setplayerprop #c,#s(playermsg); //display message
playery+=vecy(this.PlayerDirection)*this.PlayerSpe ed; //move y
playerx+=vecx(this.PlayerDirection)*this.PlayerSpe ed; //move x
setani walk,; //set animation to walk
sleep .05; // sleep
disabledefmovement; //disable movement
}
enabledefmovement; //re-enable movement
setani idle,; //idle player animation
}


(just moved the disabledefmovement in the loop)

and LilNiglet what was that post for?!?
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
  #7  
Old 08-08-2001, 11:57 PM
fuzie fuzie is offline
Registered User
Join Date: Jul 2001
Location: +900
Posts: 303
fuzie is on a distinguished road
Send a message via AIM to fuzie Send a message via Yahoo to fuzie
Red face

*yawn i noticed that
Reply With Quote
  #8  
Old 08-09-2001, 10:27 AM
fuzie fuzie is offline
Registered User
Join Date: Jul 2001
Location: +900
Posts: 303
fuzie is on a distinguished road
Send a message via AIM to fuzie Send a message via Yahoo to fuzie
Unhappy

the player walk is still messed up....

Brian

Last edited by fuzie; 08-09-2001 at 10:30 AM..
Reply With Quote
  #9  
Old 08-09-2001, 10:34 AM
Guest
Posts: n/a
NPC Code:

setani walk,;
playerx+= 0.02;
timeout = 0.05;



like that.. also you people got to read other post, thats like my third time today post something like that.
Reply With Quote
  #10  
Old 08-09-2001, 10:47 AM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
Quote:
Originally posted by IcePick_2001
NPC Code:

setani walk,;
playerx+= 0.02;
timeout = 0.05;



like that.. also you people got to read other post, thats like my third time today post something like that.
read the thread before u post
and ur forggeting a timereverywhere =(
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
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 02:44 AM.


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