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 05-28-2014, 10:54 PM
i8bit i8bit is offline
Registered User
Join Date: Jul 2013
Posts: 146
i8bit is an unknown quantity at this point
Players Can't see stretchx?

So I was doing some tests and I found out that other players can't see the manipulation function of 'stretch'..

PHP Code:
//#CLIENTSIDE
function onKeyPressed(codekey){
 if (
key == "z"){
  
player.stretchx = -1;
  
player.chat "Reflection Test";
 }

Obviously when you do it, you can see it on your screen.... But how do I set it so other players can see the manipulation too?
Reply With Quote
  #2  
Old 05-28-2014, 11:02 PM
Jakov_the_Jakovasaur Jakov_the_Jakovasaur is offline
Deleted by Darlene159
Jakov_the_Jakovasaur's Avatar
Join Date: Sep 2013
Location: Deleted by Darlene159
Posts: 353
Jakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud of
the problem here is that stretchx/stretchy/red/green/blue/alpha/mode/rotation/zoom etc are not synchronised between players

the most common way to accomplish this is to set a player.attr[index] value (these are synchronised between players) to a gani script (which are processed on every players client), and then set stretchx within that gani script
__________________
This signature has been deleted by Darlene159.
Reply With Quote
  #3  
Old 05-28-2014, 11:42 PM
i8bit i8bit is offline
Registered User
Join Date: Jul 2013
Posts: 146
i8bit is an unknown quantity at this point
Quote:
Originally Posted by Jakov_the_Jakovasaur View Post
the problem here is that stretchx/stretchy/red/green/blue/alpha/mode/rotation/zoom etc are not synchronised between players

the most common way to accomplish this is to set a player.attr[index] value (these are synchronised between players) to a gani script (which are processed on every players client), and then set stretchx within that gani script
How do you modify the gani script or stretchx through the weapon script?
I am trying to do everything through that...


Allow me to elaborate on what I'm doing..

I have a system where the player can only move left and right.
All the player's ganis are set to singledir and they face left.
The system detects which way the player is facing and sets the stretchx according to that.

PHP Code:
if (player.globaldir == "left"){
 
player.stretchx 1;
}
if (
player.globaldir == "right"){ 
 
player.stretchx = -1;

globaldir is just a variable I made and sets when needed.

ANYWAY, I need the modifications done through the weapons script so other players can see. Help please

Last edited by i8bit; 05-29-2014 at 11:51 AM..
Reply With Quote
  #4  
Old 05-29-2014, 05:16 PM
Jakov_the_Jakovasaur Jakov_the_Jakovasaur is offline
Deleted by Darlene159
Jakov_the_Jakovasaur's Avatar
Join Date: Sep 2013
Location: Deleted by Darlene159
Posts: 353
Jakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud of
in that case why not just make a left and right version of the gani, and then for each gani file edit them as text and include:

PHP Code:
SCRIPT
function onPlayerEnters() {
  
player.stretchx = -1;
  
//player.stretchx = 1;
}
SCRIPTEND 
__________________
This signature has been deleted by Darlene159.
Reply With Quote
  #5  
Old 05-29-2014, 05:23 PM
i8bit i8bit is offline
Registered User
Join Date: Jul 2013
Posts: 146
i8bit is an unknown quantity at this point
Quote:
Originally Posted by Jakov_the_Jakovasaur View Post
in that case why not just make a left and right version of the gani, and then for each gani file edit them as text and include:

PHP Code:
SCRIPT
function onPlayerEnters() {
  
player.stretchx = -1;
  
//player.stretchx = 1;
}
SCRIPTEND 
I thought about it but wanted to avoid the complications of it because I'm using replaceAni but I'll figure it out! thanks for input though..
I'll see what I can do. If you think of anything else let me know!
Reply With Quote
  #6  
Old 05-29-2014, 05:53 PM
Emera Emera is offline
Delterian Hybrid
Emera's Avatar
Join Date: Mar 2011
Location: Newcastle Upon-Tyne
Posts: 1,704
Emera is a jewel in the roughEmera is a jewel in the rough
Quote:
Originally Posted by i8bit View Post
I thought about it but wanted to avoid the complications of it because I'm using replaceAni but I'll figure it out! thanks for input though..
I'll see what I can do. If you think of anything else let me know!
You can set an animation as an attribute.

PHP Code:
//player.attr[index] = "TheAni.gani";
player.attr[5] = "swim.gani"
Reply With Quote
  #7  
Old 05-29-2014, 07:20 PM
i8bit i8bit is offline
Registered User
Join Date: Jul 2013
Posts: 146
i8bit is an unknown quantity at this point
Quote:
Originally Posted by Emera View Post
You can set an animation as an attribute.

PHP Code:
//player.attr[index] = "TheAni.gani";
player.attr[5] = "swim.gani"
I could just use setAni for same thing...I messed around with it and I'd still have to make a left and a right of all the Ganis which I don't want to have to do...
It gets messed up with replaceAni.. (using default movement)

Why can't player.stretchx just work correctly
Maybe I should put in feature requests
Reply With Quote
  #8  
Old 05-29-2014, 07:33 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
example

Weapon:

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
faceLeft();
}

function 
faceLeft() {
  
player.attr[5] = "";
  
player.attr[5] = "server_stretch.gani,1";
}

function 
faceRight() {
  
player.attr[5] = "";
  
player.attr[5] = "server_stretch.gani,0";

server_stretch.gani

PHP Code:
SCRIPT
function onPlayerEnters() {
  
player.stretchx = (params[0] == 1) ? -1;
}
SCRIPTEND 
__________________
Quote:
Reply With Quote
  #9  
Old 05-29-2014, 09:11 PM
i8bit i8bit is offline
Registered User
Join Date: Jul 2013
Posts: 146
i8bit is an unknown quantity at this point
That was a bit** to figure out. BUT I GOT IT

I set the player.attr[4] to either 1 or -1
1 = left
-1 = right

In the gani script for each animation I just made the stretchx = player.attr[4]
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:36 PM.


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