Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-02-2011, 04:06 AM
MattKan MattKan is offline
the KattMan
Join Date: Aug 2010
Location: United States
Posts: 1,325
MattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to behold
Send a message via AIM to MattKan
MattKan scripting help

I'm trying to figure out how to make it so players can carry things.

When I pick up a sign or bush, I see that my gani becomes "carrystill". Since they are both the same, I assume there is a variable to decides the image name of the object the player is carrying. Is anyone familiar with the name of this variable?
__________________
Quote:
Originally Posted by Satoru Iwata
On the other hand, free-to-play games, if unbalanced, could result in some consumers paying extremely large amounts of money, and we can certainly not expect to build a good relationship with our consumers in this fashion. In order to have a favorable long-term relationship, we would like to offer free-to-play games that are balanced and reasonable.
Quote:
Originally Posted by Unximad
Eurocenter Games remains attached to the values of indies game developer and to the service our playerbase community.

Last edited by MattKan; 03-03-2011 at 12:52 AM..
Reply With Quote
  #2  
Old 03-02-2011, 04:12 AM
oo_jazz_oo oo_jazz_oo is offline
Jazz teh Awesome
oo_jazz_oo's Avatar
Join Date: Jul 2006
Location: California
Posts: 596
oo_jazz_oo is a jewel in the roughoo_jazz_oo is a jewel in the rough
Send a message via MSN to oo_jazz_oo
I believe the player attribute for the carry image is player.attr[3].

So, if you did something like:
PHP Code:
//#CLIENTSIDE
function onCreated() {
  
player.attr[3] = "bomb.png";
  
replaceani("idle", "carrystill");
  
replaceani("walk", "carry");
} 
Your player would appear to be carrying a bomb. :P
__________________

Reply With Quote
  #3  
Old 03-02-2011, 01:17 PM
callimuc callimuc is offline
ジ
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
Quote:
Originally Posted by oo_jazz_oo View Post
I believe the player attribute for the carry image is player.attr[3].

So, if you did something like:
PHP Code:
//#CLIENTSIDE
function onCreated() {
  
player.attr[3] = "bomb.png";
  
replaceani("idle", "carrystill");
  
replaceani("walk", "carry");
} 
Your player would appear to be carrying a bomb. :P
Well you won´t get out of it until you reconnect and the attribute will still be the bomb.png i guess
I think you should do something like:
PHP Code:
//#CLIENTSIDE
function onWeaponFired(){
  if(
this.on = false){
    
this.on = true;
    
player.attr[3] = "bomb.png";
    
replaceani("idle", "carrystill");
    
replaceani("walk", "carry");
  }else{
    
this.on = false;
    
player.attr[3] = "";
    
replaceani("idle","idle");
    
replaceani("walk","walk");
  }
} 
Just got Trial again so I can´t test it
Reply With Quote
  #4  
Old 03-02-2011, 01:55 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by callimuc View Post
Well you won´t get out of it until you reconnect and the attribute will still be the bomb.png i guess
I think you should do something like:
PHP Code:
//#CLIENTSIDE
function onWeaponFired(){
  if(
this.on = false){
    
this.on = true;
    
player.attr[3] = "bomb.png";
    
replaceani("idle", "carrystill");
    
replaceani("walk", "carry");
  }else{
    
this.on = false;
    
player.attr[3] = "";
    
replaceani("idle","idle");
    
replaceani("walk","walk");
  }
} 
Just got Trial again so I can´t test it
Use == instead of = for value checking. A single equal sign is for assigning values for variables.

PHP Code:
//#CLIENTSIDE
function onWeaponFired(){
  if(
this.on == false){
    
this.on = true;
    
player.attr[3] = "bomb.png";
    
replaceani("idle", "carrystill");
    
replaceani("walk", "carry");
  }else{
    
this.on = false;
    
player.attr[3] = "";
    
replaceani("idle","idle");
    
replaceani("walk","walk");
  }
} 
In this case, you could also use

PHP Code:
if (! this.on) { 
__________________
Reply With Quote
  #5  
Old 03-02-2011, 08:44 PM
callimuc callimuc is offline
ジ
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
Quote:
Originally Posted by cbk1994 View Post
Use == instead of = for value checking. A single equal sign is for assigning values for variables.

PHP Code:
//#CLIENTSIDE
function onWeaponFired(){
  if(
this.on == false){
    
this.on = true;
    
player.attr[3] = "bomb.png";
    
replaceani("idle", "carrystill");
    
replaceani("walk", "carry");
  }else{
    
this.on = false;
    
player.attr[3] = "";
    
replaceani("idle","idle");
    
replaceani("walk","walk");
  }
} 
In this case, you could also use

PHP Code:
if (! this.on) { 
whoops you right :P
Reply With Quote
  #6  
Old 03-02-2011, 11:08 PM
oo_jazz_oo oo_jazz_oo is offline
Jazz teh Awesome
oo_jazz_oo's Avatar
Join Date: Jul 2006
Location: California
Posts: 596
oo_jazz_oo is a jewel in the roughoo_jazz_oo is a jewel in the rough
Send a message via MSN to oo_jazz_oo
I wasn't trying to give him a full working script. :P

I have no clue what hes using it for...so I showed him how to use it. ;p
__________________

Reply With Quote
  #7  
Old 03-03-2011, 12:24 AM
MattKan MattKan is offline
the KattMan
Join Date: Aug 2010
Location: United States
Posts: 1,325
MattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to behold
Send a message via AIM to MattKan
Quote:
Originally Posted by oo_jazz_oo View Post
I believe the player attribute for the carry image is player.attr[3].

So, if you did something like:
PHP Code:
//#CLIENTSIDE
function onCreated() {
  
player.attr[3] = "bomb.png";
  
replaceani("idle", "carrystill");
  
replaceani("walk", "carry");
} 
Your player would appear to be carrying a bomb. :P
Thanks and thanks to the other people too....

Does anyone know the gani name for dropping the attr[3] (ie throwing the bomb or bush on the ground)
__________________
Quote:
Originally Posted by Satoru Iwata
On the other hand, free-to-play games, if unbalanced, could result in some consumers paying extremely large amounts of money, and we can certainly not expect to build a good relationship with our consumers in this fashion. In order to have a favorable long-term relationship, we would like to offer free-to-play games that are balanced and reasonable.
Quote:
Originally Posted by Unximad
Eurocenter Games remains attached to the values of indies game developer and to the service our playerbase community.
Reply With Quote
  #8  
Old 03-03-2011, 12:52 AM
MattKan MattKan is offline
the KattMan
Join Date: Aug 2010
Location: United States
Posts: 1,325
MattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to behold
Send a message via AIM to MattKan
Oh, and on another note, (don't want to make an entirely different thread) how would I make music play from a url?
__________________
Quote:
Originally Posted by Satoru Iwata
On the other hand, free-to-play games, if unbalanced, could result in some consumers paying extremely large amounts of money, and we can certainly not expect to build a good relationship with our consumers in this fashion. In order to have a favorable long-term relationship, we would like to offer free-to-play games that are balanced and reasonable.
Quote:
Originally Posted by Unximad
Eurocenter Games remains attached to the values of indies game developer and to the service our playerbase community.
Reply With Quote
  #9  
Old 03-03-2011, 12:55 AM
Soala Soala is offline
Ideas on Fire
Soala's Avatar
Join Date: Jun 2007
Location: In my head
Posts: 3,208
Soala is a jewel in the roughSoala is a jewel in the rough
Quote:
Originally Posted by MattKan View Post
Thanks and thanks to the other people too....

Does anyone know the gani name for dropping the attr[3] (ie throwing the bomb or bush on the ground)
You could do it by script. Check if the player's current gani is carry or carrystill and if grab key is pressed. Then revert the player's ganis to idle and walk and throw whatever he's carrying as attr[3] in the player's direction.
Reply With Quote
  #10  
Old 03-03-2011, 01:04 AM
MattKan MattKan is offline
the KattMan
Join Date: Aug 2010
Location: United States
Posts: 1,325
MattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to behold
Send a message via AIM to MattKan
Quote:
Originally Posted by Soala View Post
You could do it by script. Check if the player's current gani is carry or carrystill and if grab key is pressed. Then revert the player's ganis to idle and walk and throw whatever he's carrying as attr[3] in the player's direction.
Yeah but is there a gani to throw what he's carrying?
__________________
Quote:
Originally Posted by Satoru Iwata
On the other hand, free-to-play games, if unbalanced, could result in some consumers paying extremely large amounts of money, and we can certainly not expect to build a good relationship with our consumers in this fashion. In order to have a favorable long-term relationship, we would like to offer free-to-play games that are balanced and reasonable.
Quote:
Originally Posted by Unximad
Eurocenter Games remains attached to the values of indies game developer and to the service our playerbase community.
Reply With Quote
  #11  
Old 03-03-2011, 01:08 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
There is no throw gani. There are only carry ganis and lifting, and lifting doesn't use player.attr[3] so you'd have to create a custom lift gani to use it.
Reply With Quote
  #12  
Old 03-03-2011, 01:36 AM
MattKan MattKan is offline
the KattMan
Join Date: Aug 2010
Location: United States
Posts: 1,325
MattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to behold
Send a message via AIM to MattKan
Quote:
Originally Posted by DustyPorViva View Post
There is no throw gani. There are only carry ganis and lifting, and lifting doesn't use player.attr[3] so you'd have to create a custom lift gani to use it.
Oh ok. Thanks
__________________
Quote:
Originally Posted by Satoru Iwata
On the other hand, free-to-play games, if unbalanced, could result in some consumers paying extremely large amounts of money, and we can certainly not expect to build a good relationship with our consumers in this fashion. In order to have a favorable long-term relationship, we would like to offer free-to-play games that are balanced and reasonable.
Quote:
Originally Posted by Unximad
Eurocenter Games remains attached to the values of indies game developer and to the service our playerbase community.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 10:18 PM.


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