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 06-01-2013, 05:02 AM
defaultaccount defaultaccount is offline
Cassini
Join Date: Feb 2006
Location: HeLLifAX
Posts: 299
defaultaccount is on a distinguished road
setani problems

I`m having trouble at the simplest script to show a gani. It just makes my character invisible when I use it, I`m trying to make a gunscript I read a lot of topics and how to script and tutorials, but I`m having trouble with set animation, I think it has to do with my servers set-up im not sure. But I`m trying to learn the best I can. I tried searching for a solution but I didn't find anything.

NPC Code:
//#CLIENTSIDE

function onWeaponFired() {
setani ("idle" , null);
}

Reply With Quote
  #2  
Old 06-01-2013, 05:17 AM
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
PHP Code:
//#CLIENTSIDE
function onWeaponFired() {
  
setAni("idle"null);

That should work—only difference is no space after setAni. But even if the engine complains about that (and I don't know if it does), that shouldn't turn you invisible.

What do you see in F2, particularly under "Files" and "Scripts"?
__________________
Reply With Quote
  #3  
Old 06-01-2013, 05:31 AM
defaultaccount defaultaccount is offline
Cassini
Join Date: Feb 2006
Location: HeLLifAX
Posts: 299
defaultaccount is on a distinguished road
I didn`t think of checking in F2 but I will from now on, but at first it said idle gani wasn't in the folder, I thought it would load the default idle gani. I added it now but in file im getting a different error now :
Quote:
Data directory: C:/Users/HP/Graal/
Scanned install files.
Scanning files ...
Scanning done.
File download: loginserver_en.po not foundFile download: http://external.ak.fbcdn.net/safe_im...s%2Ftrynow.png (size: 8366) done
Couldn't open C:/Users/HP/Graal/webfiles/http%058%047%047external%046ak%046fbcdn%046net%047 safe_image%046php%063d%061AQA6eOUZccJHPxYZ%038w%06 1154%038h%061154%038url%061http%0373A%0372F%0372Fw ww%046graalonline%046com%0372Fthemes%0372Fplayerwo rlds%0372Fimages%0372Ftrynow%046png for writing!
File download: ("idle".gani not found
File download: login_icon_developer116.png not found
File download: tempsitcbd.ttf not found
I updated the file even to the old idle gani and it still wont show, it doesn`t read the file in my folders

` File download: ("idle".gani not found `
Reply With Quote
  #4  
Old 06-01-2013, 05:32 AM
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
Looks like the problem actually is the space. It's interpreting it like GS1. Just remove the space before the opening parenthesis in setAni.
__________________
Reply With Quote
  #5  
Old 06-01-2013, 05:43 AM
defaultaccount defaultaccount is offline
Cassini
Join Date: Feb 2006
Location: HeLLifAX
Posts: 299
defaultaccount is on a distinguished road
works now thank you man, I've been waiting 2 days on why this wasn't working. I got two half made gunscripts I can combine and make one. thank you for replying ill keep an eye out for that sort of thing for next time and search the forums before posting

Last edited by defaultaccount; 06-01-2013 at 05:57 AM..
Reply With Quote
  #6  
Old 06-04-2013, 03:32 AM
defaultaccount defaultaccount is offline
Cassini
Join Date: Feb 2006
Location: HeLLifAX
Posts: 299
defaultaccount is on a distinguished road
I'm trying to get this to work I'm not setting the variable right can someone help please

NPC Code:
function OnCreated () {
this.idle = "pb_mp5navy-idle";
setani(this.idle, null);
}

Reply With Quote
  #7  
Old 06-04-2013, 09:26 PM
dylan dylan is offline
AGT
Join Date: Jul 2012
Location: United States
Posts: 60
dylan has a spectacular aura about
Quote:
Originally Posted by defaultaccount View Post
I'm trying to get this to work I'm not setting the variable right can someone help please

NPC Code:
function OnCreated () {
this.idle = "pb_mp5navy-idle";
setani(this.idle, null);
}

The function is onCreated() not OnCreated().

Edit: Hmm seems it wasn't that, but setani is a clientside function so you're sure that you're calling it there?
__________________

<@Logan> I spent a minute looking at my own code by accident.
<@Logan> I was thinking "What the hell is this guy doing?"
Reply With Quote
  #8  
Old 06-04-2013, 11:52 PM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Quote:
Originally Posted by defaultaccount View Post
I'm trying to get this to work I'm not setting the variable right can someone help please

NPC Code:
function OnCreated () {
this.idle = "pb_mp5navy-idle";
setani(this.idle, null);
}

PHP Code:
//#CLIENTSIDE
function onCreated () {
  
this.idle "walk";
  
setani(this.idlenull);

Works for me, tho I tend to do temp.idle rather then this.idle out of habbit because sometimes this.variables can conflict with the object itself.
Reply With Quote
  #9  
Old 06-05-2013, 06:08 PM
defaultaccount defaultaccount is offline
Cassini
Join Date: Feb 2006
Location: HeLLifAX
Posts: 299
defaultaccount is on a distinguished road
I also got it working on the test script, i'm going to try to migrate this to the whole gunscript I'll post the script once I'm finished


edit: the whole script isn't working it works without the gani variables but when I try to make it like in the script shown above it doesn't play any of the ganis

here's the script

Quote:
//#CLIENTSIDE
function onEquip () {
this.equiped = true;
freezeplayer(this.equip);
setani("pb_mp5navy-equip", null);
replaceani("walk", "pb_mp5navy-walk");
replaceani("idle", temp.idle);
}
function onCreated() {
this.spread = 0.00; // Controls the spread of weapon
this.speed = 0.2; // Controls the fire rate of weapon
this.reload = 0.1;
this.freeze = 0.1;
this.bulletangle = -.5;
this.equip = 0.2;
disableweapon(sword);
temp.idle = "pb_mp5navy-idle";

all im trying to do is get the ganis set as variables something is wrong with it because it's not playing the setanis or replace anis but on the test script the code im using but the temp.idle is making me invisable

Last edited by defaultaccount; 06-05-2013 at 06:36 PM..
Reply With Quote
  #10  
Old 06-05-2013, 06:49 PM
Tim_Rocks Tim_Rocks is offline
a true gentlemen
Tim_Rocks's Avatar
Join Date: Aug 2008
Location: USA
Posts: 1,863
Tim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to behold
In the future I'd try using PHP and http://www.fp4.ca/gs2beautifier/ before posting on the forums. Makes it a lot easier to read.

PHP Code:
// Weapons Script for PB (PLANET BASE) 
// MADE BY: Take(Defaultaccount),Delta(),

//#CLIENTSIDE
function onEquip() {
  
this.equiped true;
  
freezeplayer(this.equip);
  
setani(this.equip2null);
  
replaceani("walk"this.walk);
  
replaceani("idle"this.idle);
}

function 
onCreated() {
  
this.spread 0.00// Controls the spread of weapon
  
this.speed 0.2// Controls the fire rate of weapon
  
this.reload 0.1// Controls the reload of the weapon
  
this.freeze 0.05// Controls the freeze of the weapon
  
this.equip 0.5// Controls the equip time of the weapon
  
this.bspeed 1// Controls the speed of the bullet
  
this.bulletangle = -.5// Controls the angle of the bullet

  
disableweapon(sword);

  
setani(this.idlenull);
  
this.walk "pb_mp5navy-walk";
  
this.idle "pb_mp5navy-idle";
  
this.ewalk "pb_mp5navy-unequiped-walk";
  
this.eidle "pb_mp5navy-unequiped-idle";
  
this.equip2 "pb_mp5navy-equip";
  
this.unequip "pb_mp5navy-unequip";
  
this.fire "pb_mp5navy-fire";
  
this.reload2 "pb_mp5navy-unequip";
}

function 
GraalControl.onKeyUp(codekeyscan) {
  if (
key == "a") {
    
freezeplayer(this.reload);
    
setani(this.reload2null);
  }
  if (
key == "f") {
    
setani(this.unequipnull);
    
replaceani("walk"this.ewalk);
    
replaceani("idle"this.eidle);
    
freezeplayer(this.equip);
    
this.equiped false;
  }
  if (
key == "s") {
    
this.equiped false;
    
replaceani("walk""walk");
    
replaceani("idle""idle");
    return;
  }
  if (
key == "d") {
    if (
this.equiped true) {
      
setani(this.firenull);
      
freezeplayer(this.freeze);
      
this.angle getangle(vecx(playerdir), vecy(playerdir));
      
setshootparams(player.account);
      
shoot(player..3player..3player.zthis.angle random(this.bulletangleabs(this.bulletangle)), 00"pb_bullet1""pb_bullet1.png");
      if (
this.equiped false) {
        
onEquip();
      }
    }
  }
}

function 
onActionProjectile() {
  
player.hearts = -.5;

I am curious to know why you're using

PHP Code:
function GraalControl.onKeyUp(codekeyscan) {
  
//Key up..

Instead of
PHP Code:
function GraalControl.onKeyDown(codekeyscan) {
  
//Key Down..

Although I'm not sure what your issue is without testing it later.
__________________
Reply With Quote
  #11  
Old 06-05-2013, 07:25 PM
defaultaccount defaultaccount is offline
Cassini
Join Date: Feb 2006
Location: HeLLifAX
Posts: 299
defaultaccount is on a distinguished road
what id really like to do with the gunscript is make it so that I can change the ganis easy for all the different weapon tiers, I have a weapon with 20 different images. I'd like to make it so the gunscript can read the image if I put all the images in the same spot for the different ganis. I'm wondering if their is a way to do this easily. What I want to do is make it easy for me instead of making 20 different ganis for all the different guns

id really appreciate any help on how to approach making the animations on all the weapons, the script you quoted isn't working yet, the variables arnt working or setting animations right

edit: I think I found out what was wrong with the script I needed to group all the this. together, or something else because I redid the script and now its working


edit: I got the script working perfectly so I took it out the post, but id really like advice on how to gani all the weapons, I need something to make the editing easier for all the different weapon levels. I have weapons that level so I need something that can change the ganis quickly within the script

Last edited by defaultaccount; 06-06-2013 at 07:01 PM..
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 05:11 PM.


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