Author |
Message |
Zblader
|
Post subject: Need Some Help? Posted: Thu Apr 01, 2010 8:51 pm |
|
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=110that's the public script i've put up for anyone to analyze.
|
|
|
|
|
Altren
|
Post subject: Re: Need Some Help? Posted: Thu Apr 01, 2010 9:57 pm |
|
|
Lead Developer |
|
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.
|
|
|
|
|
queeshai
|
Post subject: Re: Need Some Help? Posted: Thu Apr 01, 2010 10:17 pm |
|
Joined: Fri Nov 13, 2009 8:26 am Posts: 139
|
|
|
|
|
Zblader
|
Post subject: Re: Need Some Help? Posted: Fri Apr 02, 2010 12:43 am |
|
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 ^^.
|
|
|
|
|
jed
|
Post subject: Re: Need Some Help? Posted: Fri Apr 02, 2010 2:56 am |
|
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";
|
|
|
|
|
queeshai
|
Post subject: Re: Need Some Help? Posted: Fri Apr 02, 2010 6:00 am |
|
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.
|
|
|
|
|
jed
|
Post subject: Re: Need Some Help? Posted: Fri Apr 02, 2010 11:06 am |
|
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.
|
|
|
|
|
jed
|
Post subject: Re: Need Some Help? Posted: Fri Apr 02, 2010 12:55 pm |
|
Joined: Tue Jan 08, 2008 2:07 am Posts: 1045
|
Actually nm I see how to make enums. I'll add that.
|
|
|
|
|
|