Serious Sam's Bogus Detour

Serious Sam's Bogus Detour

Workshop
Create, share and play!
Learn More
Corlin 31 Jan, 2018 @ 2:13pm
Is it possible to extract data out from the game via scripts?
Is it possible to extract a value from a script, out from the game? For example, writing to a file? I am aware of the condump console command that dumps the console, which would be a possible way for me to reach my values. But is it possible to write to the console via scripts?

I am asking because I am writing an AI to play SSBD and I need to reward it for the different actions it takes. So i need to feed it values (in the form of points for killing monsters)
< >
Showing 1-3 of 3 comments
Melissa  [developer] 2 1 Feb, 2018 @ 4:25am 
This is amitious, and I'd love to follow your progress on this! :D:

So, if you're fine with reading from stdout (console), you can just use the print() function in scripts. This also writes to SSBD.exe.log (which is something you should be careful with, because that file could end up being huge).

There's no real APIs that ley you write to any file or socket explicitly, as that would kind of be a security issue with the Workshop, so the logfile is the closest you can get there.

Another idea is to render pixels to the HUD that you can read back, but that's kind of a hacky way around it.
Corlin 1 Feb, 2018 @ 1:26pm 
Sure will keep you guys updated :) And awesome, that solution with the file and condump will be what we will be using.

Reading up on your scripting documentation I find it really hard to create custom triggers to do very simple stuff. For example, if want a trigger to listen for the event "UnitEventType::Damaged" And then tell me the damage value, how do I set it to always listen to the player actor? And how do I access the actual damage values? Also is it possible to store some "global" variable between world scripts?

I must say you got a nice thing going on here and it seems very powerful, but there is very little documentation and it frustrating to not be able to autocomplete :p
Melissa  [developer] 2 2 Feb, 2018 @ 1:42am 
Take a look at rewriting classes: http://ssbd.a000ff.com/wiki/Rewriting_Classes

So, if you're running the campaign in a custom scenario, you need to make a class that inherits from Player, and then use the class rewrites to add custom behaviors to it.

My suggestion is to override the Damage method:
int Damage(DamageInfo dmg, vec2 pos, vec2 dir) override { int dmgAmnt = Player::Damage(dmg, pos, dir); print("Player got damaged for: " + dmgAmnt); }

Not entirely sure if this works, because the Angelscript version used in Bogus Detour is a little old[www.gamedev.net]...
< >
Showing 1-3 of 3 comments
Per page: 1530 50