global variable

How can I make a character as a global variable so that I ensure that it can be spawned like if you were taking a character from one game and putting him in another? Does it go into some type of file to be established?
 
I think we have mixed up information here

First of all, characters don't need to be set in variable to be registered in OpenBoR mod. To register one, you have to declare it in models.txt , right inside data folder

This player's section from models.txt
Code:
# Players must also be loaded
load    Snake_Eyes	data/chars/snake_Eyes/Snake_Eyes.txt
load    Hawk		data/chars/hawk/hawk.txt
load    Slaughter	data/chars/slaughter/slaughter.txt
load    Clutch		data/chars/Clutch/Clutch.txt

There are more lines in models.txt but I quoted those to show you which lines for players

So if you copy a character from other mod, aside of copying his/her/its sprites and stuffs, make sure you also register him/her/it in models.txt

Second, script variable is used by a script to store value or strings to be used by other script

I could go on but I believe you only need to know the 1st one above
 
Bloodbane said:
I think we have mixed up information here

First of all, characters don't need to be set in variable to be registered in OpenBoR mod. To register one, you have to declare it in models.txt , right inside data folder

This player's section from models.txt
Code:
# Players must also be loaded
load    Snake_Eyes	data/chars/snake_Eyes/Snake_Eyes.txt
load    Hawk		data/chars/hawk/hawk.txt
load    Slaughter	data/chars/slaughter/slaughter.txt
load    Clutch		data/chars/Clutch/Clutch.txt

There are more lines in models.txt but I quoted those to show you which lines for players

So if you copy a character from other mod, aside of copying his/her/its sprites and stuffs, make sure you also register him/her/it in models.txt

Second, script variable is used by a script to store value or strings to be used by other script

I could go on but I believe you only need to know the 1st one above

I'm trying to make the player collect a letter on each level to form a word.

For example "SONIC"

Stage one you can collect the letter S
Stage two you can collect the letter  O

And if you collect all 5 letters you can get a free life.

How can I begin learning how to do this via script.

All I need is to learn the very first step which might be how to create a variable and store it via script and keep it in the memory for stage 2. Oh  and also how to remove such variable.

Thank you
 
How can I begin learning how to do this via script.

Hmmm... you can learn using Map demo I've made some time ago.
That demo has feature to unlock new level in world map after completing a level. Global variable is used to do the unlocking :).

Once you understand how global variable works, moving to your request should be easy  8)

Oh  and also how to remove such variable.

Usually it's done by setting empty value to those variables.
The major question is when those variables be emptied. For your request, there are 2 events
1. After all 5 letters are collected
This should be done in didhitscript
2. In main menu
This should be done in update.c
 
Bloodbane said:
How can I begin learning how to do this via script.

Hmmm... you can learn using Map demo I've made some time ago.
That demo has feature to unlock new level in world map after completing a level. Global variable is used to do the unlocking :).

Once you understand how global variable works, moving to your request should be easy  8)

Oh  and also how to remove such variable.

Usually it's done by setting empty value to those variables.
The major question is when those variables be emptied. For your request, there are 2 events
1. After all 5 letters are collected
This should be done in didhitscript
2. In main menu
This should be done in update.c

This is so awesome,  thank you Bloodbane !!!
I will see how far I get this weekend whenever I get to download that Map demo. I'm super excited.
 
Back
Top Bottom