Project 'R'

Talk about making games.

Project 'R'

Postby DilloDude » Sat Feb 25, 2006 11:09 am

Currently I am working on a cool game project, and it is coming along very well. I have a few questions, though:

1: When typing a string into a function such as strcpy, can I make it go down a line, and if so how?
eg. 'I am typing a text and I am coming to the end of a line so I will move
down a line and continue typing.'

2: Also typing a string for something like the text someone says that includes a string variable in it. For example if you had a string 'name' that was set to 'Fred', could you type something like
Code: Select all
strcpy(text, "Hello,"name", how are you?)
and it would say Hello, Fred, how are you?

3: Now, a question on making a place to type a text such as 'name' in, like the beginning of a game. So you say 'new game' and it asks your name. I can do it with about half a bazillion 'key down' events, but could I get it to use only one (without half a bazillion 'if' statements) and have the backspace key work properly (as opposed to having it clear the whole string)?

4: When using activation regions and you destroy an actor (say an enemy) in one, then move to a new region, when you return to the original region, will the enemy come back? Is there a good way to do this?

5: Last, but not least, Is there a good way of saving the EXACT state of a game and loading it again in the EXACT same way (number of enemies of which type etc.) (and if I wanted you to start off in a certains spot (like the beginning of the level) I could either have it save there, or have it move you to those coordinates when you are created, and you could keep your progress in the level such as items collected)?
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby Novice » Sat Feb 25, 2006 11:35 am

1.use "\n" it will jump to a new line

2.Use
Code: Select all
sprintf(youractor.text, "Hello %s", stringvar);


3.Use a text actor with input on

4.It's easy to check, so do it.:wink:

5.The only, way as far as i know, is to save variables. You can do what you want by usin multiple variables wich will store player position (x,y) stats (health, lives...) enemy's left and so on.
Why do i always get stuck?
User avatar
Novice
 
Posts: 399
Joined: Mon Aug 29, 2005 10:54 am
Location: Relative
Score: 5 Give a positive score

Postby DilloDude » Sun Feb 26, 2006 4:06 am

Thanks for that, It is really helpful.
With the activation region, It resets position of actors when you enter it, but ones that are desroyed stay destroyed. Now, I could have when you enter it, it goes through an array of x and y coordinates and creates different actors there, but it would be a pain, especially for large areas.
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby Novice » Sun Feb 26, 2006 9:39 am

Try puting x and y coordinates in a file i think it will be much easier that way look at this thread http://game-editor.com/forum/viewtopic.php?t=1605
Why do i always get stuck?
User avatar
Novice
 
Posts: 399
Joined: Mon Aug 29, 2005 10:54 am
Location: Relative
Score: 5 Give a positive score

Postby DilloDude » Tue Feb 28, 2006 9:56 am

Ok, another problem. When you open a chest, and exit the activation region, when you return, the chest is closed again. I have tried a timer after the chest is opened to destroy the chest and create an actor that looks like an open chest. But, because it is used in a create actor function, exiting the region destroys it. I just thought maybe I could have it originally there, and use visibility state, but would it remember it was visible (or invisible) when re-entering the activationa region? I will test that...
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby DilloDude » Tue Feb 28, 2006 10:01 am

No, it goes invisible again.
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby makslane » Tue Feb 28, 2006 7:21 pm

Use a variable to control the chest (chestOpen) and use saveVars and loadVars to keep the correct state
Game Editor is an open source game creator software that's wants to pay it's developers to keep evolving.
If you like Game Editor, make a review!
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby DilloDude » Tue Feb 28, 2006 11:43 pm

The problem is, I need an actor variable, and those can't be saved.
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby DilloDude » Wed Mar 01, 2006 12:54 am

I thought of a solution to making the enemies etc. reappear when I re-enter the region: for ones you want to reappear, instead of destroying them, use visibility state and event disable. It should not remember these, and will reset them as if nothing had happened. For things you DO want to stay destroyed, you cn still destroy them.

Now, back to the chest problem...
I could have you close them again and have the orginal actors destroyed and under them have a closed animation (with the same physical response). I would use the open animation but for having the lid sticking out. But then you couldn't see if you'd opened it already, unless it had a slightly different animation (say with a tick mark over it) that took up the same space. It would be nice to have it stay open though.
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby Novice » Wed Mar 01, 2006 10:21 am

If you dont have many chests (or you do have many but its not a problem for you to do it :wink:) you can use an array that will hold the chests states. 1 for open and 0 for closed. If this is a global array you should have no problem. It would look something like
chest[1]=1
chest[2]=0
chest[3]=0
chest[4]=1
chest[5]=0
...
And you could simply save this one variable each time you exit an activation region and reload when you reenter.
Why do i always get stuck?
User avatar
Novice
 
Posts: 399
Joined: Mon Aug 29, 2005 10:54 am
Location: Relative
Score: 5 Give a positive score

Postby DilloDude » Wed Mar 01, 2006 11:02 am

But how would that go for clones? I'd need each clone to have it's own, and that gets difficult...

Or would I go
Code: Select all
chest[1]=HealthChest.0.chestOpen;
chest[2]=HealthChest.2.chestOpen;
chest[3]=BombChest.chestOpen;
chest[4]=BombItemChest.0.chestOpen;
...

:?:
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby Novice » Wed Mar 01, 2006 5:27 pm

Yeah it gets difuicult, there arent always automated ways to do something there is some footwork requierd. As for clones i really dont know, i would have to try it out but i dont have the time, sorry.
Why do i always get stuck?
User avatar
Novice
 
Posts: 399
Joined: Mon Aug 29, 2005 10:54 am
Location: Relative
Score: 5 Give a positive score

Postby DilloDude » Wed Mar 01, 2006 11:07 pm

It doesn't like having 'chest.1.chestOpen' etc. It has an error message that says Incompatible types: cannot convert from 'struct' to 'long int'.
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby DilloDude » Fri Mar 03, 2006 6:54 am

Does anyone know how I can solve this?
Because it gets really annoying if you can get 300 swords, 42 billion boomerangs, infinite money and throw ten bombs at once(you could throw more, but you can only carry ten at a time).
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby makslane » Fri Mar 03, 2006 10:48 am

To access a clone you must use the getclone function:
http://game-editor.com/docs/script_refe ... m#getclone
Game Editor is an open source game creator software that's wants to pay it's developers to keep evolving.
If you like Game Editor, make a review!
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Next

Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest