Aller au contenu

Photo

A Scripting Riddle - Can You Solve It?


  • Veuillez vous connecter pour répondre
61 réponses à ce sujet

#1
_Guile

_Guile
  • Members
  • 685 messages
// gen_cbm

// Created by Genisys / Guile
// Created on 4/23/2011
//////////////////////////////////////////////////
/*
   This script is a riddle
   To Solve one must answer two questions
   What does (cbm) stand for in the name of the script (The Tough Part)
   What is the general message of the script?
*/
/////////////////////////////////////////////////

int GetMonsterStats(object oPC);
void DestroyMonsters(object oPC);
void FindSolution(object oPC);

void main()
{
 object oPC = GetFirstPC();

 while(GetIsObjectValid(oPC))
 {

  FindSolution(oPC);

  oPC = GetNextPC();
 }

//Main Script End
}

//////////////////////////////////////////////
int GetMonsterStats(object oPC)
{
 int nMonsters = 0;
 int nMonsterStats = 0;

 object oArea = GetArea(oPC);

 object oMonster = GetFirstObjectInArea(oArea);

  while(GetIsObjectValid(oMonster))
  {

   if(GetIsReactionTypeHostile(oMonster, oPC) &&
    GetIsEncounterCreature(oMonster))
   {
     nMonsters +=1;
     nMonsterStats += GetLocalInt(oMonster, "MONSTER_STATS");
   }

   oMonster = GetNextObjectInArea(oPC);
  }
  if(nMonsterStats>=2)
  {
   nMonsters = nMonsters *nMonsterStats;
  }
  return nMonsters;
}

//////////////////////////////////////////////
void DestroyMonsters(object oPC)
{
 object oArea = GetArea(oPC);

 object oMonster = GetFirstObjectInArea(oArea);

  while(GetIsObjectValid(oMonster))
  {

   if(GetIsReactionTypeHostile(oMonster, oPC) &&
    GetIsEncounterCreature(oMonster))
   {
     SetPlotFlag(oMonster, FALSE);
     SetImmortal(oMonster, FALSE);
     DestroyObject(oMonster, 0.0);
   }

   oMonster = GetNextObjectInArea(oPC);
  }
}

//////////////////////////////////////////////
void FindSolution(object oPC)
{
    int nChallenge = GetMonsterStats(oPC);

    int nPC = GetLocalInt(oPC, "PC_STATS");

    effect eDeath = EffectDeath(TRUE, FALSE);

    if(nChallenge <=  nPC)
    {
      DestroyMonsters(oPC);
    }
    else if(nPC < nChallenge  && nChallenge != 0)
    {
      ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oPC, 0.0);
    }
    else 
     DestroyObject( GetModule(), 0.0 );  //how would we come to this?

//End Riddle
}

Modifié par _Guile, 01 mai 2011 - 06:00 .


#2
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
Here is differant Question.

What are the Major Error in the script.

#3
Ryuhi2000

Ryuhi2000
  • Members
  • 97 messages
my guess is cbm stands for character battle monster and the general message means that one side will result in death if theyre stats are less then the opposing sides and if the players all die the module gets destroyed?

Modifié par Ryuhi2000, 23 avril 2011 - 08:05 .


#4
_Guile

_Guile
  • Members
  • 685 messages
The winner(s) of this challenge gets a very unique reward...

A Preview of the reward...
Posted Image

This is a very special project I'm working on for a friend, who will recieve a copy of it, and the winner of first part of the riddle of this challenge will get one copy & the winner who solves the general message will recieve a copy as well, though I'm not telling you what the reward is, sorry..  =D

Modifié par _Guile, 24 avril 2011 - 12:36 .


#5
_Guile

_Guile
  • Members
  • 685 messages

Lightfoot8 wrote...

Here is differant Question.

What are the Major Error in the script.


Obviously it's a ficticious script, so there can be no errors..  =D

#6
_Guile

_Guile
  • Members
  • 685 messages

Ryuhi2000 wrote...

my guess is cbm stands for character battle monster and the general message means that one side will result in death if theyre stats are less then the opposing sides and if the players all die the module gets destroyed?


Incorrect on both parts, sorry, but your welcome to try again. =D

#7
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages

_Guile wrote...

Lightfoot8 wrote...

Here is differant Question.

What are the Major Error in the script.


Obviously it's a ficticious script, so there can be no errors..  =D


Ok Let see. 

You loop through the PC's and compair the local int on them to the first object in the area of the first PC. 
 What is this Object?    It can be anything including the first PC, A WayPoint, A Trigger, An Item the PC dropped or Perhaps even a Monster that I think you are shooting for.  

I have No Idea why you would want to compair that Randon Object to every PC in the module There is no garentee that the PC who fired off the script is even the First PC who's area that object is being taken from. Making the object even that much more random. 


Then we get into what you are doing with this compairsion versious this int set on who know what and every PC in the module.   

if it is bigger on the PC then the object (orEqual to)    and it happens to be hostile and an encounter creature we kill the encounter creature.     if not  we kill the module.  Good thing the module can not die. at least not by this means, because this is going to most likely happen 99% of the time the script fires. unless of course you have set the local on every door/waypoint/ item...../object in the module to something higher then 0.  

In the unlikely event that the int on the object is bigger then the one on the PC( and by the way that else if , is totaly not needed, It can just be an else for the same results.) you kill the PC.  Not that it matters much, since if any other PC's are in the module they may well try to kill the module it's self.  

In short if you Object oMonster is not an Hostile Encounter Cerature and that beats the PC, And it is most likely not,  The module is dead.   Good thing that can't happen this way.  

EDIT: cdm stands for Club Down Module.
General Message is the Module is Dead.

Modifié par Lightfoot8, 24 avril 2011 - 01:44 .


#8
GhostOfGod

GhostOfGod
  • Members
  • 863 messages
I think cbm stands for "can't be modest".

#9
Ryuhi2000

Ryuhi2000
  • Members
  • 97 messages
say out of curiosity when is the deadline for figuring this out?

#10
leo_x

leo_x
  • Members
  • 223 messages
 Complete Bowel Movement. :D  I keed, I keed.

Seriously tho, this seems to be some message about the old hobgoblin of NWN whose name is Balance.  If his protestations are not met your module will DIE. :P  So, in sum, this script is an example of what previously thought impossible: a Completely Balanced Module.

#11
_Guile

_Guile
  • Members
  • 685 messages

pope_leo wrote...

 Complete Bowel Movement. :D  I keed, I keed.

Seriously tho, this seems to be some message about the old hobgoblin of NWN whose name is Balance.  If his protestations are not met your module will DIE. :P  So, in sum, this script is an example of what previously thought impossible: a Completely Balanced Module.


You are getting warm on the general message (though it's not about balance per say, it has something to do with balance)..  :D

But the CBM part is completely incorrect.. (both guesses)

=============================================

BTW: There is no deadline, it may take some time for the community to solve the riddle...

Modifié par _Guile, 24 avril 2011 - 01:29 .


#12
_Guile

_Guile
  • Members
  • 685 messages
Fixed the script for LightFoot who obviously is focused on the script & not the message.. :D

#13
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
Well the Message of this one is entirely differant then the first.

The Whole is greater then the sum of its parts. At least if you are a hostile Encounter creature. ( nMonsters = nMonsters *nMonsterStats;) nMonsterStats is already the sum of the parts.

And Life Goes on. taken from the line:
else DestroyObject( GetModule(), 0.0);
Since unlike the first version It logicly has no chance to ever execute. The only reason for it to be there would be to point out that it would never happen.

You also need to fix the line: oMonster = GetNextObjectInArea(oPC);

I guess another theam would be Live Together Or Die as One. Since the PC's never stand together.

#14
Xardex

Xardex
  • Members
  • 217 messages
Well, you seem to have some variables for custom challenge rating, or "stats" as it is in your script.
It seems the player has his own stat value and so do the creatures..

If the PC's value is greater or equal to the sum of the current area's hostile encounter creature's stats multiplied by the amount of such creatures, they will all be killed. If the PC's value is lower, the player will be killed, but only if he has no immunity to death magic.

The destruction of the module is there just for gags as it wouldn't work nor does it have the chance to execute, ever.

I'd suppose a script like this could be used for some mass mind or death magic attack, battle of willpowers, of endurance or something like that.

CBM is the short for cubic meter and canadian baptist mission, and propably a few others.
I would guess here its supposed to be "Create Balance Massacre" but thats propably something only I would use...

Though is it balance if you destroy one of the two sides that you are trying to balance...

Chaotic Battle Mindrape
Charismatic Boomboom Massacre
Carrot Bunny Muppet??

Modifié par Xardex, 26 avril 2011 - 12:27 .


#15
_Guile

_Guile
  • Members
  • 685 messages
CBM & the general message are both very much linked together, most likely nobody will be able to guess CBM till the general message is solved. Again, I'll iterate for those who fail to understand, this is not a real script, it's a script that is an enigma/riddle & has a general message...

Leo was the only one who was even remotely close so far to the message...

Trying to pick apart a riddle using logic usually fails, because the writer usually thwarts logic with enigmas within the riddle...

#16
Xardex

Xardex
  • Members
  • 217 messages

_Guile wrote...

this is not a real script


Blasphemy! The script compiles!


In a sentence, the strong will survive.
If not, galaxies will explode.

Modifié par Xardex, 29 avril 2011 - 07:12 .


#17
GhostOfGod

GhostOfGod
  • Members
  • 863 messages
Hmm...well...if the monsters are less than or as challenging as the player then all the monsters die. If the player is less challenging than the monsters, the player dies. Else the world dies..but as far as the script gos it can't since either of the other scenarios will be true. Maybe we're supposed to let that slide. So the greater power always wins. Seems to have a lot to do with challenge so I'm ganna say:

Challenge Based Module?

#18
_Guile

_Guile
  • Members
  • 685 messages

GhostOfGod wrote...

Hmm...well...if the monsters are less than or as challenging as the player then all the monsters die. If the player is less challenging than the monsters, the player dies. Else the world dies..but as far as the script gos it can't since either of the other scenarios will be true. Maybe we're supposed to let that slide. So the greater power always wins. Seems to have a lot to do with challenge so I'm ganna say:

Challenge Based Module?


You are looking at a very important aspect of the general message, the challenge, but you have not solved the riddle, what is the general message?

Challenge Base Module, all 3 answers are wrong..

Modifié par _Guile, 29 avril 2011 - 10:00 .


#19
Terrorble

Terrorble
  • Members
  • 193 messages
This script is bad news for monsters with crappy stats that do not show up in sufficient number to ensure a favorable outcome for themselves. I suppose they can hope that their encounter is triggered by a weak player otherwise.

It could be construed to say: the outcomes are just a comparison of their cumulative stats vs. mine, so why bother fighting, just add'em up and decide that way. A sort of trivialization of the game.

The way that the # of monsters is multiplied by their stats, suggests to me the function is trying to mimic or predict outcome; that the script is trying to "model" how the difficulty of a monster spawn grows quickly if their stats are higher compared to having more of them. Where the terms the model accounts for are grouped into these black-box variables: PC_STATS and MONSTERS_STATS.

The module will never die as long as there are players and monsters, though it will never die without either, But like the functions, there's no point without first, a player, and second, monsters.

creature balance model?

#20
Blasco-Yang

Blasco-Yang
  • Members
  • 8 messages
Maybe the general message is nothing more than the age old observation that Good and Evil are intricately linked like the two sides of the same coin? That one cannot survive without the other and that they must always be balanced. When one is greater than the other all of reality collapses in upon itself?

As far as what "cbm" stands for..... I couldn't even begin to hazard a guess.

#21
Greyfort

Greyfort
  • Members
  • 234 messages
General message, close to balance but not 100%. Character/Creature, Behavioral, Motivation or Character/Creature, Behavioral, Modification LOL

Morally and Philosophically I don’t agree with balance. There is only one Truth,Way,Life. And since you said logic wont solve riddle or guess general message. I'm going to take a chance and get a little philosophical and Science-y

1)Good and Evil don’t need each other. Good can stand alone and will. Ware evil comes in is What is your moral compass. The Moral law giver the standard, which you believe. This gets into a big Philosophical debate. good/evil is relative. etc. No time for that here I don’t think Guile put that much thought into the riddle....although with the name like Guile...*scratches head* Maybe....

2) In the natural state of the world we live in, from all forms of flora and fauna. The strongest generally survive, unless of course someone intervenes and helps the weaker. We see this in humans and animals mainly. Although in cases of bactria and other micro organisms some have a mutation that allows them to survive something that others can’t, but they often lost the ability to survive what others could. hence the mutation.

So in regards to the riddle script, a creature is trying to find a solution in the area they are in. Similar to what all of us do in every day life. Although In a civilized society we can’t kill the hostile’s unless our life is in danger, and then we can be prosecuted for even defending our self’s.

P.E.T.A..”He killed that bear...They are a indangered Animal.”
PC “ It was charging at me..Besides I thought PETA stood for People.Eat.Tasty.Animals.”

Hence ware Law comes in due to peoples/creatures in ability to self govern, which we all have fallen short of from the smallest thing to the largest thing. Creating what people call Balance, yet is Accountability for ones actions in a civil society.

////
Hence the word civil as defined by Webster:

Civil
CIVIL, a.

1. Relating to the community, or to the policy and government of the citizens and subjects of a state; as in the phrases, civil rights, civil government, civil privileges, civil war, civil justice. It is opposed to criminal; as a civil suit, a suit between citizens alone; whereas a criminal process is between the state and a citizen. It is distinguished from ecclesiastical, which respects the church; and from military, which respects the army and navy.

2. Relating to any man as a member of a community; as civil power, civil rights, the power or rights which a man enjoys as a citizen.

3. Reduced to order, rule and government; under a regular administration; implying some refinement of manners; not savage or wild; as civil life; civil society.

4. Civilized; courteous; complaisant; gentle and obliging; well-bred; affable; kind; having the manners of a city, as opposed to the rough, rude, coarse manners of a savage or clown.

Where civil speech and soft persuasion hung.

5. Grave; sober; not gay or showy.

Till civil suited morn appear.

6. Complaisant; polite; a popular colloquial use of the word.

7. Civil death, in law, is that which cuts off a man from civil society, or its rights and benefits, as banishment, outlawry, excommunication, entering into a monastery, &c., as distinguished from natural death.

8. Civil law, in a general sense, the law of a state, city or country; but in an appropriate sense, the Roman empire, comprised in the Institutes, Code and Digest of Justinian and the Novel Constitutions.

9. Civil list, the officers of civil government, who are paid from the public treasury; also, the revenue appropriated to support the civil government.

The army of James II was paid out of his civil list.

10. Civil state, the whole body of the laity or citizens, not included under the military, maritime, and ecclesiastical states.

11. Civil war, a war between people of the same state or city; opposed to foreign war.

12. Civil year, the legal year, or annual account of time which a government appoints to be used in its own dominions, as distinguished from the natural year, which is measured by the revolution of the heavenly bodies.

13. Civil architecture, the architecture which is employed in constructing buildings for the purposes of civil life, in distinction from military and naval architecture; as private houses, palaces, churches, &c.

/////
So before I ramble on, the riddle keeps some sort of law similar to what ever object is strongest, destroying the weaker. Just from the script. so one has a tendency to think the “c" is creature/character/ challenging, etc. or Civil.

The “b” gets a little trickery since we have a clue about balance people have a tendency to migrate to that word. Yet in the script I see behavior [HOSTILE] and logic tends to see Behavior, yet were told logic wont solve, or helps very little to solve the riddle.

And well the “m” might as well be MWAAAAH from Guile since in the script something dies LOL.

so Another guess I have is “Constant”, for “c”, I think I’ve given above “b” and “m” answers

the message screams “survival of the strongest”, by the script. but also it makes me think “Character, Bad,Moment” if the monsters are stronger. “Character, Blessed, Moment” if PC stronger.

I better stop Rambling...I get close?

#22
zero-feeling

zero-feeling
  • Members
  • 144 messages
just going to throw a random answer:

cant be mastered

#23
Knight_Shield

Knight_Shield
  • Members
  • 444 messages
*throws out answer also*

gen = RUN!

because

cbm= Canned Beaneating Monster

I hear they smell worse than 10 Dwarves on holiday.

#24
_Guile

_Guile
  • Members
  • 685 messages

Knight_Shield wrote...

*throws out answer also*

gen = RUN!

because

cbm= Canned Beaneating Monster

I hear they smell worse than 10 Dwarves on holiday.


This by far is the most entertaining & commical answer yet, lmao.. :D
(But way off)

#25
_Guile

_Guile
  • Members
  • 685 messages

zero-feeling wrote...

just going to throw a random answer:

cant be mastered


All wrong on cbm..