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 03-20-2007, 12:31 AM
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
Creating Polys from Chat?

What would be the best course of action any of you would choose to create polys from a number the player states?

Using cos and sin I am not sure how I would go about this,
__________________


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
  #2  
Old 03-20-2007, 12:41 AM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Here:

PHP Code:
//#CLIENTSIDE
function onPlayerChats()
{
     if (
player.chat.starts("/putpoly"))
     {
          
temp.verticies player.chat.substring(11).tokenize();
          echo(
temp.verticies);
          
          
          
showPoly(15temp.verticies);
     }

How to use: /putpoly vert1 vert2 vert3 vert4
__________________
What signature? I see no signature?
Reply With Quote
  #3  
Old 03-20-2007, 01:23 AM
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
I meant more along the lines of stating a number of sides. And getting an even polygon from that.
__________________


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
  #4  
Old 03-20-2007, 05:38 AM
Falcor Falcor is offline
Darth Cucumber
Falcor's Avatar
Join Date: Mar 2001
Location: At School
Posts: 2,874
Falcor is on a distinguished road
Send a message via ICQ to Falcor Send a message via AIM to Falcor Send a message via MSN to Falcor Send a message via Yahoo to Falcor
I didn't test it, but something like this should work.

PHP Code:
//#CLIENTSIDE
function onPlayerChats()
{
    
temp.radius 3;
    
temp.phi 0;
    
    if (
player.chat.starts("/putpoly"))
    {
        
temp.tok player.chat.tokenize();
        
temp.sides temp.tok[1];
        if(
temp.sides 2) {
            
temp.dt 2*pi/temp.sides;
            
temp.vert = {player.x+temp.radius*cos(temp.phi),player.y+temp.radius*sin(temp.phi)};
            for(
temp.1temp.temp.sides; ++temp.i) {
                
temp.vert.addplayer.x+temp.radius*cos(temp.phi temp.i*temp.dt) );
                
temp.vert.addplayer.y+temp.radius*sin(temp.phi temp.i*temp.dt) );
            }
            
showpoly(20,temp.vert);
        }
    }

__________________

subliminal message: 1+1=3
Reply With Quote
  #5  
Old 03-20-2007, 06:23 AM
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
Quote:
Originally Posted by Falcor View Post
I didn't test it, but something like this should work.

PHP Code:
//#CLIENTSIDE
function onPlayerChats()
{
    
temp.radius 3;
    
temp.phi 0;
    
    if (
player.chat.starts("/putpoly"))
    {
        
temp.tok player.chat.tokenize();
        
temp.sides temp.tok[1];
        if(
temp.sides 2) {
            
temp.dt 2*pi/temp.sides;
            
temp.vert = {player.x+temp.radius*cos(temp.phi),player.y+temp.radius*sin(temp.phi)};
            for(
temp.1temp.temp.sides; ++temp.i) {
                
temp.vert.addplayer.x+temp.radius*cos(temp.phi temp.i*temp.dt) );
                
temp.vert.addplayer.y+temp.radius*sin(temp.phi temp.i*temp.dt) );
            }
            
showpoly(20,temp.vert);
        }
    }

Yeah, thanks Falados. I worked something of that order our with Hell Raven and it worked.
__________________


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
  #6  
Old 03-20-2007, 08:11 PM
Kristi Kristi is offline
Bowie's Deciple
Kristi's Avatar
Join Date: Dec 2003
Location: Boston, MA
Posts: 748
Kristi has a spectacular aura aboutKristi has a spectacular aura about
Send a message via AIM to Kristi Send a message via MSN to Kristi
What are you going to learn by having someone do your code for you ^-^
__________________
Reply With Quote
  #7  
Old 03-20-2007, 08:39 PM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Quote:
Originally Posted by Kristi View Post
What are you going to learn by having someone do your code for you ^-^
Absolutely nothing :P
__________________
What signature? I see no signature?
Reply With Quote
  #8  
Old 03-20-2007, 08:51 PM
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
Actually I originally learned gscript by looking at codes other people have done and picking apart how it worked...
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 10:49 PM.


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