Developer Store
Support
Member Forums

Screenshots
FAQ
Documentation
License
Known Issues
Downloads

MMOWorkshop BACK!

PyTorque
TGB Web Browser


Boaal

hallsofvalhalla - Been A while
xapken - Wizards and Champions
J.C. Smith - The Repopulation - 0.5.2 Build Notes
EmpireGames - Elementals in Rise of Heroes
Empire Games - WarPath.
jaidurn - Warcall 0.0.1.0 build notes
medafor - Final detailing of models
Thamior - Presence system GONE! [May 25th 2009)]
... MORE BLOGS!

Need a TGE license?
How to change to max ZOOM out on...
How to start EXACTLY?
Checking to see if anyone is sti...
New MMO recruiting
[3dFoin] T. Rex
Quest Remnants of Chaos
Install and Debug quot
[3dFoin] New Year Sale [40% off]...
[3dFoin] Fantasy Snake

Selectrons are the little circles that appear under a NPC or player when you select on him/her. This resource shows you how to do this using the AFX Selectron code. Please do note you can use more than terrain zodiacs, you can literally do just about anything you can do with AFX on spells (particles, explosions, dancing items, lights, etc), but the process is a bit different because of the route the AFX get applied.

This process will use some files not included with the kit for the purpose to validate that you are have a purchased version of TGE or TGEA with AFX. So be prepared to pull a few files. This can be used separate from the rest of the AFX code or added on after you get AFX working for spells.

Python Changes

Python change from Floating Text

You will need this change from the Floating Text snippet. If you already have this added you can skip this part.

simmind.py

Before getWayPoints_r add this function

    #Gets the ghost ID of the target (checks the player connection on both entries)
    def remote_getGhostID(self,id,target): 
        conn = self.playerConnections.get(id,None)
        if not conn:
            conn = self.playerConnections.get(target,None)
        if not conn:
            return -1
            
        return conn.getGhostIndex(target)

playermind.py

Find the following

        self.inventoryCmdAvailableTime = 0
        self.resizeCmdAvailableTime = 0
        
        self.running = True
        self.rootInfo = None

After it add

        self.selectID = -1

A bit further down find this

    def onSpellSlot(self,cinfo,slot):

Before it add this

    def remote_stopSelectron(self):
        if (self.selectID > -1):
            TGECall("processSelectronStop", self.selectID)
        self.selectID = -1
        
    def remote_startSelectron(self,ghostid):
        self.remote_stopSelectron()
            
        self.selectID = ghostid
        TGECall("processSelectron", ghostid,0)
        

mob.py

Find the following line.

    def setTarget(self,target):

Replace it with this (not the whole function, just that 1 line)

    #Passes the Ghost ID back to the client so we can start the selectron
    def setSelectron(self,ghostid): 
	if ghostid > 0:
	    self.player.mind.callRemote("startSelectron",ghostid)    

    def setTarget(self,target):
	if self.player and target and target.simObject and self.simObject:
	    self.zone.simAvatar.mind.callRemote("getGhostID",self.simObject.id,target.simObject.id).addCallback(self.setSelectron) 
	elif self.player:
	    self.player.mind.callRemote("stopSelectron")

Torque script

You need to add 2 functions that is called from the Python.

Find the following file

testgame.mmo/client/scripts/playGui.cs

Add the following 2 functions

function processSelectron(%id,%selectronID)
{
  %obj = ServerConnection.resolveGhostID(%id);
  if (%obj.selectron == 0)
  {
    %selectron = startSelectron(%obj, %selectronID);
    if (%selectron != 0)
      %selectron.addConstraint(%obj, "selected");
    %obj.selectron = %selectron;
  }  
}

function processSelectronStop(%id)
{
  %obj = ServerConnection.resolveGhostID(%id);
  if (%obj.selectron != 0)
  {
    %obj.selectron.stopSelectron();
    %obj.selectron = 0;
  }
}

AFX download

You will need to follow the Install bit from here. Skip step 1

http://www.mmoworkshop.com/trac/mom/wiki/AFX

For Step 1 you will need to get the .cs file yourself.

TGE

example\arcane.fx\server\scripts\effects\CoreTech\selectrons.cs

TGEA

GameExamples\AFXDemo\game\scriptsAndAssets\server\scripts\effects\CoreTech\selectrons.cs

Copy the selectrons.cs file to

testgame.mmo/datablocks/spells

On step 2 you need to add this line for the selectrons instead of flame_broil

exec("./selectrons.cs");

Once this is done open up the selectrons.cs file and make this modification:

Find this line:

%mySelectronDataPath = $afxSpellDataPath @ "/" @ $afxAutoloadScriptFolder @ "/SELE";

Change it to this

%mySelectronDataPath = "~/data/spells/SELE";

Notes

Once this is done everything should be working. There really are 2 config points for this.

In playermind.py you will see this line that you added.

TGECall("processSelectron", ghostid,0)

The last value cooresponds to these files in the selectrons.cs file

// style numbers
$AFX_Default_Style = 0;
$AFX_Old_Style = 1;
$Like_WoW_Style = 2;
$Blue_Flower_Style = 3;
$Booming_Style = 4;
$SciFi_Style = 5;

Each of these values can be called and the follow selectron will be used instead. If you are familiar with AFX you can even add more styles and use lights and other fun things. The TGEA selectrons.cs has less of a selection, but you should get the general idea on how this all works. The Python code takes care of turning off the selectron if the target dies or you select another or unselect the target.

Also if you go back to where you got the selectrons.cs you will find another one in the SpellPack?1 location instead of CoreTech?. This has the arrow selectron.

--X