You are not logged in.
Pages: 1
(needs 0.2.0, bleeding edge 373 or greater)
I wanted to try out some of the new commands of the scripting engine, so I came out with this.
Download: http://upload.surgeswarehouse.com/uploa … leader.zip
// ------------------------------------------------------------
// Follow the Leader
// This object needs Open Surge 0.2.0 revision 373 or greater
// http://opensnc.sourceforge.net
// ------------------------------------------------------------
> 1 Changelog
Version 1.0 by Alexandre (2010-12-22): initial release
If you're able to improve this object, please share
you improvements with the community!
http://opensnc.sourceforge.net/forum
> 2 Description
This object makes the non-active characters follow the leader. The AI is a simple
finite state machine. This is an interesting object for wide-open levels, but
it may not be appropriate for levels with too many obstacles (unless someone
makes this AI more accurate ;-)
> 3 How to use it
Spawn an ***UNIQUE*** instance of ".Follow_The_Leader" in your level. An easy way to do
this is to add .Follow_The_Leader to the startup list. Open your .lev file with a text
editor and locate a line starting with startup. Replace it by:
startup ".default_startup" ".Follow_The_Leader"
If no such line exists, please add it.
> 4 Advanced scripting
If you wish to disable the Follow the Leader mode during your level, you must
destroy the object. To do it, make some object run the following command:
change_closest_object_state ".Follow_The_Leader" "destroy"
Needlessly to say, you can enable/disable the Follow the Leader mode whenever you
want via scripting.
> 5 How does it work
We make an assumption: there is always three characters in your level: Surge,
Neon and Charge.
.Follow_The_Player spawns three other objects: a master and two slaves. The master
will get attached to the leading character and will share important data like
the position of the active player via global variables. On the other hand, the
two slaves will get attached to the other two characters and will perform some logic
in order to make it follow the leading character.
Offline
Offline
RPG style i like it
https://discord.gg/w8JqM7m ---> Open Surge's Discord server
Offline
o.o
I like this.
But... I don't like how the other characters get hurt spontaneously and lose every ring. Can we just say something like 'half their rings get lost' or something?
Offline
Can we just say something like 'half their rings get lost' or something?
No. At least, not via the approach we're using: controlling the players with simulate_button_down.
edit: hmm, wait.
1) store the current amount of rings
2) on_player_hit => jump to state recovery
3) state recovery => set rings to the half of the previous amount
...though a lot of rings would still be created
Last edited by Alexandre (2010-12-23 16:21:46)
Offline
Very Coll!
Sonic Heores style!!
Creating and Editing Sprites.
Offline
SWEET! Oh, I wish I had the time to learn the engine inside and out (and the time for so many things, in fact)... patience is a virtue, and a really portable computer is a godsend due soon!
This opens up so many doors...
Offline
Can you copy-paste the code and put it in a post?
I'm making a game about a blue cartoon rat. I must have made some terrible life choices.
Offline
This post is very old now. At this point, it's better to recreate it in SurgeScript.
Offline
I have found this script among old files. I'm reuploading it for historical purposes.
This is from 2010 - long before SurgeScript came into being - and no longer works with new versions of Open Surge. It's still useful as inspiration. Experiment it with early builds of Open Surge 0.2.0.
Offline
Pages: 1