Garrulous Glaahk Daravon Posted April 27, 2004 Share Posted April 27, 2004 Perhaps it is because I am such a neophyte to the world of programming, but it doesn't seem to be made clear whether or not one should type the words "void" and "short" as they are shown in the Documentation and Appendix. My first thought is "no" since they are not connected to the calls by underscores but, then again, they are shown with every single call and it is never explained outright whether they are needed (though it is explained what they mean). Link to comment Share on other sites More sharing options...
Garrulous Glaahk spyderbytes Posted April 27, 2004 Share Posted April 27, 2004 That's probably a good point, for those who aren't familiar with programming language conventions. No, you don't type them. They're only there to let you know what you can expect to get returned (if anything) from a function, when you call it. IOW, if the call definition starts with 'short', for example, it means it 'returns' a value that you can assign to a variable. For example: how_many = party_size(); spot_x = my_loc_x(); Calls that start with 'void' indicate that the call doesn't return any sort of value to you. It just "does its thing". Link to comment Share on other sites More sharing options...
Curious Artila coreyh Posted April 27, 2004 Share Posted April 27, 2004 Reading about the C language will help you learn the style of the scripting. Link to comment Share on other sites More sharing options...
Garrulous Glaahk Daravon Posted April 27, 2004 Author Share Posted April 27, 2004 That's very helpful, spyder. As a sort of a follow up question: what about a call with parentheses and a "short" within them, say.. *picks a random call in the appendix* Code: void set_incidental_sound(short on_or_off) what is with the "shorts" on the interiors of many calls' parentheses? What do I do with them? EDIT: coreyh, sadly I am a college student and am not able to do everything. Otherwise, I probably would read about C. Link to comment Share on other sites More sharing options...
Garrulous Glaahk spyderbytes Posted April 27, 2004 Share Posted April 27, 2004 Ah... I should have thought to mention that, as well. That means that the call expects you to supply a value to it. IOW, that particular call expects you to supply a short, on_or_off--in this case, either 0 or 1, TRUE or FALSE. In your script, it would look like: set_incidental_sound(TRUE); to turn on incidental sounds, or: set_incidental_sound(FALSE); to turn it off. Of course, 0 and 1 are the exact same things as TRUE and FALSE. EDIT: Since my post doesn't make it entirely clear, 1 == TRUE and 0 == FALSE, by programming convention. Link to comment Share on other sites More sharing options...
Garrulous Glaahk Daravon Posted April 27, 2004 Author Share Posted April 27, 2004 Thankyou! Quote: Originally written by spyderbytes: Of course, 0 and 1 are the exact same things as TRUE and FALSE. Of course, that much I had figured out. And now, back to writing town states.. Link to comment Share on other sites More sharing options...
Recommended Posts