Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   horse disapears when going over another level (https://forums.graalonline.com/forums/showthread.php?t=134266665)

smokeraider 06-17-2012 11:19 PM

horse disapears when going over another level
 
could someone please help me?

do you know why if you do a puthorse in 1 level
on a gmap, and you walk over to another level. that the horse disapears.
how do i fix that so it will still show?

NPC Code:

//#CLIENTSIDE
function onCreated() {
puthorse("ride.png",56,30);
}



Thanks for your input.

ffcmike 06-17-2012 11:24 PM

There's a typo, you're missing the 'c' in 'function'.
I'm not sure if that would solve the problem though, horses are something of an old relic, these things tend to have problems on gmaps.

smokeraider 06-17-2012 11:25 PM

Quote:

Originally Posted by ffcmike (Post 1697538)
There's a typo, you're missing the 'c' in 'function'.
I'm not sure if that would solve the problem though, horses are something of an old relic, these things tend to have problems on gmaps.

no it has nothing to do with that typo.

ffcmike 06-17-2012 11:28 PM

Could it be because of the specified coordinates being relative to the individual level part and not the entire map coordinates?
Try using puthorse("ride.png", this.x, this.y);.

smokeraider 06-17-2012 11:32 PM

Quote:

Originally Posted by ffcmike (Post 1697540)
Could it be because of the specified coordinates being relative to the individual level part and not the entire map coordinates?
Try using puthorse("ride.png", this.x, this.y);.

No thats not it either.

ffcmike 06-17-2012 11:42 PM

Then there's probably nothing wrong on your part, again built-in horses are somewhat deprecated. Even on iPhone Classic Stefan scripted custom horses.

You could try creating a custom horse spawner, which then places a horse directly on the player when touched.

You'd have to make a gani copying ridestill.gani without the players character, or experiment with making outfit appear invisible, then do something like:

PHP Code:

function onCreated(){
  
this.showcharacter();
  
this.dontblock();
  
this.horseimg "ridestill.png"//may possibly need to be clientside
  
this.setcharani("nameofgani""");
}

function 
onActionRide(){
  
this.setTimer(10);
  
this.hide();
}

function 
onTimeout(){
  
this.show();
}

//#CLIENTSIDE
function onPlayerTouchsMe(){
  
puthorse(this.horseimgplayer.xplayer.y);
  
triggeraction(this.1this.1"Ride""");
  
this.hide();



Tigairius 06-18-2012 12:48 AM

You can't fix it. Use custom horses.

Admins 06-20-2012 02:52 AM

On gmaps the horses don't work, but we were emulation horses by directly putting the player on a horse:
Add:
PHP Code:

player.horseimg "ride.png"

Remove:
PHP Code:

takeplayerhorse();
// Remove the spawned horse
for (temp.i=0temp.i<10temp.i++)
  
player.level.removehorse(temp.i); 


ffcmike 06-20-2012 07:50 AM

Quote:

Originally Posted by Stefan (Post 1697777)
On gmaps the horses don't work, but we were emulation horses by directly putting the player on a horse:
Add:
PHP Code:

player.horseimg "ride.png"

Remove:
PHP Code:

takeplayerhorse();
// Remove the spawned horse
for (temp.i=0temp.i<10temp.i++)
  
player.level.removehorse(temp.i); 


I don't think 'takeplayerhorse();' spawns a horse within the level, I would assume the manual spawned horse removal is intended for when a player dies.

There's also still the variable 'horsescount', so it's better to do:

PHP Code:

player.level.removehorse(horsescount 1); 



All times are GMT +2. The time now is 09:05 PM.

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