Sauerworld Forum

Sauerbraten Content => Scripts => Topic started by: Alu on September 18, 2015, 09:48:13 PM

Title: Saw hudgun
Post by: Alu on September 18, 2015, 09:48:13 PM
i have no idea what I'm doing

but the idea is that when you have the saw the hudgun is turned on

at least I'm close to achieving something  :o ??


cierrahudgun = [cierra; cierraon; cierraoff]

cierra = [ sleep 10 [if (&& (= (getweapon) 7) (= contador 1)) [hudgun 1]] cierra ]
cierraon = [ sleep 9 [if (= (getweapon) 7) [contador = 1]] cierraon ]
cierraoff = [ sleep 8 [if (&& (= contador 1) (!= (getweapon) 7)) [contador = 0]] cierraoff ]

cierrahudgun


umm I suspect the problem is with the "contador = 1, contador = 0"     the counter
Title: Re: Saw hudgun
Post by: Quality on September 19, 2015, 07:46:29 AM
Everywhere you want to get the value of contador, you need to use '$'.
E.g.
Code: [Select]
if (= $contador 1) ...I think it should work then.
Title: Re: Saw hudgun
Post by: Alu on September 19, 2015, 06:54:19 PM
with more common sense:

------
contador = 1

cierra = [if (&& (= (getweapon) 7) (= $contador 1)) [hudgun 1] [hudgun 0]]

cierra
----------

why the hell does not work? :'v

It did not work as it was before
and it does not work now
Title: Re: Saw hudgun
Post by: Alu on September 19, 2015, 07:56:02 PM
dont know wheres the problem with my linear code ¿?

copying and passing the structure of another in my config (ardelico weapons sens)
this works well :) :

--------------------------

cierrahudgun = [cierra]
escopetahudgun = [escopeta]

cierra = [
        sleep 5 [
                if (= (getweapon) 0) [hudgun 1] [hudgun 0]             
        ] cierra
]

escopeta = [
        sleep 5 [
                if (= (getweapon) 1) [hudgun 1] [hudgun 0]             
        ] escopeta
]

cierrahudgun
escopetahudgun

-------------------------

the game does not like the linear code :v ?

I find it very confusing if he is not linear
Title: Re: Saw hudgun
Post by: Alu on September 19, 2015, 09:51:58 PM
haha still not working


I think that this fixed:

cierrahudgun = [armas]

armas = [
        sleep 5 [
                if (|| (= (getweapon) 1) (= (getweapon) 0)) [hudgun 1] [hudgun 0]             
        ] armas
]

cierrahudgun
Title: Re: Saw hudgun
Post by: frosty on September 21, 2015, 01:14:12 AM
try clearing configs
Title: Re: Saw hudgun
Post by: Alu on September 21, 2015, 02:59:47 AM
try clearing configs


No, it was not that, was the syntax the [] and () spaces or something
- I have always clean the config file


this works well:

----------------------------------------------------------
weaphudguns = [weapons]

Weapons = [
         sleep 5 [
                 if (|| (= (getweapon) 1) (= (getweapon) 0)) [hudgun 1] [hudgun 0]
         ] weapons
]

weaphudguns
Title: Re: Saw hudgun
Post by: Suicizer on November 22, 2016, 04:21:49 PM
Why are you guys using "weaphudsguns", while "weapons" is the exact same thing in the script?
Title: Re: Saw hudgun
Post by: RaZgRiZ on December 06, 2016, 03:44:54 PM
I don't think they even know what they're trying to do in the first place.
Title: Re: Saw hudgun
Post by: star on December 06, 2016, 03:47:48 PM
nice necro bumps.

[closed]