Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - RickJ

#381
General Discussion / Re: London Riots
Thu 01/09/2011 20:04:49
Quote
I never spend money for weapons, nor did I ever kill anybody. So either I'm violating my nature and should recieve a treatment or nature doesn't play a fucking role in people's thoughts.
Increator didn't say that murder was natural which is what you are implying.   I'll bet you did eat yesterday and everyday before that and so directly caused countless organisms to be killed so that you could consume them.  Further I'll bet you regularly consume more than (1200 calories/day) what you require to survive.   Either you are in denial or just don't care about the killings you commission, which in the latter case would make you a psychopath and a glutton at that... ;) 

Quote
I don't think it's reductive and simplistic to explain human behavior as motivated by the structure of the society they live in...
I think it's just plain wrong; people are motivated by their emotions and their desire to maintain and improve their well being.   The historical meaning of emotion is "to set in motion".  In the context of a person's  mental states, it's what initiates behavior.   The only affect one's culture and societal structure may have is to color one's perception of "well being".

Here is a link to what appears to be part of a psychology text book that explains this and backs it up with studies and actual data rather than just espousing psychobabble.  The  first three paragraphs give a pretty good explanation of how behavior is initiated.  It's also an interesting read for anyone wanting to implement NPC AI in a game.   

http://dionysus.psych.wisc.edu/lit/Topics/Psychophysiology/CacioppoText/Ch.22.pdf

The recent riots can be understood in these terms.  The participants were motivated by the opportunity to enhance their "well being" by

1.  Experiencing pleasure
2.  Acquiring material goods
3.  Increasing political power (albeit temporarily)

and because of the lack of fear of the consequences.   The lack of fear is due to the relatively mild punishment for such behavior and low likelyhood of any one individual being held accountable ("they can't arrest us all" mindset).  So some here advocate a more severe punishment for such activity so as to put more of the participants' "well being" at risk.

Although the ultimate punishment is not appropriate it is sensible to discuss the appropriate consequences of rioting, looting, etc ought to be.  It is also foolish and naive to believe that fear of consequences and their severity do not motivate or disincentivize  people.   
#382
Dam frustrating isn't it.  Hehe, Is  that why your friend gave up carpentry?   :=
#383
If it were me I would create an event module that would essentially consist of an event queue and the methods Event.Assert(event), Event.Occurred(event, remove=True), Event.InitQueue().

AGS doesn't support function pointers or any kind of callback mechanism.  So one script would place an event id in a queue and other scripts would have to poll, via repeatedly_execute(),  the event queue for any event(s) of interest.

[edit]
The only thing that comes close is CallRoomScript() (or someth9ing similar) that you may find useful.
#384
General Discussion / Re: London Riots
Mon 15/08/2011 04:16:14
QuoteThe American prison system looks pretty nightmarish, but they have a very high re-offending rate.
Duh!  They are professional criminals; it's what they do. 

Over the past decade "three strikes laws", where a third felony conviction carries a life sentence, have been all the rage.  In states where it's been adopted crime rates have significantly fallen.  After a while you run out of people who choose crime as a profession.
#385
When you say script #1 header are you referring to the global script header or a module header?  Look at the module import list.   A module will import/use the header of all modules above itself in the list but not those below it.

Module Guidelines
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=26283.0

DemoQuest
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=34048.0
http://demo.agspace.ws/project/documents/ModuleProgrammingGuidlines-V0100.txt
ttp://demo.agspace.ws/project/documents/ModuleHeaderTemplate-V0101.txt
http://demo.agspace.ws/project/documents/ModuleScriptTemplate-V0100.txt
#386

Check the GUI, maybe some other object is overlaying them.  Also check the background image.  The default scroll controls are black (or other color) lines with transparent fill aso perhaps they are not showing up agaist the background color.  If the background is black and the lines are blcak then they may not be visible to the eye.
#387
Open the SAVE GAME gui in the editor and look at the listbox control.   I believe there is a property that will enable the default scroll controls.  You probably won't be happy with them as most people implement their own using the built-in listbox.functions and listbox.properties.
#388
You can set/change a character or object's view.  So you would just create a alternate view for the character an switch to it when needed. 

I don't remember the if it's a function call or a property but it should be in the  help file under character functions and properties; probably something like "character.view=..." or "character.setview(...)". 
#389
Khris, the verbage/rules can be refined to the issues you mention and any that come up int the future.
#390
If you are new to AGS, overwhelmed, need encouragement, or just want to ask a dumb question without reprisal then you have come to the right place. 

  • Reply to this thread
  • Edit the subject line with your question or topic
  • Type any specific in the message box
  • Expect help only from other beginners
#391
I think it's not really a bad idea to have a sticky "Noob" thread where beginners can gather and  commiserate with each other.  

Most of us techies prefer answering specific technical questions rather than providing anxiety counseling.  ;D     Beginners are sometimes overwhelmed and aren't able to effectively articulate specifics.    A thread similar to what dbuske suggests would perhaps fill that gap.  

If you have a specific question then you would create your own thread as is done now.  If you are looking for encouragement or don't know exactly what or how to ask then you could post in the Noob thread without fear of reprisal.   I think it would eliminate crapola and hurt feeling from the Beginners forum making it better for everyone.

Why not give it a try and see how it works out.  If people find it useful then keep it, otherwise let it die a natural death.  

Here is an example:
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=44112.0

#392
Just found a new open source mobile development framework but haven't had a chance to check it out yet.  It looks promising and may be relevant to this thread.  Thought I'd share.

http://www.phonegap.com/
#393
JP,

I don't understand your last question; perhaps you could clarify.   You can use the listbox keyword to declare a pointer to a listbox if that's what you want.

How/why are you creating 4000 files?   Did you write or have the ability to modify the program that is doing this?   If so perhaps you should consider putting it all in one file?

#394
Quote
1) Can Objects have their own animations? The manual says that Objects can be used for "things which need to animate".
So, say I want the baby to animate in the background anytime he/she is placed and left behind in the crib. Should I make the baby a Character in order to animate him/her or can he/she be animated regardless of being an Object or Character?
Yes, both can be animated.  With regard to deciding which to use, If the item will appear in multiple rooms then a character is normally selected.    If the item will appear exclusively in one or two rooms then an object is  usually selected.  Objects are stored and loaded with the room while characters are global to the entire game.

Quote
2) And, if I do decide to make a baby into a Character, the baby can still be considered as an inventory item (whenever the baby is in the possession of the main character), yes?
Yes.  You would have an inventory item called baby which would be a separate entity from the baby character.  You need to manage/synchronize both with script.

Opps: Khris beat me.  Perhaps there's something useful here anyway.
#395
AFIK game elements such as characters, objects, guis, etc can't be dynamically created at runtime.   The exceptions I am aware of are dynamic sprites and dynamically sized arrays.

However it is generally possible to create generic objects, guis, etc and then configure them on the fly as needed.  There are a number of techniques that can be used depending upon what you are trying to accomplish.

A generic gui for example could contain a collection of buttons, lists, labels, etc which are positioned off screen when not used.  When a "new" gui is created then the desired complement of controls would be positioned on screen and modified with appropriate text and graphics.  The destructor function would then move the controls back off screen.

Also note that objects, guis, characters, etc can generally be accessed via a built-in pointer array.  For example a character named Ego can be accessed using the pointers character[cEgo.ID] or cEgo.  So if there were a number of generic elements it would be possible to search through a list to find a n unused one.

Hope this helps.
#396
Quote
- What, if anything, is the advantage of using char*s vs. the std::string class? Presumably it's a bit faster since there's less overhead and direct memory access and such, but is there actually sufficient overhead with the string class to make it non-viable for a project such as this? By that I mean, in refactoring and cleaning up the code, would one be totally remiss to try and replace the usage of char*s with the more user-friendly strings? If so, why?
This is actually more of a question of ANSI C vs C++.   In the context of something like the AGS runtime conventional wisdom is that C has a number of advantages over C++.

- ANSI C is considered more portable and is less resource intensive.  C++ implementations tend to vary from compiler to compiler much more so than C.

- ANSI C does not automatically, dynamically allocate/reallocate memory as C++ does.  The latter is fraught with potential problems when executed on unknown or resource limited target platforms.   

- Consequently runtime errors are less likely with ANSI C than with C++

- ANSI C typically has a smaller resource footprint than C++

Quote
Is there any technical reasoning to the programming style that seems prevalent among C++ programmers? Having been working with the editor code and trying to develop a plugin (when I'm not working directly in AGScript for modules and things), I feel I've become a bit spoiled really. Regardless of how some people may feel about it, the OO-model is fantastic for organizational purposes. Is there any reasoning why refactoring the engine source into something more OO would be a bad thing? I don't necessarily mean that everything has to be bound inside of a class, but at least for the organization of grouping functions together, this would be a major step in making the code more readable. Not to mention the fact that for those who are accustomed to languages like C#, it would make the transition between looking into the editor code and the engine code much easier.
I agree with you that OO is a superior organizing principal and that it is not necessary to make use of compiler features to take advantage.  I have been doing this for decades in non-OO languages.   I think it would lead to a better quality codebase as well.

Quote
A lot of static limits could be removed by using one of the classes provided such as std::vector, but some of the file structures are currently dependent on the static sizes for the way they encrypt and/or serialize their data. Is there an easy or "simple enough" way to go about rewriting these functions so as to essentially produce the same result without actually locking ourselves into static sizes? I believe the general consensus is that it would be in our best interests moving forward to start with a clean codebase versus a "compatible" one (in reference and relation to the prior versions of the engine), so non-compatibility with the existing functions isn't so much a problem, but presumably the basic gist of what's already being done would be preferable to just rewriting the thing entirely with something new.
I disagree C++ classes are needed to achieve this.  All that is necessary is for the the AGS editor to pass on the number of each item used.  ANSI C could be used to allocate the required resources at startup.

Quote
Quote from: monkey
Also something to consider is any implications that might be prevalent across various platforms. I have zero experience in cross-platform coding, so I'm not personally aware of any of the caveats or complications that may need to be handled to try and make porting the engine as simple as possible.
Platform compatibility boils down to this:

    * Using libraries that are platform independent
    * Use some level of abstraction for things like integer sizes and endianess.
I pretty much agree with Wyz+ on this although I would suggest more extensive use of abstraction.   

With regard to cross-platform libraries you may find QT interesting. 

http://qt.nokia.com/
http://doc.qt.nokia.com/4.7/gettingstartedqt.html

It features support for cross platform graphics, plugins, network, webbrowser, etc ....  It's also C++ ;)
#397
Monkey, apparently my brain was running in standby mode when I made the post.  Clearly I didn't read and understand BA's original post as thoroughly as I should have.   Thought she was having the typical problem many people have with non-blocking background action.

Funny thing you should mention the #define thingy -- I do vaguely remember thinking that those naked defines looked funny for some reason.   :=

[edit]
BlueAngel thanks for your kind words. ;)
#398
Do you want a number of rats randomly running around without blocking the character/player actions?   If this is the case then you will need to move the rat characters using the eNOBLOCK option and check for their movement complete in repeatedly_execute().  When movement is complete then you could randomly select another position to walk to.

Here is some untested code that illustrates whatI'm talking about.  I don't have AGS installed on this computer so I didn't lookup the built-in functions used below for the correct parameter list.  Sorry but you'll have to correct any errors yourself.  HYope you find this helpful.

Code: ags

// *** Room Script ***

define MAXX 640
define MAXY 400

function MoveRat(character *rat) {
   int x,y;
   if (rat.IsMoving()) {
      // Do nothing
   }
   else {
      x = Random(MAXX);
      y = Random(IMAXY);
      rat.Move(x,y,ENOBLOCK);p
   }
}

function repeatedly_execute() {
   MoveRat(eRat1);
   MoveRat(eRat2);
   MoveRat(eRat3);
   MoveRat(eRat4)
   :
   MoveRat(eRatN);
}
#399
Second what InCreator says.  I gave up on tiled sprites a long time ago.   
#400
Quote
... He should be a grown man and use his telepathy to know what dbuske is looking for ...

Hehe, I think that's why Ryan is drinking beer now ... to get his telepathic abilities going... Well at least it works for me that way.   :=
SMF spam blocked by CleanTalk