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 06-12-2007, 01:40 AM
Cherrykao Cherrykao is offline
Banned
Join Date: Apr 2007
Posts: 37
Cherrykao is on a distinguished road
setting gani on a player

i created a gani that shows a Blue Flag over a character when they enter a level. when i move around, the gani of the Blue Flag hovering over a character disappears. How do i keep the gani on the players inside a level?


function onCreated() {
}

function onPlayerEnters() {
timeout=0.05;
timereverywhere;
setani blueFlag_idle,;
}

function onTimeout() {
if (player.guild == "Blue Team") {
setani blueFlag_idle,;
}
if (player.guild == "Red Team") {
setani redFlag_idle,;
}
}
timeout=0.05;

Or maybe just attach a PNG image of the flag over a character. I'm not sure how to either keep the gani on the players or attach a PNG image of the flag over a character?
Reply With Quote
  #2  
Old 06-12-2007, 02:49 AM
PrinceOfKenshin PrinceOfKenshin is offline
That guy with a beard
PrinceOfKenshin's Avatar
Join Date: May 2004
Location: Ontario, Canada
Posts: 819
PrinceOfKenshin has a spectacular aura aboutPrinceOfKenshin has a spectacular aura about
Quote:
Originally Posted by Cherrykao View Post
i created a gani that shows a Blue Flag over a character when they enter a level. when i move around, the gani of the Blue Flag hovering over a character disappears. How do i keep the gani on the players inside a level?


function onCreated() {
}

function onPlayerEnters() {
timeout=0.05;
timereverywhere;
setani blueFlag_idle,;
}

function onTimeout() {
if (player.guild == "Blue Team") {
setani blueFlag_idle,;
}
if (player.guild == "Red Team") {
setani redFlag_idle,;
}
}
timeout=0.05;

Or maybe just attach a PNG image of the flag over a character. I'm not sure how to either keep the gani on the players or attach a PNG image of the flag over a character?
You have to make a gani of the person running = ) you only have an idle
__________________


Quote:
Game Master (Server): Greetings PrinceOfKenshin, there are new posts on the forums that demand your urgent attention! God speed, the fate of the world is in your hands. If you fail, middle earth will forever be in the darkness and your children will be enslaved by McKain.
Reply With Quote
  #3  
Old 06-12-2007, 03:17 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
You also need to put the timeout=0.05; inside of the onTimeout function...you have it floating in limbo right now. I advise that you don't mix gs1 and gs2 also and that you use setTimer(0.05) rather then timeout=0.05. (Sorry can't give a specific reason why but it seems to always make things work better for me in GS2)
__________________
Do it with a DON!
Reply With Quote
  #4  
Old 06-12-2007, 03:25 AM
Cherrykao Cherrykao is offline
Banned
Join Date: Apr 2007
Posts: 37
Cherrykao is on a distinguished road
i tried the gani OFFLINE on the level editor doing this:


if (playertouchsme) {
replaceani idle,ctf_blue_idle;
}

and it works OFFLINE, but I don't understand why it doesn't work ONLINE when I upload into RC??
Reply With Quote
  #5  
Old 06-12-2007, 03:39 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
Best way to do this would to probably make a gani with just the flag(no player), and set it to an attribute. But that's only if you're using the gani just to have the flag hover over the head, if they're holding it that's different.
Reply With Quote
  #6  
Old 06-12-2007, 05:11 AM
bscharff bscharff is offline
Bloo
bscharff's Avatar
Join Date: Sep 2006
Location: San Antonio, Texas
Posts: 185
bscharff has a little shameless behaviour in the past
Send a message via AIM to bscharff Send a message via MSN to bscharff Send a message via Yahoo to bscharff
You would do
PHP Code:
//#CLIENTSIDE
if (playertouchsme){
replaceani idle,NEW IDLE GANI;
replaceani walk,NEW WALK GANI;

Reply With Quote
  #7  
Old 06-13-2007, 11:28 PM
Cherrykao Cherrykao is offline
Banned
Join Date: Apr 2007
Posts: 37
Cherrykao is on a distinguished road
the attributes thing worked perfectly as i just want to hover a flag over the head. i search on the Graal Wiki Homepage... couldn't find what available attributes were, but i did this:

player.attr[5] = "ctfFlag.gani";

I don't know what the 5 stands for, but it works. maybe if someone could quickly list the attributes, that'd be cool.

also say for example, i change the player's attributes and it stays that way in the level:

function onPlayerEnters() {
setani ctfFlag_idle,;
}

if they were to "unstick me", use staff warps or someone summons them out of a level, they will stay that way. how do i make it so that if they leave the level (under not-normal) circumstances, can i set them back to normal? i dont want them to touch an NPC to set them back to normal before they leave.

this is also a problem if you create a new tileset for just that one level and they decide to "unstick me" or use staff warp, etc... to leave the level and when they do, their game window is all garbled and messed up.
Reply With Quote
  #8  
Old 06-13-2007, 11:44 PM
killerogue killerogue is offline
Registered Omega
killerogue's Avatar
Join Date: Apr 2006
Location: United States
Posts: 1,920
killerogue is on a distinguished road
Send a message via AIM to killerogue Send a message via MSN to killerogue
The 5 is just that. XD A 5. It's a player.attribute. Player attributes are spaces and are edited by ganis. They're just blank until you fill em up. :P
__________________


REMEMBER, IF YOU REP ME, LEAVE A NAME!

Quote:
Originally Posted by haunter View Post
Graal admins don't die. They go to hell and regroup.
Quote:
Originally Posted by Inverness View Post
Without scripters, your graphics and levels wouldn't do anything but sit there and look pretty.
Reply With Quote
  #9  
Old 06-14-2007, 12:56 AM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
PHP Code:
function onPlayerLeaves() 
{
  
//...stuff

Use that function for when the player leaves.
__________________
Deep into the Darkness peering...
Reply With Quote
  #10  
Old 06-14-2007, 02:43 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
By default, only attr[1] is used, for the hat.
__________________
Do it with a DON!
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 06:19 AM.


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