SRB2 Message Board  

Go Back   SRB2 Message Board > Sonic Robo Blast 2 > Editing > Editing Help

Reply
 
Thread Tools Search this Thread
Old 09-02-2007   #1
Joat
Gum Phoenix
 
Joat's Avatar
Default Custom Variables and conditionals

Well, this probably can’t be done without hacking into the program, but is there a way to establish custom variables and conditionals? I mean creating a variable (such as Sector1Entered), then checking it later on (an if/then conditional).
__________________
"Your friend is that man who knows all about you, and still likes you." - Elbert Hubbard
Joat is offline   Reply With Quote
Old 09-02-2007   #2
Pepe
 
Pepe's Avatar
Default

Hacking? Just edit the source.
Pepe is offline   Reply With Quote
Old 09-02-2007   #3
Joat
Gum Phoenix
 
Joat's Avatar
Default

If hacking (or editing the source, but I like to call it hacking) is the only way, how do I do that? And how do I check it later on in a map script?
__________________
"Your friend is that man who knows all about you, and still likes you." - Elbert Hubbard
Joat is offline   Reply With Quote
Old 09-02-2007   #4
Kalaron
Default

Try Dev C++ for source code editing.
Kalaron is offline   Reply With Quote
Old 09-02-2007   #5
Pepe
 
Pepe's Avatar
Default

Learn C++.
Pepe is offline   Reply With Quote
Old 09-02-2007   #6
Joat
Gum Phoenix
 
Joat's Avatar
Default

Lucky I already know Java. From there, it should be relatively easy. I mean, I’ve learned new programming languages for smaller reasons.

Then again, unless there is a way to do an if/then check activated by something on the map, it might be a waste of time.
__________________
"Your friend is that man who knows all about you, and still likes you." - Elbert Hubbard
Joat is offline   Reply With Quote
Old 09-02-2007   #7
BlueZero4
 
BlueZero4's Avatar
Default

..I think you might be looking for linedef executors. They activate when a player is inside the sector, and then execute a series of commands, all done inside the map without any extra scripting.

Need an example? Mystic Temples.
__________________
[scr_bz4pack.wad] ó I get an email whenever you PM me, if you ever want to say hi.
BlueZero4 is offline   Reply With Quote
Old 09-02-2007   #8
Joat
Gum Phoenix
 
Joat's Avatar
Default

The current linedef executors don’t really do what I want them to.

Alright, here’s what I want.

I plan on creating a game with ‘adventure fields’. All the levels in one adventure field must be completed before the player can enter the next one. However, there is no linedef for that.

Let me demonstrate what I want to do in a sort of coding form.

When the adventure field is first entered, this activates:
Code:
var level1-1 = 0 //this is turned to 1 when the first level of the adventure field is done.
var level1-2 = 0
var level1-3 = 0
I’m using something similar to Spidermonkey for this example. It should be easy to figure out. Anyway, I need another script to then be able to check those variables and do something only if all the level variables are set to 1.
__________________
"Your friend is that man who knows all about you, and still likes you." - Elbert Hubbard
Joat is offline   Reply With Quote
Old 09-02-2007   #9
Segmint
Permanently Banned
Default

Joat; http://ssntails.sepwich.com/srb2/specials.html

There are MANY linedef executors. Let's see, you could make it use buttons, execute when all of the enemies are cleared, and many MANY MANY more.

Seriously, there's no reason for you to go into C++ if you can do it easily with linedef types.
Segmint is offline   Reply With Quote
Old 09-02-2007   #10
Rob
Administrator
 
Rob's Avatar
Default

A cheap way of doing this would be to grant an emblem at the end of a level/boss. This you'd have to do by finding a way to force the character to earn the emblem. (Possibly a small level that starts them right at the emblem & end sector in one place?) Also, you'd have to set the rewards to open a new adventure field map with the new path open. Meaning copy/pasting the whole map, and applying the small difference.

Cheap, yes. Takes up space, yes. But it also works. The only way I know of. May be possible without being so totally cheap, but I haven't heard of a way.

EDIT: Segmint, Linedef Executors only last for the duration of one level. They can't set a global variable, meaning he can't make what he wants with linedef execs alone.
Rob is offline   Reply With Quote
Old 09-02-2007   #11
Segmint
Permanently Banned
Default

WELL SORRY, it's not like what he's saying is absolutely clear.
Segmint is offline   Reply With Quote
Old 09-02-2007   #12
Cue
ALAM STOP BREAKING THE S
 
Cue's Avatar
Default

Quote:
Originally Posted by Pepe
Learn C++.
SRB2 isn't written in C++, it's written in C.
__________________
Quote:
<+Jev3> btw guys, now that Cue is gone, the Master Server is going to be awesome http://tvtropes.org/pmwiki/pmwiki.ph...tistsAreBetter
Quote:
<@Mystic> That's a good idea, Cue.
Cue is offline   Reply With Quote
Old 09-02-2007   #13
Rob
Administrator
 
Rob's Avatar
Default

Quote:
Originally Posted by Segmint
WELL SORRY, it's not like what he's saying is absolutely clear.
Quote:
Originally Posted by Joat
The current linedef executors donít really do what I want them to.
...

Quote:
Originally Posted by Segmint
WELL SORRY, it's not like what he's saying is absolutely clear.
Quote:
Originally Posted by Joat
Alright, hereís what I want.

I plan on creating a game with Ďadventure fieldsí. All the levels in one adventure field must be completed before the player can enter the next one. However, there is no linedef for that.
...

Quote:
Originally Posted by Segmint
WELL SORRY, it's not like what he's saying is absolutely clear.
Quote:
Originally Posted by Joat
Let me demonstrate what I want to do in a sort of coding form.

When the adventure field is first entered, this activates:
Code:
var level1-1 = 0 //this is turned to 1 when the first level of the adventure field is done.
var level1-2 = 0
var level1-3 = 0
...

Quote:
Originally Posted by Segmint
WELL SORRY, it's not like what he's saying is absolutely clear.
Quote:
Originally Posted by Joat
Iím using something similar to Spidermonkey for this example. It should be easy to figure out. Anyway, I need another script to then be able to check those variables and do something only if all the level variables are set to 1.
It all seems rather straightforward to me. :\
Rob is offline   Reply With Quote
Old 09-02-2007   #14
Joat
Gum Phoenix
 
Joat's Avatar
Default

Dark Warrior, your idea of emblems could work, but it is also impractical in a way. First, emblems cannot be saved in a save file. If an emblem is gained in one game, it is gained in all of the play-throughs.

Besides, how would I go about making something happen depending on how many emblems the player has?

In the end, I may go about it in a similar way, but with chaos emeralds, not emblems.
__________________
"Your friend is that man who knows all about you, and still likes you." - Elbert Hubbard
Joat is offline   Reply With Quote
Old 09-02-2007   #15
Segmint
Permanently Banned
Default

=P

I mean, if he could explain what he actually wants in his freaking adventure field (like EXACTLY WHAT HE WANTS TO HAPPEN; Example: When player does a, that activates b, but please replace the variables with WHAT THE PLAYER NEEDS TO DO TO ACTUALLY CLEAR IT). If you did that, maybe I could figure out a more suitable way to do it in SRB2.
Segmint is offline   Reply With Quote
Old 09-02-2007   #16
Joat
Gum Phoenix
 
Joat's Avatar
Default

What I need is for when a player clears one of the levels in the field, it activates something. When all of those somethings in an adventure field are activated, the player can access the next adventure field.
__________________
"Your friend is that man who knows all about you, and still likes you." - Elbert Hubbard
Joat is offline   Reply With Quote
Old 09-02-2007   #17
Rob
Administrator
 
Rob's Avatar
Default

I don't believe individual chaos emeralds can trigger a global variable. Also, SOCs determine how many emblems unlock what. And, yes, emblems are saved in a save file if SRB2 is told to, also by a simple SOC variable. The specific variable escapes me, but you can find it in Mystic Realm's MAINCFG.
Rob is offline   Reply With Quote
Old 09-02-2007   #18
Segmint
Permanently Banned
Default

Quote:
Originally Posted by Joat
What I need is for when a player clears one of the levels in the field, it activates something. When all of those somethings in an adventure field are activated, the player can access the next adventure field.
Yes, but WHAT DOES THE PLAYER HAVE TO DO TO CLEAR IT? Argh. I mean, there are tons of ways a player can clear a level, but you have to explain exactly how it has to be cleared.
Segmint is offline   Reply With Quote
Old 09-02-2007   #19
Joat
Gum Phoenix
 
Joat's Avatar
Default

The condition for clearing a level is getting to the end signpost.
__________________
"Your friend is that man who knows all about you, and still likes you." - Elbert Hubbard
Joat is offline   Reply With Quote
Old 09-02-2007   #20
Rob
Administrator
 
Rob's Avatar
Default

He wants global triggers.

If a player beats a level, it adds to a global value.

When the value reaches a certain point, a new adventure field is unlocked.
Rob is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom FOF Sky Ninja Editing Help 1 03-01-2008 05:26 AM
Custom Music .hack Editing Help 13 04-09-2007 11:25 PM
Custom textures Espyo Help 1 07-01-2006 06:37 PM
character creation variables Darkon Editing 18 09-25-2004 05:14 PM
Custom DarkCity act 3. SSC Editing 8 01-26-2004 01:51 AM


All times are GMT. The time now is 02:02 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.