Particle's Custom RPG

Assistance => Assistance & Feedback => Topic started by: DeathAdder on November 15, 2003 12:52 am CST

Title: Coding
Post by: DeathAdder on November 15, 2003 12:52 am CST
Hey, none of you seem to inclined to help me get a GetWord(); thing working so i was wondering if anyone knew of a site or something that can help??. Unless someone out there IS willing to help me?. Thank you.
Title:
Post by: Particle on November 15, 2003 07:03 am CST
This is the first I've heard about it.  Give us some details.
Title:
Post by: -eViL- on November 15, 2003 09:28 am CST
yea, seriously, I haven't heard a thing about it and i'll help with it...
Title:
Post by: DeathAdder on November 19, 2003 02:06 pm CST
OK sorry bout that, well start anew. Heh. Well all i want is to be able to use the getword(); thingy top grab a name from something that my bot sais or i say through a quest script. That will allow me to use that name for mutiple events. If its possible to make someones name carry through multiple blocks i'd like to know until than i'd like to know about the getowrd thing anyways.

I've done some fooling arround with it and i havn't gotten anywhere. All i can do is grab words from doing a getwordfunc(%word) where i grab whatever word in the sentence i type in that. But i couldn't get words from strings that ppl say in the chat box. I tried making a variable = the first word in the sentance and that didn't work:\ i looked at lots examples like in comchat.cs and i tried to make a connection where thier string::NEWgetsubstr(); thing might have been the thing i'd use to grab strings and look for the first word. Tried that, didn't work.

Pretty much i'm stuck. Id post some code where i did some examples but i'm at school. Sorry for takinga  while to answer, heh i check my mail once a week and like i forgot about this post ^_^ Thanx for the offer to help I hope i can get this working.
Title:
Post by: -eViL- on November 19, 2003 03:31 pm CST
Code: [Select]
function onClientMessage(%client, %msg)
{
for(%word=0; %word <= 5; %word++)
%Word[%word] = getWord(%msg, %word);

return true;
}


that would set %Word[0] through %Word[5] using the first words from a message sent to you.
Title:
Post by: DeathAdder on November 19, 2003 04:04 pm CST
WOW.... Ok so lets say i want to get a name from a global message like....
[GLBL] Bot "Well done Ian, nice work"
so to grab ian would i use getword(%msg, 4); cause the [GLBL] is 0, bot is 1, "well is 2, done 3, ian 4, nice 5, work 6,.... well with your %word setting the word from 1 to 5 what did you mean?
Title:
Post by: -eViL- on November 19, 2003 04:45 pm CST
that function... everytime you get a message, it will sort the message out into parts... the first 6 parts....

%Word[0] = getWord(%msg, 0);
%Word[1] = getWord(%msg, 1);
%Word[2] = getWord(%msg, 2);
%Word[3] = getWord(%msg, 3);
%Word[4] = getWord(%msg, 4);
%Word[5] = getWord(%msg, 5);

that loop i put in there basically does that... so it divides the sentence up for you..
Title:
Post by: DeathAdder on November 19, 2003 10:44 pm CST
Assuming that does that for EVERY thing that comes up in the chat box i'd just start counting and doing if(%word[3] == "Bot") lets say checking for the name and than after that go into the %word[5] = %name; for the specific name i want and than i can start using %name for other things as long as the message its grabbing is from that specific scentence. I could always do 2 ifs to ensure that the sentence i want is the one it gets the name from. i can organize it. I hope i'm assuming right :\

Also if i wanted to make messages not appear like loadout defined and demon already exists, *plain white messages* how would i do it. Like if (this message appears) echo blah *so it only sppears in consol not chat box* return true; something like that, i dunno. Any ideas?
Title:
Post by: -eViL- on November 20, 2003 02:08 pm CST
Code: [Select]
function onClientMessage(%client, %msg)
{
for(%word=0; %word <= 5; %word++)
%Break[%word] = getWord(%msg, %word);

%Name = %Break[1];

if(String::findSubStr(%msg, "Loadout already defined.") != -1)
{
echo("Loadout Already Defined.");
return false;

// returning false makes it not show up in chat.
}

return true;
}
Title:
Post by: DeathAdder on November 20, 2003 11:16 pm CST
Hey, Thanx so much you really hellped, I can do what i need now. Only one thing i'm not sure if you know how or if its possible but I'm sure you can actually get letters with in words.. like how # is grabbed in comchat.cs and that so i used your for(%word blah) to do a %sylible where %letter[%sylible] = String::getSubStr(%msg, %Break[3], %Letter[3]) all that, had no errors only didn't work.. I have some more testing to do but if you know how that might be faster. Thanx again for all the help.
Title:
Post by: -eViL- on November 21, 2003 02:56 pm CST
Code: [Select]
%Start = 0;  %Finish = 1;
%Letter = String::getSubStr(%Break[%Choice], %Start, %Finish);
Title:
Post by: DeathAdder on December 26, 2003 10:52 pm CST
Hey ppl I'm back and need some more help ^_^. Now I want to know if it's possible to get the zone someones in. Like have a script check for the zone someones in than if thier in a cirtain zone have the script do something. When someone i have on a list enters the zone i'm in I want it to tell me they came in pretty much... Any help? Thanks
Title:
Post by: DeadBreed on December 27, 2003 07:25 am CST
ok i need help now too :-\

i have 2 files which are basically autoexec but,  i want to make em run seperately: one runs if i run rpg, the other runs if i run normal tribes.

my files are called rpgexec.cs and normexec.cs

oh yeah how do i fix deuspack on the part where it says im not running
-mod rpg
Title:
Post by: UnderGod on December 27, 2003 07:50 am CST
Quote from: "DeadBreed"
oh yeah how do i fix deuspack on the part where it says im not running
-mod rpg


run it -mod rpg

The easiest thing for you is to have tribes installed twice.. One for base, One for TRPG.
Title:
Post by: DeathAdder on December 27, 2003 12:26 pm CST
Any ideas on my problem?.....:(
Title:
Post by: DeadBreed on December 27, 2003 05:29 pm CST
Quote from: "UnderGod"
Quote from: "DeadBreed"
oh yeah how do i fix deuspack on the part where it says im not running
-mod rpg

run it -mod rpg

The easiest thing for you is to have tribes installed twice.. One for base, One for TRPG.

i have a folder with shortcuts to run all the mods on tribes i have but i dont want to always have to click rpg after i feel like playing some annihilation or something and sometimes i dont like playing a game when i dont have an arrow over my team mates in annihilation or any other mod
Title:
Post by: UnderGod on December 27, 2003 05:51 pm CST
You can't just flush tribes like that.

Once you run TRPG, everything is going to stay loaded untill you restart tribes.
Title:
Post by: DeathAdder on December 27, 2003 07:46 pm CST
And me?... Lol... Sorry i'm just really really wanting this stupid script to work.... **Getting sick of watching the tab menu every possible second**... :(
Title:
Post by: DeadBreed on December 27, 2003 11:04 pm CST
didn't you have the script that warns you whenever G-Unit or Chexmix went into the zone you were in a while ago?  i THINK thats the kind of script yer referring to...
Title:
Post by: -eViL- on December 27, 2003 11:41 pm CST
Quote from: "UnderGod"
You can't just flush tribes like that.

Once you run TRPG, everything is going to stay loaded untill you restart tribes.


ding ding ding, we have a loser.

you can purge tribes of everything that loads from TRPG, its actually quite simple too, you just have to know the commands and a decent knowledge of what you are doing.

for starters:
deleteObject(getObjectByName("EntitiesVolume"));
$modList = "";
EvalSearchPath();
newObject(EntitiesVolume, SimVolume, "entities.vol");

that would cleanse tribes of all images and dis files loaded in by TRPG, which is the major portion of it all, it would also reset the -mod to base and then proceed to load in the base entities.

but then again, what in the fork do i know, i am just some idiot.
Title:
Post by: xkenshinx on December 27, 2003 11:49 pm CST
ozzy... pwned?... :P by eViL no less
Title:
Post by: UnderGod on December 28, 2003 07:26 am CST
Quote from: "-eViL-"
Quote from: "UnderGod"
You can't just flush tribes like that.

Once you run TRPG, everything is going to stay loaded untill you restart tribes.

ding ding ding, we have a loser.

you can purge tribes of everything that loads from TRPG, its actually quite simple too, you just have to know the commands and a decent knowledge of what you are doing.

for starters:
deleteObject(getObjectByName("EntitiesVolume"));
$modList = "";
EvalSearchPath();
newObject(EntitiesVolume, SimVolume, "entities.vol");

that would cleanse tribes of all images and dis files loaded in by TRPG, which is the major portion of it all, it would also reset the -mod to base and then proceed to load in the base entities.

but then again, what in the fragglewert do i know, i am just some idiot.



ding ding ding ding  We have an idiot!

Lets tell him what he has won!
deleteObject(getObjectByName("EntitiesVolume"));

deleteObject: Object 'False' doesn't exist!

And even when you overwrite Entities, it still doesn't change.
Title:
Post by: -eViL- on December 28, 2003 08:49 am CST
yea it does oz, the deleteObject may not work because i was throwing that code down out of my head, it seems like it should though.  and another thing, if you delete the entities file and load in the original BASE entities file, yes, it will clear all the tRPG file, and don't argue with me on this.  i based a lot of work on HappyMod around this concept and it works just fine.
Title:
Post by: DeadBreed on December 28, 2003 09:15 pm CST
so wat should i put into this .cs file to make it purge tribes? do i just put
Code: [Select]
deleteObject(getObjectByName("EntitiesVolume"));
$modList = "";
EvalSearchPath();
newObject(EntitiesVolume, SimVolume, "entities.vol");
?

i know virtually nothing about coding
Title:
Post by: UnderGod on December 28, 2003 09:40 pm CST
No, that doesn't work.

What evil said was just theoretical.
Title:
Post by: -eViL- on December 29, 2003 10:35 am CST
bullmalarkey theoretical ozzy, go find a guy that stopped playing tribes about 4 years ago, his name is Doc.  that code isn't theoretical and he can send you HappyModv2 which runs parts of that code, and it works.
Title:
Post by: -eViL- on December 29, 2003 11:05 am CST
double post!  w00 h00.

Code: [Select]
function Volumes::Load()
{
newObject("RPGVol1", SimVolume, "tRPGVols\\tRPGVol1.vol");
newObject("RPGVol2", SimVolume, "tRPGVols\\tRPGVol2.vol");
newObject("RPGVol3", SimVolume, "tRPGVols\\tRPGVol3.vol");
}

Event::Attach(eventConnected,"schedule(\"Volumes::Load();\",1);");

function Volumes::Unload()
{
flushTextureCache();

if(isObject("RPGVol1")) deleteObject("RPGVol1");

if(isObject("RPGVol2")) deleteObject("RPGVol2");

if(isObject("RPGVol3")) deleteObject("RPGVol3");

deleteObject("EntitiesVolume");
newObject("EntitiesVolume", SimVolume, "Entities.vol");
}

Event::Attach(eventConnectionAccepted, Volumes::Unload);


granted that version runs off of presto, you can make it into some more advanced forms to do some really unique malarkey.
Title:
Post by: -eViL- on December 29, 2003 11:39 am CST
triple post.  ha.

ok oz, i think i should probably explain this to you and to everyone else reading through this stuff.  the entire concept is very simple, and how you do it is even simpler.  if you want to load in some "mod" files such as models and skins, you can put them all inside a volume and create a newObject using that volume you created and tribes will automatically add all those skins and models to the existing entities volume.  when you clear the entities volume, tribes literally clears it, you have no entities left.  then you re-build the entities file but since the entities file is based off of the base tribes, you get nothing but the original tribes files in the entities volume and so therefore, you have made a volume for a mod that can be added and taken out just for whenever you need to run it.
Title:
Post by: DeadBreed on December 29, 2003 03:24 pm CST
Quote from: "-eViL-"
double post!  w00 h00.

Code: [Select]
function Volumes::Load()
{
newObject("RPGVol1", SimVolume, "tRPGVols\\tRPGVol1.vol");
newObject("RPGVol2", SimVolume, "tRPGVols\\tRPGVol2.vol");
newObject("RPGVol3", SimVolume, "tRPGVols\\tRPGVol3.vol");
}

Event::Attach(eventConnected,"schedule("Volumes::Load();",1);");

function Volumes::Unload()
{
flushTextureCache();

if(isObject("RPGVol1")) deleteObject("RPGVol1");

if(isObject("RPGVol2")) deleteObject("RPGVol2");

if(isObject("RPGVol3")) deleteObject("RPGVol3");

deleteObject("EntitiesVolume");
newObject("EntitiesVolume", SimVolume, "Entities.vol");
}

Event::Attach(eventConnectionAccepted, Volumes::Unload);

granted that version runs off of presto, you can make it into some more advanced forms to do some really unique shizzle.

so thats all i put in an empty .cs file?
Title:
Post by: UnderGod on December 30, 2003 12:17 am CST
Go to http://www.dictionary.com (http://www.dictionary.com) and look up the word 'theory'.
Title:
Post by: -eViL- on December 30, 2003 01:01 am CST
nothing i didn't know before, i just think me and you used 2 different definitions.  i was thinking you meant that i was stating it is possible but its all in my head and you were thinking that its been proven.....
Title:
Post by: Hersh on December 31, 2003 07:01 pm CST
Code: [Select]
Event::Attach(eventConnectionAccepted, Volumes::Unload);

In PrestoPack what does Event do exactly?
(No sorry, I can't download it, I tried a couple times after I saw eViL's post and it came out corrupted every time.)

Hersh
Title:
Post by: -eViL- on December 31, 2003 07:07 pm CST
basically presto re-wrote client.cs (or the major functions anyways) and when you attach an event, it executes the event or evaluates when the event is called.
Title:
Post by: Silvanoshei on January 1, 2004 11:09 am CST
If you actually need or want Presto, I have a copy I can send to you.
Title:
Post by: -eViL- on January 1, 2004 11:50 am CST
i downloaded it and sent it to him already silv.  thanks for offering that though :).
Title:
Post by: DeathAdder on January 1, 2004 12:30 pm CST
Hey ppl umm I was wondering if there was a function either created or could be created to dissregard any IDACTION commands given for a specific amount of time given
 like

function DisRcomm(%seconds)
{
if(IDACTION blah (detect it) )
    {
    (something to stop that command)
    }
schedule::cancel("disrcomm();", %seconds);
}

I'm sure theres gotta be a way to do it... Any ideas?
Title:
Post by: -eViL- on January 1, 2004 12:56 pm CST
yea, you could route all IDACTION through a function and then if not block it, then use the right command, otherwise just do a return; to block it.
Title:
Post by: DeathAdder on January 1, 2004 01:20 pm CST
Umm... so how would i do this.? if you want to see the segment of code i'm using let me know.