Login    Forum    Search    FAQ

Board index » Scenarios & Scripting




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Specific Bug
 Post Posted: Sun Mar 21, 2010 10:39 am 
Offline

Joined: Mon Mar 02, 2009 11:00 am
Posts: 150
When the game starts out with creatures/buildings placed on the map the players do not get any vision for them. This persists until one player plays a card or controls a flux well at end of round.

Also I don't really understand how I can use forEachEntity() and entityCallback(); an example with them would be helpful.

_________________
ȁ̎̉̈̂̎͋̈́̍n͂͑̿ͥͣ́̓ġͤ͑ͯe͌̓̊ͩ͗̅l̽̓ͬͬͥ̊͗aͣ̔̃ͧ̓̾̾t͊̑̆hͤ͆̓̉̌ͣ̚e̋ͩ͒̈́ĭ̌̒̎ͧ̓̋ͪs̋ͤͧ̅̇̋̎ͫ̂̾ͨ̽̄ͫͯt͒͐̌ͭ̂̃ͪ̽ͣ͗̒ͣ


Top 
 Profile  
 
 Post subject: Re: Specific Bug
 Post Posted: Sun Mar 21, 2010 12:11 pm 
Offline

Joined: Tue Jan 08, 2008 2:07 am
Posts: 1045
ok I'll fix the vision bug.
I added an example of using entityCallback to the wiki.
This is it:

Code:
// Using entityCallback
// This removes the oldest building each round
void onNewRound()
{
   forEachEntity(); // loop through all the Entities
}

bool entityCallback(Entity ent)
{
   if(ent.isType(2)) // Is it a building
   {
      ent.remove();
      return(false); // don't need to call entityCallback anymore
   }   
   return(true); // we haven't found a building yet so keep checking
}


Top 
 Profile  
 
 Post subject: Re: Specific Bug
 Post Posted: Sun Mar 21, 2010 10:15 pm 
Offline

Joined: Mon Mar 02, 2009 11:00 am
Posts: 150
ok thanks i think i get it now, however i found some more bugs

whenever the script places an entity that has a ' in its name it only works if the deck that player is using actually contained that card.

Is there some way to test which player controls a card; I tried ent.getController()==getHumanPlayer(0)
but it gave me a compile error.

_________________
ȁ̎̉̈̂̎͋̈́̍n͂͑̿ͥͣ́̓ġͤ͑ͯe͌̓̊ͩ͗̅l̽̓ͬͬͥ̊͗aͣ̔̃ͧ̓̾̾t͊̑̆hͤ͆̓̉̌ͣ̚e̋ͩ͒̈́ĭ̌̒̎ͧ̓̋ͪs̋ͤͧ̅̇̋̎ͫ̂̾ͨ̽̄ͫͯt͒͐̌ͭ̂̃ͪ̽ͣ͗̒ͣ


Top 
 Profile  
 
 Post subject: Re: Specific Bug
 Post Posted: Sun Mar 21, 2010 11:06 pm 
Offline
Lead Developer
User avatar

Joined: Mon Mar 31, 2008 9:55 pm
Posts: 716
Location: Moscow, Russia
ent.getController()==getHumanPlayer(0)

Hmm, that should work. What error did it gave?


Top 
 Profile  
 
 Post subject: Re: Specific Bug
 Post Posted: Mon Mar 22, 2010 12:57 am 
Offline

Joined: Mon Mar 02, 2009 11:00 am
Posts: 150
i get "No matching operator that takes the types 'Player&' and 'Player&' found" and "Expression must be of boolean type" when using the code in an if statement

_________________
ȁ̎̉̈̂̎͋̈́̍n͂͑̿ͥͣ́̓ġͤ͑ͯe͌̓̊ͩ͗̅l̽̓ͬͬͥ̊͗aͣ̔̃ͧ̓̾̾t͊̑̆hͤ͆̓̉̌ͣ̚e̋ͩ͒̈́ĭ̌̒̎ͧ̓̋ͪs̋ͤͧ̅̇̋̎ͫ̂̾ͨ̽̄ͫͯt͒͐̌ͭ̂̃ͪ̽ͣ͗̒ͣ


Top 
 Profile  
 
 Post subject: Re: Specific Bug
 Post Posted: Mon Mar 22, 2010 2:00 am 
Offline

Joined: Tue Jan 08, 2008 2:07 am
Posts: 1045
Oh yeah I need to expose the comparison for all these objects.


Top 
 Profile  
 
 Post subject: Re: Specific Bug
 Post Posted: Mon Mar 22, 2010 2:50 pm 
Offline

Joined: Tue Jan 08, 2008 2:07 am
Posts: 1045
ok both those problems should be fixed


Top 
 Profile  
 
Display posts from previous:  Sort by  
 
Post new topic Reply to topic  [ 7 posts ] 

Board index » Scenarios & Scripting


Who is online

Users browsing this forum: No registered users and 6 guests

 
 

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron