Login    Forum    Search    FAQ

Board index » Scenarios & Scripting




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Need Some Help?
 Post Posted: Thu Apr 01, 2010 8:51 pm 
Offline

Joined: Thu Nov 26, 2009 4:10 am
Posts: 829
Creating this topic for those of you who need help but can't get any noticable stuff done about it (or don't want to ask the same people over and over). You never know :).

Likewise, I'll start with a script I'm having trouble with.
{Script,Rebeling Scroundrels!,110}
Error: Only objects have constructors.
But why?
http://thefarwilds.com/story/view.php?sid=110
that's the public script i've put up for anyone to analyze.


Top 
 Profile  
 
 Post subject: Re: Need Some Help?
 Post Posted: Thu Apr 01, 2010 9:57 pm 
Offline
Lead Developer
User avatar

Joined: Mon Mar 31, 2008 9:55 pm
Posts: 716
Location: Moscow, Russia
look at
Code:
int rand(11);
I know what you wanted to do, but rand can't be variable and function name at same time, you should write
Code:
int randomInteger = rand(11);
, so you declare new variable called randomInteger and assign some value to it. Also note that error message show line number where you have error.


Top 
 Profile  
 
 Post subject: Re: Need Some Help?
 Post Posted: Thu Apr 01, 2010 10:17 pm 
Offline

Joined: Fri Nov 13, 2009 8:26 am
Posts: 139
http://thefarwilds.com/story/view.php?sid=111

ignore the parts that are commented out ... they are implicit suggestions for Jed.


Top 
 Profile  
 
 Post subject: Re: Need Some Help?
 Post Posted: Fri Apr 02, 2010 12:43 am 
Offline

Joined: Thu Nov 26, 2009 4:10 am
Posts: 829
Arigato guys! Now, I wonder who will post their problem next?
@queeshai: you'll need to leave that up for a while, I'm not really in the position to be proggraming at the moment.

Edit: Also @ Queeshai: you were beggining to stray off of what I was tryign to do. The Rebellious Serfs are a separate AI faction with no deck or flux, they're just angry serfs. The other two players battle with both each other and the Rebellious Serfs. Thanks for the help, you can take example 001 down now ^^.


Top 
 Profile  
 
 Post subject: Re: Need Some Help?
 Post Posted: Fri Apr 02, 2010 2:56 am 
Offline

Joined: Tue Jan 08, 2008 2:07 am
Posts: 1045
queeshai: yeah no #defines. It is just AngelScript so you are limited to what they give you.
also rather than:
// should add locations to an array and check to ensure no duplication
you could just check the return of:
createEntity( "Rebellious Serfs", el, p );
and if it doesn't make an entity then loop an extra time.

//char* cardName = "Rebellious Serfs";
should be:
string cardName = "Rebellious Serfs";


Top 
 Profile  
 
 Post subject: Re: Need Some Help?
 Post Posted: Fri Apr 02, 2010 6:00 am 
Offline

Joined: Fri Nov 13, 2009 8:26 am
Posts: 139
ahh, thanks. I apparently didn't read the scripting wiki close enough earlier -- I see that you mention AngelScript there, too. I made the changes you suggested. not sure what the difference between e.isValid() and e.doesExist() is ... but both either seems effective for my needs.

I added a new set of comments to the script. most importantly, I'd like to see more public methods. if this is of interest to you, I would encourage other folks with coding experience to suggest other methods that would be helpful, especially to less experienced coders.


Top 
 Profile  
 
 Post subject: Re: Need Some Help?
 Post Posted: Fri Apr 02, 2010 11:06 am 
Offline

Joined: Tue Jan 08, 2008 2:07 am
Posts: 1045
queeshai thanks for the feedback from another programmer.

// jed: this should be made more clear via enums or the like
// jed: why is this a global function?
setTerrain( el, 3, 2 );

Of course I'd rather them be enums but I didn't see a good way to add enums in AngelScript.
You want it to be a method of Location instead?

Yeah I'll add more convenience functions like Player.removeDeck() later. I just wanted to get the basics in there first.


Top 
 Profile  
 
 Post subject: Re: Need Some Help?
 Post Posted: Fri Apr 02, 2010 12:55 pm 
Offline

Joined: Tue Jan 08, 2008 2:07 am
Posts: 1045
Actually nm I see how to make enums. I'll add that.


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

Board index » Scenarios & Scripting


Who is online

Users browsing this forum: No registered users and 5 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: