- Joined
- Sep 26, 2009
- Messages
- 9,534
No, add it in "AddSpacebarAction"
function AddSpacebarAction takes code a returns triggercondition
return TriggerAddCondition(Space_Actions, Condition(a))
return null
endfunction
[…]
pJass is such a n00b.
[…]
pJass sucks :/
Filter
/Condition
usage.void checkParameters(const struct paramlist *func, const struct paramlist *inp, const int mustretbool)
{
const struct typeandname *fi = func->head;
const struct typeandname *pi = inp->head;
int pnum = 1;
for (;;) {
if (fi == NULL && pi == NULL)
return;
if (fi == NULL && pi != NULL) {
yyerrorex(3, "Too many arguments passed to function");
return;
}
if (fi != NULL && pi == NULL) {
yyerrorex(3, "Not enough arguments passed to function");
return;
}
canconvert(pi->ty, fi->ty, 0);
if (mustretbool && pi->ty == gCodeReturnsNoBoolean) {
yyerrorex(3, "Functions passed to Filter or Condition must return a boolean");
return;
}
pi = pi->next;
fi = fi->next;
}
}
void checkParameters(const struct paramlist *func, const struct paramlist *inp, const int mustretbool)
{
const struct typeandname *fi = func->head;
const struct typeandname *pi = inp->head;
int pnum = 1;
for (;;) {
if (fi == NULL && pi == NULL)
return;
if (fi == NULL && pi != NULL) {
yyerrorex(3, "Too many arguments passed to function");
return;
}
if (fi != NULL && pi == NULL) {
yyerrorex(3, "Not enough arguments passed to function");
return;
}
canconvert(pi->ty, fi->ty, 0);
/*if (mustretbool && pi->ty == gCodeReturnsNoBoolean) {
yyerrorex(3, "Functions passed to Filter or Condition must return a boolean");
return;
}*/
pi = pi->next;
fi = fi->next;
}
}
As far as i can tell, you have to change one (!) function.
And don't get me started about using functions in a way they weren't intended for…
globals
private integer Local_I //= GetPlayerId(GetLocalPlayer())
private string Local_S //= I2S(Local_I)
private real array Space_X
private real array Space_Y
private real Sync_X
private real Sync_Y
private boolean Not_Sync = true
private gamecache Cache
private timer Space_Timer = CreateTimer()
private player Space_Player
private trigger Space_Actions = CreateTrigger()
endglobals
Space_Player, Sync_X and Sync_Y should be initialized to null, 0 and 0 respectively.
Also, if it's possible, could we have the timer period configurable?
(To give beginners the ability to easily modify the system without having to go through all the code and messing something up.)
This is actually very well written. (I don't care if you repeated I2S(i) twice in the loop.)
That 'return null' line allows this to compile with Vexorian's JassHelper![]()
That's because camera positions only get updated once every 0.0x seconds (don't know the exact interval, but I think its somewhere around 0.1) in multiplayer (In singleplayer, it should happen more often).Hey there,
I recently started using this snippet, however it's not working great for my purposes. I was wondering if I just have to deal with that or if there's a way around it. Because I'm making a 2dimensional interface menu that's being controlled with the arrow keys. When I select a button in it I have to press the space bar.
However... Since I have to lock my camera (or move it to the position on the map once every ~0.03 sec) it doesn't work anymore.
Locking the camera completely made tracking the space button impossible while moving camera every 0.03sec triggered the action like once every 20 presses.
So once again. Should I just forget using the spacebar with this purpose? Or is there something I could change to make it work for me?
Hey there,
I recently started using this snippet, however it's not working great for my purposes. I was wondering if I just have to deal with that or if there's a way around it. Because I'm making a 2dimensional interface menu that's being controlled with the arrow keys. When I select a button in it I have to press the space bar.
However... Since I have to lock my camera (or move it to the position on the map once every ~0.03 sec) it doesn't work anymore.
Locking the camera completely made tracking the space button impossible while moving camera every 0.03sec triggered the action like once every 20 presses.
So once again. Should I just forget using the spacebar with this purpose? Or is there something I could change to make it work for me?
You can make this multiplayer y'kno
http://www.hiveworkshop.com/forums/spells-569/network-v2-0-0-0-a-226065/?prev=mmr=6
It does work... lol