Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Old Scripting Engine (GS1)
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-17-2012, 06:41 PM
E_Man E_Man is offline
E-Man
E_Man's Avatar
Join Date: Jun 2012
Posts: 81
E_Man will become famous soon enough
Chicken Carry and Water Maze Script Help

I was to make levels in offline editor but I can't do a water maze right, this is what I have:

// NPC made by E-Man
if (playerswimming) {
playerx=31;
playery=42;
}

It only works if I start in the water. Also I want to know how to how to change the carry gani of an npc so I can carry a chicken because when I try to carry a chicken, it looks like a person, and I can't use "replaceani" or "replacecharani",
Reply With Quote
  #2  
Old 06-18-2012, 12:01 AM
Tricxta Tricxta is offline
The Muffin Man
Tricxta's Avatar
Join Date: Oct 2010
Location: Australia
Posts: 563
Tricxta is a jewel in the roughTricxta is a jewel in the rough
Playerswimming is a passive flag, you'll need to continuously keep on checking the flag,
this can be either through a while or timeout loop.

PHP Code:
if (playerenters || timeout){
  if (
playerswimming){
    
playerx 31;
    
playery 42;
  }
  
timeout 0.05;

Reply With Quote
  #3  
Old 06-18-2012, 01:18 AM
E_Man E_Man is offline
E-Man
E_Man's Avatar
Join Date: Jun 2012
Posts: 81
E_Man will become famous soon enough
Thank you for the response. I still need help with the carried chicken gani though.
Reply With Quote
  #4  
Old 06-18-2012, 02:18 AM
Tricxta Tricxta is offline
The Muffin Man
Tricxta's Avatar
Join Date: Oct 2010
Location: Australia
Posts: 563
Tricxta is a jewel in the roughTricxta is a jewel in the rough
Sorry, I didn't pay attention to your other quest. You can achieve this in a variety of ways.
Although I think the carry function is broken(online).

You can do this though:
PHP Code:
setplayerprop #P3,chickenImage.png;
replaceani idle,carrystill;
replaceani walk,carry
Requires a bit more working though. However if it's just offline you're using this for
canbecarried; should work fine. Which will be inserted into the npc you want to be able to carry.
You should take the time to look at commands.rtf in closer detail, GS1 is a really easy language which shouldn't really need assistance with.
Reply With Quote
  #5  
Old 06-18-2012, 02:22 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
PHP Code:
if (created) {
  
setimg chicken.gif;
  
canbecarried;

If you want to go with the bare minimum.
Reply With Quote
  #6  
Old 06-18-2012, 02:44 AM
Devil_Lord2 Devil_Lord2 is offline
David K?
Devil_Lord2's Avatar
Join Date: Apr 2011
Location: PA, MD.
Posts: 643
Devil_Lord2 can only hope to improve
I'm just wondering, how might the online version be fixed?
What I would do is an ongoing timeout checking the direction of the player, which location from the npc he is at, and then if he is doing the grab gani.

Then I guess you'd make the carrying gani the image that it is carrying?
But is there a more efficient way of making onplayergrabs?
__________________

Digital Media Artist - David K? </3 (UnLoved)
www.davidkrout.com
www.twitch.com/DavidKkz



Reply With Quote
  #7  
Old 06-18-2012, 03:55 AM
E_Man E_Man is offline
E-Man
E_Man's Avatar
Join Date: Jun 2012
Posts: 81
E_Man will become famous soon enough
Quoting is not working right now for me, but I can't use
"setplayerprop #P3,chickenImage.png;
replaceani idle,carrystill;
replaceani walk,carry;"
that Tricxta said because it is for the player and not the npc itself. I also can't use
"if (created) {
setimg chicken.gif;
canbecarried;
} "
that DustyPorViva said because it is using an image and not a gani. I need to make it a gani for an npc character that replaces the original carry gani.
Reply With Quote
  #8  
Old 06-18-2012, 04:09 AM
Tricxta Tricxta is offline
The Muffin Man
Tricxta's Avatar
Join Date: Oct 2010
Location: Australia
Posts: 563
Tricxta is a jewel in the roughTricxta is a jewel in the rough
Quote:
Originally Posted by E_Man View Post
Quoting is not working right now for me, but I can't use
"setplayerprop #P3,chickenImage.png;
replaceani idle,carrystill;
replaceani walk,carry;"
that Tricxta said because it is for the player and not the npc itself. I also can't use
"if (created) {
setimg chicken.gif;
canbecarried;
} "
that DustyPorViva said because it is using an image and not a gani. I need to make it a gani for an npc character that replaces the original carry gani.
What dusty said will work and also is most preferable, it's also what I hoped I'd be inferring... I just gave solutions for both online and offline in GS1.

Last edited by Tricxta; 06-18-2012 at 07:51 AM.. Reason: Thought I had my point clear enough...
Reply With Quote
  #9  
Old 06-18-2012, 04:53 AM
Devil_Lord2 Devil_Lord2 is offline
David K?
Devil_Lord2's Avatar
Join Date: Apr 2011
Location: PA, MD.
Posts: 643
Devil_Lord2 can only hope to improve
Well this is my solution for online which still doesn't work...

Level NPC:
PHP Code:
this.join("cancarry");
function 
onCreated(){
  
this.size = {2,2};
  
setshape(1,16*this.size[0],16*this.size[1]);
}
//#CLIENTSIDE
function onCreated(){
  
this.carry "block.png";
  
this.size = {2,2};
  
settimer(.1);

Class: cancarry
PHP Code:
function onActionCarry(cmd,pl,plx,ply){
  switch(
cmd){
    case 
"Grab":
      
//this.hide();
      
this.2;
      
this.2;
      break;
    case 
"Throw":
      
//this.show();
      
this.plx+.5;
      
this.ply-1;
      
findPlayer(pl).chat "true";
      break;
  }
  
sleep(1);
  
this.chat " ";
}
//#CLIENTSIDE
function onTimeout(){
  
//this.chat = "X:" SPC this.x-3 SPC this.x+this.size[0] SPC "Y:" SPC this.y-3.5 SPC this.y+this.size[1]-.5;
  
if (player.ani == "grab" && player.x in |this.x-3,this.x+this.size[0]| && player.y in |this.y-3.5,this.y+this.size[1]-.5| && this.newplayer == null){
    
setani("carrystill",null);
    
replaceani("idle","carrystill");
    
replaceani("walk","carry");
    
player.attr[3] = this.carry;
    
triggeraction(this.x,this.y,"Carry","Grab",player.account);
    
//this.hide();
    
sleep(.5);
    
this.newplayer player.account;
  }  
  
settimer(.1);
}

function 
onKeyPressed(a,b,c){
    if (
b=="a" && player.account == this.newplayer){
      
throwcarry();
      
setani("grab",null);
      
replaceani("idle","idle");
      
replaceani("walk","walk");
      
//this.show();
      
player.attr[3] = "";
      
triggeraction(this.x,this.y,"Carry","Throw",player.account,player.x,player.y);
      
freezeplayer(.2);
      
this.newplayer null;
    }
  } 
I was going to have it change Z and X depending on the player.dir...
but I still feel there is an easier way then how I'd do it..

Even if I got it to work, serverside, it would still be pretty slow...
Doesn't want to react after hidden it seems, and I don't want to change its alpha...
Then at -2 -2 it doesn't want to react... X = 2 and Y = 2 was my best bet. :/

Also, E_Man, you can also 'fake quote' by putting QUOTE and /QUOTE with the brackets.
__________________

Digital Media Artist - David K? </3 (UnLoved)
www.davidkrout.com
www.twitch.com/DavidKkz



Reply With Quote
  #10  
Old 06-18-2012, 07:43 AM
Tricxta Tricxta is offline
The Muffin Man
Tricxta's Avatar
Join Date: Oct 2010
Location: Australia
Posts: 563
Tricxta is a jewel in the roughTricxta is a jewel in the rough
Stop confusing people david, he wants an offline script and he's been given it. That means it can only be GS1. If you want to show case your poor script take it to the code gallery.
Reply With Quote
  #11  
Old 06-18-2012, 02:17 PM
E_Man E_Man is offline
E-Man
E_Man's Avatar
Join Date: Jun 2012
Posts: 81
E_Man will become famous soon enough
Ok, so I can't change the carry gani of an npc, I can only use an image.
Reply With Quote
  #12  
Old 06-18-2012, 02:50 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
There you go for the gani version.
PHP Code:
if (created) {
  
showcharacter;
  
setcharprop #3,head0.png;
  
setcharprop #C0,orange;
  
setcharprop #C1,white;
  
setcharprop #C2,blue;
  
setcharprop #C3,red;
  
setcharprop #C4,black;
  
setcharprop #2,shield1.gif;
  
shieldpower 1;
  
dir 2;
  
setcharani idle,;
  
canbecarried;

__________________
MEEP!
Reply With Quote
  #13  
Old 06-18-2012, 03:31 PM
ff7chocoboknight ff7chocoboknight is offline
Skyzer Zolderon
ff7chocoboknight's Avatar
Join Date: Dec 2006
Location: New Hampshire, United States
Posts: 725
ff7chocoboknight is a glorious beacon of lightff7chocoboknight is a glorious beacon of lightff7chocoboknight is a glorious beacon of light
Send a message via AIM to ff7chocoboknight Send a message via MSN to ff7chocoboknight
But he wants a chicken not a character :|
__________________
Reply With Quote
  #14  
Old 06-18-2012, 04:33 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 ff7chocoboknight View Post
But he wants a chicken not a character :|
Quote:
Originally Posted by E_Man View Post
that DustyPorViva said because it is using an image and not a gani. I need to make it a gani for an npc character that replaces the original carry gani.
:|

You don't know how his chicken is made :P if it's a body, head, complete own gani or whatever
__________________
MEEP!
Reply With Quote
  #15  
Old 06-18-2012, 04:37 PM
ff7chocoboknight ff7chocoboknight is offline
Skyzer Zolderon
ff7chocoboknight's Avatar
Join Date: Dec 2006
Location: New Hampshire, United States
Posts: 725
ff7chocoboknight is a glorious beacon of lightff7chocoboknight is a glorious beacon of lightff7chocoboknight is a glorious beacon of light
Send a message via AIM to ff7chocoboknight Send a message via MSN to ff7chocoboknight
Oh.
__________________
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 12:05 PM.


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