Page 1 of 1

Mod Help - Getting a Compass's code

PostPosted: 28 Aug 2011, 23:27
by ZeroKnight
First, some background. My Extended Compass mod will have a GUI editor that will allow Compass creation via GUI. I can do this fine with the current GUI creation and alias creating, but the problem is they wont be saved, as aliases are not remembered between sessions, which would mean the user would have to re-make the compass every launch, which is obviously not acceptable. I decided that the GUI aspect would be a separate download, as I've concluded it will require a source modification.

What it will entail is a new function, "writeECdata()", which will get the code that makes up a compass, and write it to a file (ecdata.cfg), which will be loaded on startup like config.cfg and autoexec.cfg. However, I'm unaware of how to GET the code that makes up a compass. (For the following examples, the compass's name is "Talk") I've tried a few tricks like "echo (getalias Talk)", and "echo Talk", but they only return blank lines. I think it's because it's trying to return the compass itself, and not it's code, which is why it's only returning a blank line.
Is there a way, be it CubeScript or inside the game code to get the value of a Compass? For clarification, I need the code that makes the compass, ie:
{l Code}: {l Select All Code}
newcompass Talk "textures/voices" [
    compass "Thanks!"               [say "^fgThanks!"]
    compass "Hello!"                [say "^fgHello! :D"]
    compass "Balance Teams!"        [say "^fyPress F7 ^fcto Balance the Teams! ^frAUTOBALANCE IS BROKEN!"]
    compass "Switched for Balance"  [me "^fvhas switched to balance teams"]
]


Help greatly appreciated.

Re: Mod Help - Getting a Compass's code

PostPosted: 28 Aug 2011, 23:49
by qreeves
ZeroKnight {l Wrote}:Is there a way, be it CubeScript or inside the game code to get the value of a Compass? For clarification, I need the code that makes the compass

Not currently, but I can add it. If you create an alias in a config and want it to persist use: alias blah [echo booooo]; setpersist blah on

Re: Mod Help - Getting a Compass's code

PostPosted: 29 Aug 2011, 01:06
by ZeroKnight
On Supernova, setpersist is an unknown command, so I assumed it was in one of the newer svn builds, however r2779 doesn't compile, and I don't know what the last working revision was.
Also, what exactly does setpersist do? Does it make an entry in config.cfg?

Re: Mod Help - Getting a Compass's code

PostPosted: 29 Aug 2011, 02:01
by qreeves
I might have it wrong, will check when I get home.

Re: Mod Help - Getting a Compass's code

PostPosted: 31 Aug 2011, 04:24
by srbs
@ZeroKnight
I have a 100% cubescript solution for you, I'm going to wait for qreeves' response before I tell you.

Re: Mod Help - Getting a Compass's code

PostPosted: 31 Aug 2011, 21:57
by ZeroKnight
srbs {l Wrote}:@ZeroKnight
I have a 100% cubescript solution for you, I'm going to wait for qreeves' response before I tell you.


If you can have a solution that'll do what I need it to do that's pure Cubescript, then you're my hero.

Re: Mod Help - Getting a Compass's code

PostPosted: 01 Sep 2011, 02:26
by qreeves
Yeah, I'm tripping. setpersist doesn't exist.

Re: Mod Help - Getting a Compass's code

PostPosted: 01 Sep 2011, 03:25
by fluxord
qreeves {l Wrote}:Yeah, I'm tripping. setpersist doesn't exist.

<offtopic>
Image
</offtopic>
Topic Related:
Is there any variable/command to get the following stuff with Cubescript:
- enemy "cn" or name that killed the player.
- weapon number or name that the enemy/player has used to kill the player/enemy.
- weapon number or name that the player/enemy has used when dying.

I ask this because I had an idea to write an "autotaunt" script that should work similarly
to the taunt system used by Quake 3 (and its mods); i.e. if you killed the AI,
and if it was using the shotgun when dying it would say something like:
"PLAYERNAME, the next time you and my shotgun will have a little conversation."

It would be nice to have such a script to autotaunt enemies in online multiplayer matches.
But I couldn't find a way in Cubescript to get those values.

Re: Mod Help - Getting a Compass's code

PostPosted: 02 Sep 2011, 02:38
by Architect
this was an idea i had right after compass was implemented,
quin decided it would be better not to have it,
i agreed

Re: Mod Help - Getting a Compass's code

PostPosted: 02 Sep 2011, 02:43
by ZeroKnight
I find auto-taunts annoying.
Also, srbs, could you please post what you mentioned earlier?

Re: Mod Help - Getting a Compass's code

PostPosted: 02 Sep 2011, 05:23
by srbs
fluxord {l Wrote}:Is there any variable/command to get the following stuff with Cubescript:
- enemy "cn" or name that killed the player.
- weapon number or name that the enemy/player has used to kill the player/enemy.
- weapon number or name that the player/enemy has used when dying.

At the moment, no.

ZeroKnight {l Wrote}:I find auto-taunts annoying.

me too

ZeroKnight {l Wrote}:Also, srbs, could you please post what you mentioned earlier?

Well... after actually investgating I found that RE doesn't save it's state on exit.. of which I am baffled by. @quin: What gives?
And since setpersist disappeared, (I though it was there at some point) there is no way to do this. Except with file i/o, but that script of mine from sauer is untested in RE and will most likely not be released anytime soon.

sorry,
srbs

Re: Mod Help - Getting a Compass's code

PostPosted: 02 Sep 2011, 05:41
by ZeroKnight
Hm. That's okay, srbs. I thank you anyway though :)
I guess I'll have to figure something out then. My original plan was to use writecfg() as a template to make writeECdata(), so I've just gotta figure out exactly how to make the function :P
Though I still have to figure out how I'm going to pull compass data. Unless quin follows through and adds that ability in one of the revisions. Are you still planning on that, quin? If so, when?

Re: Mod Help - Getting a Compass's code

PostPosted: 02 Sep 2011, 07:39
by fluxord
Architect {l Wrote}:this was an idea i had right after compass was implemented,
quin decided it would be better not to have it,
i agreed

srbs {l Wrote}:
ZeroKnight {l Wrote}:I find auto-taunts annoying.

me too

Image

IMHO, a configurable autotaunt option would be better than chosing them from a compass :p
I'm thinking of something like:
- taunt after every XX frag.
- taunt after every XX flag/bomb score.
- taunt after every XX death.
- it lets the player customize/add taunts for them (frag, scores, death).
Let the minimum for XX be 3?

Re: Mod Help - Getting a Compass's code

PostPosted: 02 Sep 2011, 11:49
by qreeves
LOL

Re: Mod Help - Getting a Compass's code

PostPosted: 02 Sep 2011, 17:24
by Stiva
I contend that bots' stoic silence is a core component of the Red Eclipse experience.

Re: Mod Help - Getting a Compass's code

PostPosted: 02 Sep 2011, 19:35
by ZeroKnight
Stiva {l Wrote}:I contend that bots' stoic silence is a core component of the Red Eclipse experience.

I lol'd. +1

Re: Mod Help - Getting a Compass's code

PostPosted: 03 Sep 2011, 04:59
by qreeves
ZeroKnight {l Wrote}:
Stiva {l Wrote}:I contend that bots' stoic silence is a core component of the Red Eclipse experience.

I lol'd. +1

Good, because it is my firm belief that they are there for fodder only. The real action is with humans, and I didn't want them pretending to be something they're not. Same goes with the generic "bot [X]" names :p