Presenting you -The Shopplander- (help needed with details please)

43 replies [Last post]
eldiablo
eldiablo's picture
User offline. Last seen 2 years 9 weeks ago. Offline
Joined: 2014-06-01
Posts: 53

Ohoi! Its time for a new mode! And since both highlander and shoppa are the most played modes in Hedgewars right now - I’m about to bring you -The Shopplander-

Hi guys Me Mljung and cyfox have been working on a new scheme called Shopplander, cause shoppa and highlander are the most playable games and we would love to se a combo of those 2 schemes. But we have some things that we cant solve and we need help from developers or anybody that knows how to solve our problem.

Well we need help with modifying the highlander scheme, we need to set 2 crates to land every round but there is no that option in the scheme, if someone could modify the scheme file or something to do that.
And we need to set players that have previously collected weapons or kill for it to cant use it untill they pick up a new crate, then they unlock weapons an have all previuos and the new one collected.

I think that 40 or 35 sec should be fine for a round time cause u need to pick a crate and then u need to look what u have an combine.

Like in shoppa u have nothing untill u pick a crate, but like in highlander u have all previous weapons but when u pick up a crate.

Well if the thing with the weapons after picking a crate is not possible now only crates would be enough.

Srry about crappy english im Croatian Big Grin

Thanks in advance...

nema sreće ako se ne meće Hellish Hand Grenade

nemo
nemo's picture
User offline. Last seen 3 weeks 1 day ago. Offline
Joined: 2009-01-28
Posts: 1861

Nothing here sounds too difficult to implement, not that I'm volunteering.

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

eldiablo
eldiablo's picture
User offline. Last seen 2 years 9 weeks ago. Offline
Joined: 2014-06-01
Posts: 53

hehe well it would be really nice of you nemo if you would be so kind to do that or explain how? or if there is someone else? thanx anyway

nema sreće ako se ne meće Hellish Hand Grenade

nemo
nemo's picture
User offline. Last seen 3 weeks 1 day ago. Offline
Joined: 2009-01-28
Posts: 1861

Well, is pretty much just weaponset manipulation like highlander does already, with addition of a crate spawn, which exists in the API too.

Mikade could do it easy if it interested him I'm sure.

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

eldiablo
eldiablo's picture
User offline. Last seen 2 years 9 weeks ago. Offline
Joined: 2014-06-01
Posts: 53

its like ur talking in chinese to me Big Grin well we will just have to wait for mikade or someone else.

To get it right, 2 crates in round, and not be able to use weapons from previous rounds untill u pick up a crate an then unlock them all that u have colected in previous rounds.
Everything else can be modified in game.

tnx again nemo

nema sreće ako se ne meće Hellish Hand Grenade

mikade
mikade's picture
User offline. Last seen 15 weeks 22 hours ago. Offline
Joined: 2010-10-22
Posts: 355

Didn't someone already make a script like this? I seem to recall there was some kind of ShoppaHighlander mode hosted on http://hh.unit22.org/.

I don't really understand the mode you are describing. Would the hogs still start with a random weapon / utility combo like in highlander? Do they keep the weapons forever once they have picked up a crate?

Anyway, the entry in the API nemo is talking about can be found at:
https://code.google.com/p/hedgewars/wiki/LuaAPI#SpawnAmmoCrate_%28x,_y,_ammoType%29

Presumably you could use SetAmmoDelay (see: https://code.google.com/p/hedgewars/source/browse/hedgewars/uScript.pas) to make previously collected weapons unavailable.

Good luck.

mikade
Hedgewars Developer

eldiablo
eldiablo's picture
User offline. Last seen 2 years 9 weeks ago. Offline
Joined: 2014-06-01
Posts: 53

hogs would start with rope only and yes they keep forever the weapons they have collected before and the one collected to unlock the weapons. and ofcourse using of weapons doesnt end your turn.

Well that before mode isnt like this one i think that this one will be very popular couse i think thats a perfect mix of those two.

And i think that one crate is enough, two is to much they would be in some point of the game to much crates maybe.
If you would be kind to make that script for me i would be eternaly gratefull to you Smile to me its complicated but for you its like everyday stuff.

thanx

nema sreće ako se ne meće Hellish Hand Grenade

mikade
mikade's picture
User offline. Last seen 15 weeks 22 hours ago. Offline
Joined: 2010-10-22
Posts: 355

Ehhhhh. Sorry to be a downer, but to be honest I really dislike Highlander and would rather spend my free time working on Construction Mode / TechRacer, right now. Sad Smiley

But, perhaps you could solicit the original ShoppaHighlander script-writer to make this for you? Presumably they would be interested in such a project.

mikade
Hedgewars Developer

sheepluva
sheepluva's picture
User offline. Last seen 10 hours 5 min ago. Offline
Joined: 2009-07-18
Posts: 563

Not sure if there was a ShoppaHighlander before, I think we might be actually thinking about the script "Balanced Random Weapon roping".

Which added roping, but not to highlander ^^

  sheepluva <- me  my code stats -> 
a Hedgewars Developer


   <- where I'm from  what I speak -> 

eldiablo
eldiablo's picture
User offline. Last seen 2 years 9 weeks ago. Offline
Joined: 2014-06-01
Posts: 53

well il try to compile it myself, and i will update u on results, and i hope that u will help if i come up to some larger problems.

thanks

nema sreće ako se ne meće Hellish Hand Grenade

eldiablo
eldiablo's picture
User offline. Last seen 2 years 9 weeks ago. Offline
Joined: 2014-06-01
Posts: 53

hi again, well i modified the highlander script and i was able to set hogs to start with infinite rope, kamikaze, skip and random weapon. And i excluded some of weapons and all utilities except skip and rope. Everything works fine i tested it.

But i cant set ammo crates to work as i want, i tried a lot of combinations and always i get a lot of crates in the first round, and later none. i manage to set it so that random weapons come in crates but they all come at once and later nothing.

nema sreće ako se ne meće Hellish Hand Grenade

mikade
mikade's picture
User offline. Last seen 15 weeks 22 hours ago. Offline
Joined: 2010-10-22
Posts: 355

Someone can correct me if I'm wrong, but I think natural crates will only spawn if there are less than five or so crates on the map already. Pick up the crates and presumably more will spawn.

mikade
Hedgewars Developer

nemo
nemo's picture
User offline. Last seen 3 weeks 1 day ago. Offline
Joined: 2009-01-28
Posts: 1861

True. That restriction doesn't apply if lua spawned, of course.

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

eldiablo
eldiablo's picture
User offline. Last seen 2 years 9 weeks ago. Offline
Joined: 2014-06-01
Posts: 53

not true, when i pick up all crates or one or whatever thats it, they spawn no more.

i added it like this

function StartingSetUp(gear)

for i = 1, #wepArray do
setGearValue(gear,wepArray[i],0)
end

setGearValue(gear,amKamikaze,100)
setGearValue(gear,amSkip,100)
setGearValue(gear,amRope,100)

i = 1 + GetRandom(#atkArray)
setGearValue(gear,atkArray[i],1)

SpawnAmmoCrate(0, 0, atkArray[i],1)

Maybe there is another gear in conflict with crates, cause in highlander u get health crates every round i think, maybe i didnt exclude something? and how do i set that only one random crate land?

i tried adding in - OnGameInit()

CaseFreq = 0 till 9
------------------------------------------------------
and i tried ading in - StartingSetUp(gear)

SettAmmo (lots combos)
AddAmmo (lots combos)

No changes

as i read in LuaAPI for settammo and addammo it sais:

Note: The effectiveness of this function may be limited due to problems with gfPerHogAmmo in lua scripting.

what to do guys?

nema sreće ako se ne meće Hellish Hand Grenade

nemo
nemo's picture
User offline. Last seen 3 weeks 1 day ago. Offline
Joined: 2009-01-28
Posts: 1861

From reading what you just posted, sounds like you're calling:
SpawnAmmoCrate(0, 0, atkArray[i],1)

only at the start of the game, instead of onNewTurn

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

eldiablo
eldiablo's picture
User offline. Last seen 2 years 9 weeks ago. Offline
Joined: 2014-06-01
Posts: 53

nemo allegedly wrote:

From reading what you just posted, sounds like you're calling:
SpawnAmmoCrate(0, 0, atkArray[i],1)

only at the start of the game, instead of onNewTurn


yea man thanx, how did i miss that :O now it works just fine except that the crate landes and the player starts at the same time. so in bigger maps it will not switch camera on player like the case is in "contact shoppa" any solution to that?

Now il try the weapon delay to set it to be after crate pickup , and il update u. tnx again

nema sreće ako se ne meće Hellish Hand Grenade

nemo
nemo's picture
User offline. Last seen 3 weeks 1 day ago. Offline
Joined: 2009-01-28
Posts: 1861

Well, the reason normally crates spawn before players is 'cause the game spawns them at the end of a turn, not at the beginning.
Unfortunately for you there is no "end of turn" hook. If, however, you always are spawning another crate already in the game engine, you could add a hook in onNewGear where if the gear is a crate, you know you are in end of turn spawn, and you can spawn a second crate.
To avoid recursion, just put a flag in there to only do that once per turn.
Then reset the flag next turn.

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

eldiablo
eldiablo's picture
User offline. Last seen 2 years 9 weeks ago. Offline
Joined: 2014-06-01
Posts: 53

onNewGear? or onNewTurn? cant find anything on onNewgear on LuaAPI site. if its onNewTurn should i make it like

local gear = AddGear(0, 0, SpawnAmmoCrate, 0, 0, 0, 0) or?

this is a little complicated for me, and so is weapon delay after crate pickup. im looking at that script, dont now where to start reading.

nema sreće ako se ne meće Hellish Hand Grenade

nemo
nemo's picture
User offline. Last seen 3 weeks 1 day ago. Offline
Joined: 2009-01-28
Posts: 1861

Er onGearAdd, sorry

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

mikade
mikade's picture
User offline. Last seen 15 weeks 22 hours ago. Offline
Joined: 2010-10-22
Posts: 355

I think nemo means something like:

function onNewTurn()
crateSpawned = false
--FollowGear(CurrentHedgehog)
end

function onGearAdd(gear)

if (GetGearType(gear) == gtCase) and (crateSpawned == false) then
crateSpawned = true
SpawnAmmoCrate(0, 0, atkArray[GetRandom(#atkArray)],1)
end

end

You might have to +1 to #atkArray. Try it and see, I guess.

mikade
Hedgewars Developer

eldiablo
eldiablo's picture
User offline. Last seen 2 years 9 weeks ago. Offline
Joined: 2014-06-01
Posts: 53

noup is still the same just now are 2 crates landing and it still focus on them. something has to be made that the focus on a hog is after crate spawned, an crate is spawned when time starts, thats probably what nemo was talking about that he should be at end of round.

Here is the lua fila i made without your previous functions. so if u could look it up, maybe the problem is somewhere else.

tnx

https://www.sendspace.com/file/8pp8u1

click on the page:

Click here to start download from sendspace

nema sreće ako se ne meće Hellish Hand Grenade

nemo
nemo's picture
User offline. Last seen 3 weeks 1 day ago. Offline
Joined: 2009-01-28
Posts: 1861

Did you use the code mikade recommended? (Your file link is one I can't access from here. Maybe you should consider using a pastebin, like http://pastebin.ubuntu.com or http://pastebin.ca )

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

eldiablo
eldiablo's picture
User offline. Last seen 2 years 9 weeks ago. Offline
Joined: 2014-06-01
Posts: 53

tnx for the tip here it is

http://pastebin.ca/2833894

nema sreće ako se ne meće Hellish Hand Grenade

nemo
nemo's picture
User offline. Last seen 3 weeks 1 day ago. Offline
Joined: 2009-01-28
Posts: 1861

Ok, you didn't use mikade's code..

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

eldiablo
eldiablo's picture
User offline. Last seen 2 years 9 weeks ago. Offline
Joined: 2014-06-01
Posts: 53

yes i did but thats a script from before i tried mikades code, i keep a extra copy always if i mess up something to bring me back one step, i was trying alot stuff theese days.

nema sreće ako se ne meće Hellish Hand Grenade

nemo
nemo's picture
User offline. Last seen 3 weeks 1 day ago. Offline
Joined: 2009-01-28
Posts: 1861

Alright, well. Does what you have now work or not? If it does, great.
If it doesn't, post what you have.

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

eldiablo
eldiablo's picture
User offline. Last seen 2 years 9 weeks ago. Offline
Joined: 2014-06-01
Posts: 53

well, i got the rope, kami, skip and random weapon to start with, i set up weapon crates, 1 fals every turn, disabled the health crates, and highlander mode stayed i mean weapon takeover after kill.

the problem is with the crates because they fall when round time starts and take away focus from starting hog. I tried mikades sugestion but it didnt worked, so i gave you a copy of previous work before mikades code.

And weapon delay after crate pickup. start would be only with utilities rope and skip.

nema sreće ako se ne meće Hellish Hand Grenade

nemo
nemo's picture
User offline. Last seen 3 weeks 1 day ago. Offline
Joined: 2009-01-28
Posts: 1861

... please share your copy based on mikade's suggestion so we can see what problems there might be.
The reason for your issue was diagnosed above. At this point, just need to ensure it is implemented...

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

eldiablo
eldiablo's picture
User offline. Last seen 2 years 9 weeks ago. Offline
Joined: 2014-06-01
Posts: 53

http://pastebin.ca/2834326

thats with mikades code, now i got health crate and two weapon crates landing on turn. i need to disable health crates and set one crate to land, like it was before mikades code.

nema sreće ako se ne meće Hellish Hand Grenade

mikade
mikade's picture
User offline. Last seen 15 weeks 22 hours ago. Offline
Joined: 2010-10-22
Posts: 355

... how many crates do you want, anyway? I thought you wanted two. If you only want one, why don't you just let engine spawn a crate naturally without scripting it?

You probably want to set HealthCaseProb = 0, not 100 as it is currently set, if you don't want health crates.

I also included a commented out FollowGear if you want to force focus on the new turn, though I don't even think that would be necessary if you followed nemo's initial suggestion, hence why I left it commented out.

mikade
Hedgewars Developer

eldiablo
eldiablo's picture
User offline. Last seen 2 years 9 weeks ago. Offline
Joined: 2014-06-01
Posts: 53

One crate is enous as i explained before 2 is to much cause tey would be to much crates in some point of game. HealthCaseProb = 0 works no health crate now

well they are only one crate without health one, it just that 2 crates and health crate apeared after using your code.

well i would love to listen to his advice but i cant make that by myself, no idea how.

nema sreće ako se ne meće Hellish Hand Grenade

nemo
nemo's picture
User offline. Last seen 3 weeks 1 day ago. Offline
Joined: 2009-01-28
Posts: 1861

If you only need one crate, you don't have to do anything. Just let the game spawn crates normally based on what you or the weaponset set the probabilities to.

Well, I guess there's that issue of what happens once there are 5 crates on the map, since you apparently want that to keep going upwards… ?

Hum. If that's the case, you would have to spawn it yourself, and... given the lack of end-of-turn hook, all I can think of is checking TurnTime = 0 in onGameTick plus a flag to only spawn one, reset each turn.

Maybe we should allow users/scripts to define max crates on a map. Also possibly set the default limit to be relative to map dimensions or something.

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

eldiablo
eldiablo's picture
User offline. Last seen 2 years 9 weeks ago. Offline
Joined: 2014-06-01
Posts: 53

this is a highlander script modification so it doesnt have weapon crates only health. and i set up weapons crates like u told me on a new turn, thats fine now its just now 2 crates are spawning becaouse of mikades code but thats easy to configure thats not a real problem now.

If they are god players there will be no time for crates to pile up. cause u now how fast is the shoppa game i mean with rope. so crate per round is enough. no need for setting up max crates on map i think, if it will be one crate per round.

its just the camera focus stuff if there is a way to do that i cant do it myself and i tried mikades code is not working, so if u guys can try to make something. the best way is for u guys to try the script in game and u will se what am i talking about.

2 things are neded to be fixed

camera focus on hog, or somehow to land the crate before the turn time starts

and

weapon delay to be after crate pickup

thats it everithing else i now how to setup only thats a little complicated

thanx

nema sreće ako se ne meće Hellish Hand Grenade

eldiablo
eldiablo's picture
User offline. Last seen 2 years 9 weeks ago. Offline
Joined: 2014-06-01
Posts: 53

hey guys me again Big Grin well i am almost done with this script i only miss one thing and sence i am a lua noob i need your help.. i just need to set that u can add ur own weapons scheme now its locked and sometimes it gets unlocked but when u set ur own weapons scheme it doesnt change anything..

i made 2 scripts

Shopplander - http://pastebin.ca/2972931

ShopplanderV2 - http://pastebin.ca/2972934

they are basicly the same its just that the shopplanderV2 is combined with ShoppaMap script so it generates shoppa maps and i removed blocking utilities like girder landgun and rubber..

thanx in advance

nema sreće ako se ne meće Hellish Hand Grenade

nemo
nemo's picture
User offline. Last seen 3 weeks 1 day ago. Offline
Joined: 2009-01-28
Posts: 1861

eldiablo, that's a totally arbitrary frontend thing. Just add a .cfg with scheme and weapons defined.
In next version, tweaked it a bit so that selecting a script where the cfg specifies a scheme and weps that don't exist does not change scheme/weps to default.
So, I'd suggest putting:
*
*

In your cfg and that'll work nicely in future too. But if this is for shoppa/highlander only, no harm in defaulting to
Shoppa
Shoppa
or
Highlander
Highlander

I suppose...

People can always change it.

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

eldiablo
eldiablo's picture
User offline. Last seen 2 years 9 weeks ago. Offline
Joined: 2014-06-01
Posts: 53

well i tried all of the above stuff in the cfg file but it still uses the weapons from the script all of them

maybe here is the problem at the end of the script there is this line


function onAmmoStoreInit()
-- no, you can't set your own ammo scheme
end

to be honest i dont have no idea about lua i just use logic and copy paste parts of scripts and try it a lot Shocking

nema sreće ako se ne meće Hellish Hand Grenade

nemo
nemo's picture
User offline. Last seen 3 weeks 1 day ago. Offline
Joined: 2009-01-28
Posts: 1861

You're using the old highlander.
Use the new one.

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

eldiablo
eldiablo's picture
User offline. Last seen 2 years 9 weeks ago. Offline
Joined: 2014-06-01
Posts: 53

i dont get it "old highlander" u mean that mine script is based ona a highlander from previous version? so i am to use the script from this one?

nema sreće ako se ne meće Hellish Hand Grenade

eldiablo
eldiablo's picture
User offline. Last seen 2 years 9 weeks ago. Offline
Joined: 2014-06-01
Posts: 53

yep that was the problem thank you nemo Smile

and i set the cfg to

Shoppa
Highlander

think its the best like that

nema sreće ako se ne meće Hellish Hand Grenade

cri.thegrinch
User offline. Last seen 8 weeks 5 days ago. Offline
Joined: 2013-06-05
Posts: 84

well.. we have to thank Solar who made the first ShoppaHighlander script, the one on http://hh.unit22.org/ is not working but some players like me had a working one.. And great job eldiablo for the updates u did.. =) i think u should add the 2 scripts on unit22, maybe that could make more players start to shoppa in some way.

I Hate Christmas timeeee.. Santa! is dead!

nemo
nemo's picture
User offline. Last seen 3 weeks 1 day ago. Offline
Joined: 2009-01-28
Posts: 1861

Hm. Seems to me you could play a shoppa-like highlander on current highlander script by setting ropes to infinite in weapon scheme no?

Maybe choose some weaker weps too to compensate.

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

eldiablo
eldiablo's picture
User offline. Last seen 2 years 9 weeks ago. Offline
Joined: 2014-06-01
Posts: 53

no you cant we allready tried, you just get 1 rope per round

nema sreće ako se ne meće Hellish Hand Grenade

nemo
nemo's picture
User offline. Last seen 3 weeks 1 day ago. Offline
Joined: 2009-01-28
Posts: 1861

Oh. right. Heh. I forgot shoppa players need more than one.

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

eldiablo
eldiablo's picture
User offline. Last seen 2 years 9 weeks ago. Offline
Joined: 2014-06-01
Posts: 53

yep, and in shopplanderV2 i mixed the script with ShoppaMap script so it generates shoppa maps Big Grin

nema sreće ako se ne meće Hellish Hand Grenade

User login

Copyright © 2004-2024 Hedgewars Project. All rights reserved. [ contact ]