Author Topic: RPG questing help  (Read 6943 times)

0 Members and 1 Guest are viewing this topic.

DeathAdder

  • Orc Thrasher
  • ***
  • Posts: 137
  • Reputation: +0/-0
    • http://www.los.planetubh.com
(No subject)
« Reply #15 on: November 2, 2003 02:17 pm CST »
Damn.. Thanx Susan I think you just figured it out. Wow didn't think i'd need that. Well what you explained made me interpret this to be something that would work.
Code: [Select]
  $LoadOut[TestBot] = "CLASS Paladin LVL 1050 LCK 3 TEAM 4 BroadSword 1"
Where I would have "TestBot" in the %loadout place in the SpawnAi string. Well I have 2 things to try and test so I'll get to em. Thanx ppl I'll let you know if it works.^_^
« Last Edit: December 31, 1969 06:00 pm CST by DeathAdder »
<img src="http://www.pcrpg.org/pics/hosted/dadder.jpg">

DeathAdder

  • Orc Thrasher
  • ***
  • Posts: 137
  • Reputation: +0/-0
    • http://www.los.planetubh.com
(No subject)
« Reply #16 on: November 2, 2003 02:24 pm CST »
I just tested what i got out of your thing Susan and it WORKS!!!! Thank You Susan^_^ Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Yay now all i need is to get the location to be your los.... i'll figure it out. unless someone knows the specific file i can look at. Till than i shall weed the spells.cs for it. ^_^ Thanx ppl youve been a great help^_^
« Last Edit: December 31, 1969 06:00 pm CST by DeathAdder »
<img src="http://www.pcrpg.org/pics/hosted/dadder.jpg">

DeathAdder

  • Orc Thrasher
  • ***
  • Posts: 137
  • Reputation: +0/-0
    • http://www.los.planetubh.com
(No subject)
« Reply #17 on: November 2, 2003 03:58 pm CST »
Well I have the loadout down and i think when in the spells.cs file
Code: [Select]
GameBase::getLOSinfo(%clientid, 50000)should get the casters LOS so now I ran into that *more than one person will summon the same thing* where i need number loop for the name.
I thought this would work but it doesn't I just need a way to loop it so the # on the end of the name when the bot is made becomes the number that will be increased by 1 when its called again.

Code: [Select]
%n = 0;
%name = "UberSummon"@%n++@"";

%newName = "Sloth";
%displayName = "UberSummon"@%name@"";
%aiSpawnPos = GameBase::getLOSinfo(%clientid, 50000);
%commandIssuer = "TempSpawn";
$LoadOut[TestBot] = "CLASS Paladin LVL 1050 LCK 3 TEAM 4 BroadSword 1";
%loadout = "TestBot";
SpawnAI(%newName, %displayName, %aiSpawnPos, %commandIssuer, %loadout);

I was sure something like that would work. But i can't think of a way to start looping the %n++ so that it keeps adding 1 to the number ever time the command is called. If your not sure the "UberSummon"@%name@""; is going to look like UberSummon1 when its spawned and i need the %name to add a 1 each time its called. Any ideas?
« Last Edit: December 31, 1969 06:00 pm CST by DeathAdder »
<img src="http://www.pcrpg.org/pics/hosted/dadder.jpg">

UnderGod

  • Centurian Lord
  • ********
  • Posts: 2,691
  • Reputation: +0/-0
(No subject)
« Reply #18 on: November 2, 2003 05:41 pm CST »
The easiest way would be to do %castername 's Summon
« Last Edit: December 31, 1969 06:00 pm CST by UnderGod »
"The right man in the wrong place can make all the difference in the world"

Susan

  • Goblin Pup
  • *
  • Posts: 13
  • Reputation: +0/-0
(No subject)
« Reply #19 on: November 2, 2003 05:42 pm CST »
Quote
I was sure something like that would work. But i can't think of a way to start looping the %n++ so that it keeps adding 1 to the number ever time the command is called. If your not sure the "UberSummon"@%name@""; is going to look like UberSummon1 when its spawned and i need the %name to add a 1 each time its called. Any ideas?


Use a global variable to keep track of the value. Instead of %n, use $UberSummon or someother descriptive, uncommon variable name.
Then just set the %name to be "UberSummon" @ $UberSummon++;

Using this method, everytime that the function is run, $UberSummon will increase by 1, and you would now have a unique name. However, a server that stays online long enough, and has enough people using it, $UberSummon could get to be quite large. This is unlikely, but possible.
« Last Edit: December 31, 1969 06:00 pm CST by Susan »

DeathAdder

  • Orc Thrasher
  • ***
  • Posts: 137
  • Reputation: +0/-0
    • http://www.los.planetubh.com
(No subject)
« Reply #20 on: November 2, 2003 05:57 pm CST »
Thanx I see where your getting at. Is there any like way to reset that number at any time either manually or when it hits a cirtain number?. I think i know how just too lazy to test and i'm tired of being dissapointed lol.

i'd think having
Code: [Select]
if($ubersummon = 20);
              $ubersummon = 0;

and with that would i have NO initial value to $ubersummon or would i have it = 0 than when the thing is called it addes each time and than IF it hits 50 it becomes 0 agian and repeats with my way up there?
« Last Edit: December 31, 1969 06:00 pm CST by DeathAdder »
<img src="http://www.pcrpg.org/pics/hosted/dadder.jpg">

Susan

  • Goblin Pup
  • *
  • Posts: 13
  • Reputation: +0/-0
(No subject)
« Reply #21 on: November 2, 2003 06:13 pm CST »
If you call a previously undefined variable, it will become whatever you want it to be. So if the first time $ubersummon is called it has no definition, and the call is $ubersummon++, it will assume it is a number, and that number is 0. In other words, you dont have to define it before you use it.

As for the if statement,  You may want to use >= rather than ==. That will cover your butt in the event of a "just in case".

So:
Code: [Select]

$ubersummon = 0;
$LoadOut[TestBot] = "CLASS Paladin LVL 1050 LCK 3 TEAM 4 BroadSword 1";

function FunctionName(%clientId)
{
if($ubersummon >= 50)
$ubersummon = 0;

%player = Client::getOwnedObject(%clientId);
%clientpos = GameBase::getPosition(%clientId);
%length = 500;
$los::object = "";
$los::position = "";
if(GameBase::getLOSinfo(%player, %length))
{
%object = $los::object;
%objpos = $los::position;
%obj = getObjectType(%object);

if (%obj == "SimTerrain" || %obj == "InteriorShape")
{
%name = "UberSummon" @ $ubersummon++ ;
%newName = "Sloth";
%displayName = "UberSummon" @ %name;
%aiSpawnPos = %objpos;
%commandIssuer = "TempSpawn";
       %loadout = "TestBot";
SpawnAI(%newName, %displayName, %aiSpawnPos, %commandIssuer, %loadout);
}
}
}


Or something like that.
« Last Edit: December 31, 1969 06:00 pm CST by Susan »

DeathAdder

  • Orc Thrasher
  • ***
  • Posts: 137
  • Reputation: +0/-0
    • http://www.los.planetubh.com
(No subject)
« Reply #22 on: November 2, 2003 06:29 pm CST »
Well I now have 2 HUGE problems.... One when i go #cast summonuber, it won't spawn the uber... and 2 when i use stright code from a function it will let me spawn the uber only once, and won't let me spawn another one because the Sloth name is already used.... for some reason the race name seems to only be able to be used once. I don't understand why.:(
« Last Edit: December 31, 1969 06:00 pm CST by DeathAdder »
<img src="http://www.pcrpg.org/pics/hosted/dadder.jpg">

DeathAdder

  • Orc Thrasher
  • ***
  • Posts: 137
  • Reputation: +0/-0
    • http://www.los.planetubh.com
(No subject)
« Reply #23 on: November 2, 2003 06:41 pm CST »
Well when i fix one problem i seen to hit at least 2 more. This isn't turining out well. For one thing when i activated it it didn't do anything so i killed the if(gamebase, and than it did something but couldn't find the object i was pointing at... than theres that stupid only one race allowed to spawn thing:( I'll just wait till muggz gets back and talk to him. see if he has any ideas. Thanx for the help ppl.
« Last Edit: December 31, 1969 06:00 pm CST by DeathAdder »
<img src="http://www.pcrpg.org/pics/hosted/dadder.jpg">

Susan

  • Goblin Pup
  • *
  • Posts: 13
  • Reputation: +0/-0
(No subject)
« Reply #24 on: November 2, 2003 08:43 pm CST »
It would be helpful to see the code that makes up the spell part. As for the Race Name, just do this:
Code: [Select]
        %name = "UberSummon" @ $ubersummon++ ;
         %newName = "Sloth" @ $ubersummon; //Changes here
         %displayName = "Summoned_Uber" @ $ubersummon; // and here.
« Last Edit: December 31, 1969 06:00 pm CST by Susan »